* Consolidate fopAcM_STATUS into fopAc_Status_e * Add _e suffix to fopAcStts enums * Prepare for profile enumeration * Correct typo in scene_process_profile_definition * Manually handle g_profile_Obj_DamCps (inline preprocessing) * Correct g_profile_TAG_LV5SOUP procname to enum * Create d_priority.h * Update process profile definitions * Moved inline comments to the left * Add missing fopAcStts enums * Add d_priority.h include in f_pc_leaf.h * Manually update d_a_obj_damCps profile * Replace fopAcStts enums replacing and anticipatory profile size correction * Changed profile size from literal to sizeof() in anticipation of PR #3116 * Provided putative names to staff-related status enums * Replaced appropriate literals with fopAcStts enums * Fix borked merge * Rename item number enums and move to d_item_data.h * Rename process profile name & draw priority enums * Move process profile name & draw priority enums to appropriate files * Moved fpcNm_ enums from d/d_procname.h to f_pc/f_pc_name.h * Moved fpcDwPi_ enums from d/d_priority.h to f_pc/f_pc_draw_priority.h * ACTUALLY (whoops) stage merge * Correct item mistranslation Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com> --------- Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com>
The Legend of Zelda: Twilight Princess
A work-in-progress decompilation of The Legend of Zelda: Twilight Princess.
The code for the GameCube releases is completely matching. However, not every Translation Unit (TU) has been linked yet. Work is continuing by aligning the Debug version and getting the Wii versions to match. All versions are built from the same codebase using conditional compilation.
Important
This repository does not contain any game assets or assembly whatsoever. An existing copy of the game is required.
This project itself is not, and will not, produce a port, to PC or any other platform. It is a decompilation of the original game code, which can be compiled back into a binary identical to the original.
The project can target the following supported versions:
GZ2E01: GameCube - North AmericaGZ2P01: GameCube - Europe/AustraliaGZ2J01: GameCube - JapanRZDE01_00: Wii - North America (Rev 0)RZDE01_02: Wii - North America (Rev 2)RZDP01: Wii - Europe/AustraliaRZDJ01: Wii - JapanDZDE01: Wii - North America (Kiosk Demo)Shield: Nvidia Shield - ChinaShieldD: Nvidia Shield - China (Debug Version)
More information about the project can be found here: https://zsrtp.link
Dependencies
You will need the following dependencies:
- git
- ninja
- python3
- clang-format (optional)
Windows
On Windows, it's highly recommended to use native tooling. WSL or msys2 are not required.
When running under WSL, objdiff is unable to get filesystem notifications for automatic rebuilds.
- Install Python and add it to
%PATH%.- Also available from the Windows Store.
- Download ninja and add it to
%PATH%.- Quick install via pip:
pip install ninja
- Quick install via pip:
macOS
-
Install ninja:
brew install ninja
wibo, a minimal 32-bit Windows binary wrapper, will be automatically downloaded and used.
Linux
- Install ninja.
wibo, a minimal 32-bit Windows binary wrapper, will be automatically downloaded and used.
Building
-
Clone the repository:
git clone https://github.com/zeldaret/tp.git -
Copy your game's disc image to
orig/GZ2E01.- Supported formats: ISO (GCM), RVZ, WIA, WBFS, CISO, NFS, GCZ, TGC.
- After the initial build, the disc image can be deleted to save space.
-
Configure:
python configure.pyTo use a version other than
GZ2E01(GCN USA), specify it with--version. -
Build:
ninja
Diffing
Once the initial build succeeds, an objdiff.json should exist in the project root.
Download the latest release from encounter/objdiff. Under project settings, set Project directory. The configuration should be loaded automatically.
Select an object from the left sidebar to begin diffing. Changes to the project will rebuild automatically: changes to source files, headers, configure.py, splits.txt or symbols.txt.
Contributing
If you've got all the requirements set up and want to learn how to contribute to the decompilation effort, join our Discord server and check out our contribution guide.
