{
  "added_at": "2026-10-27",
  "additional_evidence_urls": [
    "https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/INSTALL.md",
    "https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/extract/README.md",
    "https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/docs/build_system.md",
    "https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/tools/configure.py",
    "https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/tools/download_tool.py",
    "https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/ph_usa.sha1",
    "https://github.com/zeldaret/ph/tree/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/config",
    "https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/.github/workflows/build.yml",
    "https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/LICENSE",
    "https://decomp.dev/zeldaret/ph"
  ],
  "category": "reconstruction-cases",
  "description_en": "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.",
  "description_zh": "通过手工反编译，为《塞尔达传说 幻影沙漏》的欧版与美版 Nintendo DS 重建 C++ 源码：借助 dsd 工具集从使用者自备的 ROM 中拆分代码，再重新构建 ROM。objdiff 逐个函数跟踪匹配情况，默认构建会将输出 ROM 与仓库保存的 SHA-1 比对。项目仍处于早期阶段：decomp.dev 报告所审提交有 2.82% 的代码已匹配。",
  "entry_url": "https://awesomerea.org/resources/phantom-hourglass-ds-decomp-case/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/phantom-hourglass-ds-decomp-case/",
  "evidence_url": "https://github.com/zeldaret/ph/blob/f0799bd6038be6858499ec68f0d03cdbbfa53d0b/README.md",
  "group": "cases",
  "id": "phantom-hourglass-ds-decomp-case",
  "json_url": "https://awesomerea.org/resources/phantom-hourglass-ds-decomp-case/record.json",
  "kind": "case-study",
  "markdown_url": "https://awesomerea.org/resources/phantom-hourglass-ds-decomp-case/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/phantom-hourglass-ds-decomp-case/index.md",
  "name": "Phantom Hourglass: an early-stage matching Nintendo DS decompilation",
  "name_zh": "《幻影沙漏》：早期阶段的 Nintendo DS 一致性反编译",
  "reconstruction_method": "matching-decompilation",
  "record_type": "resource",
  "relationship": "independent-reconstruction",
  "requirements": [
    "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."
  ],
  "requirements_zh": [
    "README 标明项目仍在进行中，目标为欧版和美版，其他版本日后可能支持；configure.py 接受 eur 或 usa。反编译范围是 ARM9 程序及其 TCM 模块和覆盖层，docs/build_system.md 说明 ARM7 程序不在反编译之列。产物是 Nintendo DS ROM，不是 PC 移植。",
    "需为每个版本将自己的已解密基础 ROM 以 baserom_ph_eur.nds 或 baserom_ph_usa.nds 放入 extract/，并与 extract/README.md 所列 SHA-1 一致；随后由 dsd 在本地从中提取代码和素材。INSTALL.md 称逐字节一致的 ROM 是可选项，要生成它还需使用者自己的 DS ARM7 BIOS 文件，且须与所列两个 SHA-1 之一相符。README 称仓库不含素材或汇编；不过 config/ 提交了源自游戏的 dsd 拆分、符号与重定位表，每个版本 65 个模块。",
    "INSTALL.md 列出的平台为 Windows（推荐）或 Linux，需 Python 3.11+ 与 pip、GCC 9+、Ninja 以及 pre-commit 钩子；在 Linux 上默认通过 wibo 运行 Windows 编译器，也可改用 Wine。configure.py 从 GitHub 发行版下载 dsd v0.11.0、objdiff v3.4.0、sjiswrap v1.2.2 和 wibo 0.6.16，并从 decomp.aetias.com 下载 Metrowerks mwccarm 编译器包（使用其中的 2.0/sp1p5 版本）。",
    "默认 ninja 目标会生成 objdiff 数据、运行 dsd 的模块与符号检查，并将构建出的 ROM 与 ph_eur.sha1 或 ph_usa.sha1 比对。CI 在提供提取文件和编译器的构建容器中构建两个版本，执行 ARM9 链接、objdiff 报告和各项检查，但不校验 ROM 哈希。decomp.dev 针对该固定提交的默认 usa 报告显示，3,622,306 个代码字节中有 102,202 个（2.82%）、24,610 个函数中有 1,351 个已匹配，190 个单元中有 28 个已完成。",
    "仓库采用 CC0-1.0；该声明不涵盖任天堂的游戏及其提取文件、BIOS 或下载的 Metrowerks 编译器。"
  ],
  "targets": [
    "game"
  ],
  "url": "https://github.com/zeldaret/ph",
  "verification": "source-reviewed",
  "verified_at": "2026-10-19"
}
