# 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.

- Type: Case study
- Targets: Game
- Category: Independent reconstruction cases
- Relationship: Independent reconstruction project
- Sources reviewed: 2026-10-19
- Added to the catalog: 2026-10-27
- Original resource: <https://github.com/zeldaret/ph>
- Primary source: <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/README.md>
- Catalog page: <https://awesomerea.org/resources/phantom-hourglass-ds-decomp-case/>
- Record JSON: <https://awesomerea.org/resources/phantom-hourglass-ds-decomp-case/record.json>
- Chinese version: [简体中文](https://awesomerea.org/zh/resources/phantom-hourglass-ds-decomp-case/index.md)

## 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.
- The repository carries CC0-1.0; that dedication does not cover Nintendo’s game, its extracted files, the BIOS or the downloaded Metrowerks compiler.

## Primary sources

1. <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/README.md>
2. <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/INSTALL.md>
3. <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/extract/README.md>
4. <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/docs/build_system.md>
5. <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/tools/configure.py>
6. <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/tools/download_tool.py>
7. <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/ph_usa.sha1>
8. <https://github.com/zeldaret/ph/tree/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/config>
9. <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/.github/workflows/build.yml>
10. <https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/LICENSE>
11. <https://decomp.dev/zeldaret/ph>

## More in Games

- [Pikmin 2: a fully matched GameCube decompilation across five releases](https://awesomerea.org/resources/pikmin-2-matching-decomp-case/index.md) · Case study
- [pokecrystal: a matching Pokémon Crystal disassembly](https://awesomerea.org/resources/pokecrystal-disassembly-case/index.md) · Case study
- [pokered: a matching Pokémon Red and Blue disassembly](https://awesomerea.org/resources/pokered-disassembly-case/index.md) · Case study
- [pokeruby: a matching Pokémon Ruby and Sapphire decompilation](https://awesomerea.org/resources/pokeruby-decomp-case/index.md) · Case study
- [Pokémon Emerald: a matching Game Boy Advance decompilation](https://awesomerea.org/resources/pokemon-emerald-decomp-case/index.md) · Case study
- [Pokémon FireRed and LeafGreen: a matching Game Boy Advance decompilation](https://awesomerea.org/resources/pokemon-firered-leafgreen-decomp-case/index.md) · Case study

## About this entry

The description was reviewed against primary sources.
Original editorial content: MIT. Linked projects, papers and assets retain their own rights and licenses.
