Research and benchmarksPartialSource available
Target: smsggrecomp

smsggrecomp: Z80 Static Recompiler

Platform
Windows, macOS, Linux
Outcome
Partial
smsggrecomp: A static recompiler for Sega Master System and Game Gear ROMs.
Image: Source: raw.githubusercontent.com

Evidence at a glance

Loading source evidence…

What was done

smsggrecomp translates Z80 ROM binaries into native C code. It uses a clean-room runner for hardware emulation, achieving byte-identical VRAM/CRAM results in early testing for Sonic the Hedgehog and Sonic Blast. Full-gameplay coverage remains unverified.

The smsggrecomp project is a static recompiler that translates Sega Master System and Game Gear Z80 ROM binaries into native C code. Unlike an emulator, it recompiles the CPU instructions while using a clean-room runner to model surrounding hardware, such as the VDP, PSG, and I/O. The project is in an early pre-release state (v0.0.3), with Sonic the Hedgehog (SMS) and Sonic Blast (Game Gear) currently in bring-up. Validation against independent emulators (Mesen 2 and Genesis Plus GX) indicates byte-identical VRAM/CRAM output for the tested segments, though full-gameplay coverage is unverified. The recompiler utilizes a shared Z80 core and includes an assisted coverage pass to extend testing routes. AI assistance, specifically Claude Opus 4.8, is credited in the commit history for contributions including accuracy analysis, bug fixes in PSG synthesis, and documentation of validation records. The project maintains a hybrid execution path where computed jumps that cannot be resolved by static analysis fall back to a vendored Z80 interpreter.

Reproduce it

setup

Clone the repository recursively, initialize the Z80 core submodule, and use CMake to build the recompiler. Run the generated executable against a legally obtained ROM using the provided game.toml configuration.

Community

Ask a question, share what worked, or follow the next milestone.

Your library