Repository navigation
Releases
v0.0.2: Zillion 3D MD: improve wall rendering speed and fix persistent square that appeared during gameplay.
Full Changelog: v0.0.1...v0.0.2
⚡ Performance Optimization Summary
-
Framerate Change: Increased from ~5.5 FPS to ~8.7 FPS (measured in the starting room on emulator).
-
Precompiled Wall Scalers: Replaced generic runtime column-scaling loops with height-specialized assembly routines in ROM.
- Trade-off: ROM binary size grew from 3.1 MB to 3.4 MB.
-
Ray Interpolation: Full ray-casting calculations are now performed for every second ray. Intermediate rays hitting the same wall face interpolate height and texture coordinates.
- Trade-off: Causes minor ±1 texel shifts on wall textures in certain angles.
-
Overdraw Reduction: Floor and ceiling spans are filled conditionally, bypassing areas obscured by wall geometry.
-
Ray-Stepping & Distance Math: Tightened register allocation for the primary DDA step loop and optimized distance calculation setup.
🕹️ Input Handling Adjustments
-
Action Button Latching: Button taps (Start, Fire, Use) are latched in state until consumed by the frame loop to prevent dropped inputs at low framerates (~8 FPS).
-
Movement Unlatched: D-pad directional input remains instantaneous to prevent controls from feeling floaty or continuing after release.
🐛 VRAM Glitch Fix
-
Issue: Persistent cyan square rendered on-screen during movement.
-
Cause: SGDK's default sprite attribute table location (
0xF400) overlapped with tile RAM, causing the VDP to interpret tile patterns as hardware sprite attributes. -
Fix: Relocated the sprite table base address to an unused, zeroed VRAM block, disabling unwanted VDP sprite rendering.Here is a concise breakdown of the v0.0.2 performance update and bugfix release for Zillion 3D on the Sega Genesis:
⚡ 3D Engine & Performance Optimizations
-
Precompiled Straight-Line Column Scalers: Replaced runtime per-pixel fixed-point column loops with precompiled 68000 machine code generated across 321 height steps (
0..512).-
ROM Budget Optimization: Upgraded the scaler generator to emit 4-byte 12-cycle register-indirect moves (
move.b (a0),d16(a1)) andlea d16(a0),a0texel skips. This reduced the scalers' code size by 61,104 bytes (197,640 B → 136,536 B), keeping the 20-level build safely under the 4.00 MB Genesis ROM ceiling without needing bank switching.
-
ROM Budget Optimization: Upgraded the scaler generator to emit 4-byte 12-cycle register-indirect moves (
-
Same-Face Ray Interpolation: Odd screen columns are skipped and interpolated when neighboring even rays hit the same wall face within a height delta of
$\vert{}H_{\text{left}} - H_{\text{right}}\vert{} \le 2$ . -
16-Bit Signed DDA Stepping & Distance Projection: Replaced 32-bit projection math with hardware
mulsinstructions (vc15/vs15) and shifted 16-bits16map offsets, enabling single-instructiond8(An,Dn.w)indexed reads. -
Incremental Background Clears & Weapon Blitting: Overdraw is reduced by clearing only newly exposed rows between frame clear bounds and trimming transparent spans on HUD weapon sprites.
-
VBlank Button Tap Latching: Integrated input latching (
IN_Latch()) to capture short button taps (fire, use, strafe, menu) across VBlanks, preventing dropped inputs during low-framerate gameplay.
🐛 Bug Fixes
-
Persistent Cyan Square Removed: Relocated SGDK's VDP sprite attribute table base address via
VDP_setSpriteListAddress(0xB800)out of0xF400(which previously collided with framebuffer tile DMA transfers), permanently removing the stray on-screen square artifact. -
20-Level SRAM Save/Load Stack Corruption Fixed: Corrected
Save_Read()where the level array (u16 rtm[8]) was undersized for Zillion 3D's 20-level campaign. Updated tou16 rtm[NUM_LEVELS](20 * 2 = 40bytes), preventing stack corruption during SRAM load operations.
📊 Benchmark Comparison (Genesis Plus GX, NTSC 59.92 Hz)
| Benchmark Scenario | v0.0.1 (Original) | v0.0.2 (Updated) | Performance Gain |
|---|---|---|---|
| Start Corridor (1,190 VBlanks) | 5.45 FPS (108 renders) | 9.04 FPS (179 renders) | +65.9% |
| Wide Spawn Room View (1,200 VBlanks) | 5.54 FPS (111 renders) | 7.49 FPS (150 renders) | +35.1% |
| Episode 2 Combat & Doors (1,000 VBlanks) | ~4.85 FPS (~81 renders) | 6.59 FPS (110 renders) | +35.9% |
v0.0.1: Port Zillion 3D to Sega Mega Drive using Arena.
Full Changelog: https://github.com/haroldo-ok/zillion-3d-md/commits/v0.0.1
🔫 What is Zillion 3D?
Zillion 3D brings the anime-themed Wolfenstein 3D total conversion mod (featuring characters and aesthetics from Akai Koudan Zillion) directly to the Sega Genesis! Built on the open-source Genesis Wolfenstein 3D engine, this complete homebrew port includes all levels, custom artwork, digitized audio, and music from the original mod without relying on temporary placeholders.
📜 Features & Highlights
-
Full 20-Level Campaign: Includes both Episode 1 and Episode 2 (10 floors each), complete with secret elevator levels on Floor 10 and proper intermission statistics.
-
Custom Graphics & Artwork: Replaces classic Nazi enemies, walls, weapon sprites, and HUD elements with original Zillion 3D mod assets.
-
Complete Sound & Music Engine: Features 48 digitized sound effects and all 27 original music tracks rearranged for the Genesis hardware.
-
Battery SRAM Save Support: High scores, intermission records, and save slots cover progress across all 20 levels.
🕹️ Controls
Title Screen & Menus
| Input | Action |
|---|---|
| D-Pad Up / Down | Move menu selection |
| Button A / START | Confirm selection (Select Episode 1 or Episode 2, then difficulty) |
| Button B | Back out / cancel menu |
In-Game (3-Button Controller)
| Input | Action |
|---|---|
| D-Pad | Move forward / backward, turn left / right |
| Button B | Fire weapon |
| Button A | Run |
| Button C | Open doors, activate switches, search walls |
| Hold C + D-Pad Left / Right | Strafe (step sideways) |
| Button A + C | Cycle to the next weapon |
| START | Pause menu (New Game, Sound Options, Controls, Save / Load, High Scores) |
6-Button Controller Shortcuts: Use X for Knife, Y for Pistol, and Z for Machine Gun.