
Sonic the Hedgehog
Port nativo de Sonic the Hedgehog para PC.
Sonic the Hedgehog
Port nativo basado en rjkiv/sonic06.
README del repositorio
SonicTheHedgehogSMSRecomp
Static recompilation of Sonic the Hedgehog (Sega Master System, 1991) into
native C, using the smsggrecomp
framework. This repo is the per-game side: the game.toml, the build glue, and
a pre-built release. The ROM and the generated C are not here — you supply
your own legally-dumped ROM and regenerate locally.
What "static recompilation" means here
The game's Z80 machine code is translated ahead of time into C and compiled to a native binary — it is not interpreted at runtime. The rest of the Master System (VDP, SN76489 sound, controller/system ports, the Sega mapper) is modeled by the smsggrecomp runtime. Computed jumps the static analysis can't resolve fall back to a bundled Z80 interpreter over the live bus. You supply your own legally-dumped copy of the ROM; it is never redistributed here.
Status
v0.0.4 — assisted coverage pre-release. The assisted survey covers 27 original level/bonus selectors and two ending variants through the staff roll. The ROM-verified dispatch profile runs those routes with zero fallback. All 89 native/interpreter rendered checkpoints agree. These are assisted scene tests; full unassisted gameplay remains unverified. See coverage details and reproducible routes.
Screenshots
Recompiled native build (no emulator), captured running the .sms ROM:
| Green Hill Zone | Zone title card |
|---|---|
![]() | ![]() |
Quick start (pre-built release)
- Download
SonicTheHedgehogSMSRecomp-windows-x64.zipfrom Releases and unzip it (keepSDL2.dllnext to the.exe). - Supply your own legally-obtained Sonic the Hedgehog (SMS) ROM (
.sms). - Run it with your ROM:
SonicTheHedgehogSMSRecomp.exe path\to\sonicthehedgehog.sms --window 3
For faithful 16x internal resolution, add --internal-scale 16, or drag your ROM onto
Play 16x.cmd in the release ZIP. Tile artwork stays sharp with no smoothing or
invented detail. Play.cmd uses the normal native-resolution display. Both run
with normal audio. An unsupported GPU falls back to native output.
Controls
| Key | Action |
|---|---|
| Arrow keys | D-pad |
| Z | Button 1 (jump) |
| X | Button 2 |
| Enter | Start / Pause |
| Esc | Quit |
ROM
| Field | Value |
|---|---|
| Title | Sonic the Hedgehog (SMS) |
| Region | USA / Europe / Brazil (identical retail image) |
| CRC32 | 0xB519E833 |
| Size | 256 KB |
The ROM is never redistributed — supply your own legally-dumped copy.
Building from source
Initialize recursive submodules and install native Windows CMake, Ninja, GCC
and SDL2 (the helper defaults to MSYS2 C:\msys64\mingw64). The shared build
graph builds the recompiler and regenerates the native C from your own ROM:
git submodule update --init --recursive
powershell -File build.ps1 -Rom 'path\to\sonicthehedgehog.sms'
.\build\SonicTheHedgehogSMSRecomp.exe 'path\to\sonicthehedgehog.sms' --window 3
-Build accepts an absolute directory; invoking the script from another
directory still builds this project. -Framework selects an alternate engine
checkout. -SkipRegenerate requires compatible generated sources already on
disk. Generated C and ROMs are ignored and are not distributed.
For a deterministic coverage run:
python smsggrecomp/tools/run_coverage_suite.py --runtime build/SonicTheHedgehogSMSRecomp.exe --rom path/to/sonicthehedgehog.sms --suite tests/coverage/suite.json --out coverage-new
Repo layout
| Path | Purpose |
|---|---|
game.toml | Per-game config: ROM identity, mapper, RAM layout, discovery seeds, jump tables. |
build.ps1 | Regenerate from your ROM + build the windowed exe. |
smsggrecomp/ | Pinned engine submodule used to build the game. |
generated/ | Recompiler output (gitignored; regenerated from your ROM). |
License
Not yet declared. Code in this repo is original. The Sonic the Hedgehog ROM and any data derived from it are not in this repo and are not licensed for redistribution.
Comentarios (0)
Inicia sesión para dejar un comentario.
Sé el primero en comentar sobre este juego.


