Sonic Heroes Decompilation
A work-in-progress, non-commercial decompilation of Sonic Heroes (SEGA, 2003) for the Nintendo GameCube: C and C++ source that, built with the original compilers, reproduces the retail game byte for byte. No game code, no assets, no download.
extern "C" void itembaloonObjectUnload(void)
{
endObjItempanel();
itembaloonResource = NULL;
}
extern "C" void itembaloonObjectLoad(void)
{
itembaloonResource =
objPointerReadFromClumpAnim(itembaloonModelName);
initObjItempanel();
}
Decompilation progress
Numbers come from the objdiff report of every build on main. A function only counts once it compiles to exactly the same bytes as the original. Full progress and milestones →
What this project is, and what it is not
It is
- Hand-written C, C++ and inline assembly source
- Verified byte for byte against the retail
main.doland all 17 REL modules - A non-commercial study and preservation effort
- Checked by CI: every change rebuilds the DOL and every REL and compares their SHA-1
- Open source under the MIT license (our code only)
It is not
- A playable game, a port, or a download of the game
- Shipping any ROM, disc image or game asset
- Shipping original binary code or assembly extracted from the disc
- Affiliated with or endorsed by SEGA
- Monetized: no ads, no donations, no paid builds
You need your own legally obtained copy of the game to build anything. A build is only useful to somebody who already owns it.
How a matching decompilation works
The goal is not code that merely behaves like the game. The goal is source that, compiled with the original toolchain, produces the exact same bytes as the disc.
Byte for byte
Each function is rewritten until its compiled output is identical to the original, checked in objdiff. Anything less does not count as matched.
Original toolchain
The game was built with Metrowerks CodeWarrior. The same compiler versions are downloaded at build time (and run through wibo on Linux and macOS). No compiler binaries live in the repository.
Verified on every change
The disc ships no .map file, so names and file boundaries are worked out from evidence. Every push rebuilds main.dol and all 17 RELs and checks their SHA-1 against the retail disc.
Why decompile Sonic Heroes?
Preservation
Sonic Heroes was released in 2003 for GameCube, PlayStation 2, Xbox and PC. Readable source is the most durable record of how a game actually works, long after the hardware is gone.
Understanding
Physics, the three-character formation system, stage objects and RenderWare rendering become documented code that anyone can read, instead of guesses.
A foundation
A complete matching decompilation is what fan ports, mods and bug-fix projects are usually built on. This repository only reproduces the original game; what others build on it later is up to them.
AI-assisted, verified by bytes
Language models help write parts of this decompilation, and we say so openly. They never decide what counts as done: a function is only marked as matching when its compiled bytes are identical to the original in objdiff, and CI rebuilds and hashes the whole game on every change.
That check cannot be fooled by code that only looks right. Code that does not reproduce the retail instructions, data and relocations exactly is simply not merged as matching.
Recent milestones
61 reconstruction pull requests integrated
A large batch from Cypress lands in one integration (#612).
23.7% of code
Code shared between stages is written once and linked into every module that uses it, sometimes 13 at a time.
decomp.dev closes its public index
The progress tracker the project used since July stops listing projects. Tracking moves to ByteMatch, which reads the same CI reports.
35.4% of code, over half of all functions
20,559 of 39,062 functions match, and every SDK library function is done.
Built in the open
Contributors from the GameCube decompilation, Dreamcast homebrew and Sonic modding scenes have helped since day one. Questions, research and claims of work happen on the Discord; code goes through pull requests on GitHub.