Case study
Phantom Hourglass: an early-stage matching Nintendo DS decompilation
Recreates C++ source for The Legend of Zelda: Phantom Hourglass by hand-decompiling its European and US Nintendo DS releases, using the dsd toolkit to delink code from a user-supplied ROM and rebuild the ROM. objdiff tracks matches function by function, and the default build compares the output ROM with a stored SHA-1. The work is at an early stage: decomp.dev reported 2.82% of code matched at the reviewed commit.
Requirements & limits
- README marks the project as a work in progress that targets the European and American versions, with other versions possibly supported later; configure.py takes eur or usa. Decompilation covers the ARM9 program, its TCM modules and overlays, while docs/build_system.md says the ARM7 program is not decompiled. The output is a Nintendo DS ROM, not a PC port.
- Supply your own decrypted base ROM for each version in extract/ as baserom_ph_eur.nds or baserom_ph_usa.nds, matching the SHA-1 values in extract/README.md; dsd then extracts code and assets from it locally. INSTALL.md calls a byte-matching ROM optional and requires the user’s own DS ARM7 BIOS file, matching one of two listed SHA-1 values, to produce one. README says the repository contains no assets or assembly; config/ does commit game-derived dsd delink, symbol and relocation tables for 65 modules per version.
- INSTALL.md lists Windows (recommended) or Linux with Python 3.11+ and pip, GCC 9+, Ninja and pre-commit hooks; on Linux the Windows compiler runs through wibo by default, or Wine on request. configure.py downloads dsd v0.11.0, objdiff v3.4.0, sjiswrap v1.2.2 and wibo 0.6.16 from GitHub releases, and a Metrowerks mwccarm bundle (version 2.0/sp1p5 is used) from decomp.aetias.com.
- The default ninja targets generate objdiff data, run dsd’s module and symbol checks and compare the built ROM with ph_eur.sha1 or ph_usa.sha1. CI builds both versions in a build container that supplies extracted files and the compiler, running the ARM9 link, objdiff report and checks but not the ROM hash. decomp.dev’s default usa report for the pinned commit lists 102,202 of 3,622,306 code bytes (2.82%) and 1,351 of 24,610 functions matched, with 28 of 190 units complete; this collection ran no build.
- The repository carries CC0-1.0; that dedication does not cover Nintendo’s game, its extracted files, the BIOS or the downloaded Metrowerks compiler. The reviewed sources establish no AI or REA use, and no runtime reproduction is claimed.
About this entry
- Type
- Case study
- Category
- Independent reconstruction cases
- Relationship
- Independent reconstruction project
- Targets
- Game
Sources reviewed
The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.
Primary sources
- README.md GitHub · zeldaret/ph · Revision f0799bd
- INSTALL.md GitHub · zeldaret/ph · Revision f0799bd
- extract/README.md GitHub · zeldaret/ph · Revision f0799bd
- docs/build_system.md GitHub · zeldaret/ph · Revision f0799bd
- tools/configure.py GitHub · zeldaret/ph · Revision f0799bd
- tools/download_tool.py GitHub · zeldaret/ph · Revision f0799bd
- ph_usa.sha1 GitHub · zeldaret/ph · Revision f0799bd
- config GitHub · zeldaret/ph · Revision f0799bd
- .github/workflows/build.yml GitHub · zeldaret/ph · Revision f0799bd
- LICENSE GitHub · zeldaret/ph · Revision f0799bd
- https://decomp.dev/zeldaret/ph
More in Games
- Kinoko: reimplementing Mario Kart Wii’s physics engine for exact ghost replay · Case study
- Mario Kart: Double Dash!!: a matching GameCube decompilation of the debug build · Case study
- 3S Decomp: a byte-compared PS2 decompilation of Street Fighter III: 3rd Strike · Case study
- Halo: Combat Evolved: an incremental re-implementation patched into the original Xbox executable · Case study
- Paper Mario: The Thousand-Year Door: an early matching GameCube decompilation · Case study
- 3SX: a native Street Fighter III: 3rd Strike port continuing the PS2 decompilation · Case study