2020-08-29 17:54:55 -04:00
# The Legend of Zelda: Twilight Princess
This repo contains a WIP decompilation of The Legend of Zelda: Twilight Princess (GCN USA).
2022-03-22 09:42:08 -04:00
<!--ts-->
2022-04-10 16:29:58 -06:00
* [Progress ](./Progress.md )
2022-03-22 09:42:08 -04:00
* [Project Setup ](#project-setup )
2022-03-22 23:58:57 -04:00
* [Building The Game ](#building-the-game )
2022-03-22 09:42:08 -04:00
* [Clean Directories ](#clean-directories )
* [Project Overview ](#project-overview )
* [Contributing ](./docs/Contributing.md )
* [FAQ ](https://zelda64.dev/games/tp )
<!--te-->
2020-08-29 17:54:55 -04:00
2022-03-22 09:42:08 -04:00
Project Setup
=================
2020-08-29 17:54:55 -04:00
2022-03-22 09:42:08 -04:00
1. Clone down project
2021-06-13 19:47:12 -04:00
```bash
2022-10-15 15:32:34 -06:00
git clone https://github.com/zeldaret/tp
2021-06-13 19:47:12 -04:00
```
2022-03-22 09:42:08 -04:00
2. Setup compiler directory
2021-06-13 19:47:12 -04:00
```bash
2022-10-15 15:32:34 -06:00
mkdir -p tools/mwcc_compiler/
2022-03-22 09:42:08 -04:00
```
2023-01-20 19:51:21 +02:00
3. Download [GC_WII_COMPILERS.zip ](https://cdn.discordapp.com/attachments/727918646525165659/917185027656286218/GC_WII_COMPILERS.zip ).
2022-03-22 09:42:08 -04:00
4. Extract `GC_COMPILERS.zip` into the previously created `mwcc_compiler` directory
```bash
2022-10-15 15:32:34 -06:00
unzip GC_COMPILERS.zip -d tools/mwcc_compiler/
2022-03-22 09:42:08 -04:00
```
5. Place a copy of NTSC-U GCN Twilight Princess in the root directory and call it `gz2e01.iso` (find this on your own)
6. Setup the project
```bash
2022-10-15 15:32:34 -06:00
./tp setup
2022-03-22 09:42:08 -04:00
```
Building The Game
-----
1. To build a playable game, complete the [Project Setup ](#project-setup ) steps, then run
```bash
2022-10-15 15:32:34 -06:00
make game
2022-03-22 09:42:08 -04:00
```
The completed build is under `build/dolzel2/game/sys/main.dol`
Build DOL
```bash
2022-10-15 15:32:34 -06:00
make
2022-03-22 09:42:08 -04:00
```
2022-04-10 16:29:58 -06:00
(Note that any time you run make you can add the -j# argument where # is the amount of threads your system has in order to greatly speed up build times)
2022-03-22 09:42:08 -04:00
Build RELs
```bash
2022-10-15 15:32:34 -06:00
make rels
2022-03-22 09:42:08 -04:00
```
The completed RELs will be under `build/dolzel2/rel`
Extract Game Assets
```bash
2022-10-15 15:32:34 -06:00
make assets
2022-03-22 09:42:08 -04:00
```
Create Expected Directory
2022-03-22 23:58:57 -04:00
1. Run `make`
2022-03-22 09:42:08 -04:00
2. Run:
```bash
2022-10-15 15:32:34 -06:00
./tp expected
2022-03-22 09:42:08 -04:00
```
2021-06-13 19:47:12 -04:00
2020-08-29 17:54:55 -04:00
2022-03-22 09:42:08 -04:00
Clean Directories
-----
2020-08-29 17:54:55 -04:00
2022-03-22 09:42:08 -04:00
Clean RELs
2020-09-05 15:21:05 -04:00
2022-03-22 09:42:08 -04:00
```bash
2022-10-15 15:32:34 -06:00
make clean_rels
2022-03-22 09:42:08 -04:00
```
Clean Game Directory
```bash
2022-10-15 15:32:34 -06:00
make clean_game
2022-03-22 09:42:08 -04:00
```
Clean Build Directory
```bash
2022-10-15 15:32:34 -06:00
make clean_all
2022-03-22 09:42:08 -04:00
```
2022-04-10 16:29:58 -06:00
Clean Dol
2022-03-22 09:42:08 -04:00
```bash
2022-10-15 15:32:34 -06:00
make clean
2022-03-22 09:42:08 -04:00
```
Project Overview
=================
```
tp/
├── .github # Github actions for this project.
├── asm # The assembly for unmatched functions.
├── defs # Python modules used by dol2asm.
├── docs # Notes and documentation about this project.
├── include # Header files used by this project.
├── libs # Source code for the libraries based on the symbol map.
├── rel # Source code for the game RELs.
├── src # Source code for the main game.
├── tools # Various tools to support the project.
├── .clang-format # Clang format file.
├── .gitignore # Files/folders to ignore changes to when making commits.
├── Doxyfile # Doxygen configuration file.
├── Makefile # Makefile for the project containing various targets.
2022-04-10 16:29:58 -06:00
├── Progress.md # Markdown file that displays the current progress of the project.
2022-03-22 09:42:08 -04:00
├── README.md # The file you're currently reading.
├── diff.py # Python script to diff two functions.
├── diff_settings.py # Settings for the diff.py script.
├── dolzel2.sha1 # SHA1 of the dol.
├── include_link.mk # Makefiles to include in the main Makefile.
├── obj_files.mk # Object files to include in the main Makefile.
└── tp # Bash script used to call the main tp python script in tools directory.
```