Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Software:The Legend of Zelda: Twilight Princess

From ReverseEngineering.wiki
Software
Developer Nintendo EAD
Publisher Nintendo
Uses Library:JSystem, Library:Dolphin SDK
Platforms Platform:Nintendo GameCube, Platform:Nintendo Wii
On this wiki Facts · Code · Notes · Topics

Action-adventure game by Nintendo EAD (2006) for the Nintendo GameCube and Wii. The zeldaret/tp matching decompilation (CC0) builds the GameCube releases byte for byte and the Wii releases in progress, from one codebase.

Overview

Twilight Princess ships on the GameCube (sys/main.dol plus about 750 REL actor modules, game IDs GZ2E01 North America, GZ2P01 Europe, GZ2J01 Japan) and on the Wii (RZDE01_00, RZDE01_02, RZDP01, RZDJ01; kiosk demo DZDE01). The engine is the same: the framework executable is named framework.dol in the project and the actors are RELs named d_a_*. See Library:JSystem.

Builds

zeldaret/tp (CC0) at commit c8fa8c9e2aab72cf4e5db0e5d1c84a9ea6ee6eb0 publishes SHA-1 hashes of the original files in config/<GAMEID>/build.sha1 (one line per object, 758 lines: the DOL first, then every REL) and in config.yml hash:. Main DOL hashes:

Game ID Release SHA-1 of sys/main.dol
GZ2E01 GameCube NA 4997d93b9692620c40e90374a0f1dbf0e4889395
GZ2P01 GameCube PAL 8d06f67da2185bf10d1978125c46fd36de723219
GZ2J01 GameCube JP 847261078fc157620aed5f2d8ee84d3aa9193021
RZDE01_00 Wii NA rev 0 0f626c1bfbd05979ed78b634cc85248342452fc2
RZDE01_02 Wii NA rev 2 5a99acb37b98e19682924502ee14a6d03d536c69
RZDP01 Wii PAL a05fc0372eb427a5b5afc5e23c207aadbd10ebd1
RZDJ01 Wii JP 1ab0f344e99132d19b2e174355cbc68b74109905

The repository also has configs for the Nvidia Shield (China) release, Shield and ShieldD (a debug build with many more symbols), which are not DOL files.

Wii main DOLs registered as builds on this wiki with their symbols.txt imported (names and addresses, pinned to c8fa8c9e2a): Build:The Legend of Zelda: Twilight Princess/RZDE01 00 (Wii North America rev 0) (Nintendo Wii, disc), Build:The Legend of Zelda: Twilight Princess/RZDE01 02 (Wii North America rev 2) (Nintendo Wii, disc), Build:The Legend of Zelda: Twilight Princess/RZDP01 (Wii PAL) (Nintendo Wii, disc) and Build:The Legend of Zelda: Twilight Princess/RZDJ01 (Wii Japan) (Nintendo Wii, disc). The REL modules (config/<GAMEID>/rels/<module>/symbols.txt) are not imported. The importer read about 32,600 names for each Wii build and skipped about 220 (for example __sinit_\m_Do_main_cpp style names containing a backslash) and dropped about 180 names that share an address with an earlier one.

Symbols

config/<GAMEID>/symbols.txt is in Tool:Decomp-toolkit syntax (name = .section:0xADDR; // type:function size:0x.. scope:global): about 26,700 lines for GZ2E01, 33,650 for RZDE01_00, 71,000 for ShieldD. Each REL has its own config/<GAMEID>/rels/<name>/symbols.txt and splits.txt. The GameCube and Wii symbol files are separate: addresses differ between the builds.

Compilers

GameCube: Metrowerks GC/2.7; Wii: modified GC/3.0a3 compiler with GC/3.0a5 linker; see Platform:Nintendo Wii and Tool:Metrowerks CodeWarrior.

Code & repositories

See linked repositories.

  • https://github.com/zeldaret/tp @ c8fa8c9e2aab72cf4e5db0e5d1c84a9ea6ee6eb0 · license: CC0-1.0
    Matching decompilation of Twilight Princess (GameCube, Wii, Shield) with decomp-toolkit configs, build.sha1, symbols.txt and splits.txt per game ID
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-06-23