Files
ac-decomp/README.MD
T
Hexalotl 37523c19b9 Adding additional quick start guides and adding boundary calculating script (#244)
* Adding script to automate config file updates

* Adding doc covering basics of decomp.me

* Adding doc covering m2c basics

* Updating Ghidra doc with note about special inline functions

* Updating README with links to new docs
2024-02-08 08:14:13 +01:00

70 lines
4.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Animal Crossing Decompilation [![Discord Channel][discord-badge]][discord] ![rel progress] ![dol progress]
[discord]: https://discord.gg/hKx3FJJgrV
[discord-badge]: https://img.shields.io/discord/727908905392275526?color=%237289DA&logo=discord&logoColor=%23FFFFFF
[rel progress]: https://img.shields.io/endpoint?label=rel&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Fanimalcrossing%2Fus%2Frel%2F%3Fmode%3Dshield%26measure%3Dcode
[dol progress]: https://img.shields.io/endpoint?label=dol&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Fanimalcrossing%2Fus%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode
Decompilation in progress of Animal Crossing (GAFE01)
A decompilation of the original N64 version of the game is being worked on [here](https://github.com/zeldaret/af).
## Cloning
Use `--recursive` when cloning to have ppcdis in the repository.
## Building
> ️ When using Windows, it's recommended to use WSL.
### Docker
1. [Dump a copy of the game](./docs/extract_game.md) and extract **main.dol** and **foresta.rel.szs**.
2. Decompress **foresta.rel.szs** with yaz0 found in *tools/* (`yaz0 -d foresta.rel.szs foresta.rel`).
3. Place **main.dol** and **foresta.rel** in *dump/*.
4. Place **forest_1st.arc** and **forest_2nd.arc** in *dump/*.
5. Download the [CodeWarrior 1.3.2 and 1.2.5n compilers](https://files.decomp.dev/compilers_20230715.zip) and extract them to *tools/1.3.2/* and *tools/1.2.5n/*, respectively.
6. Download the [CodeWarrior 1.3.2r compiler](https://mega.nz/file/WuBFTCLT#TmB5R4-1mEFkk4G1Vjn9_cHXRD9wOIH9CtOLaVSWEas) and extract it to *tools/1.3.2r/*.
7. Install Docker.
8. Build the Docker image (`docker build -t ac-decomp .`).
9. Run configure.py (`docker run --rm -v ${PWD}:/ac-decomp ac-decomp python3 configure.py`).
10. Run build.py (`docker run --rm -v ${PWD}:/ac-decomp ac-decomp python3 build.py`).
### Build manually
> ️ When building manually from a work directory originally used for Docker, you will need to run `sudo ninja -t clean` for the build to execute properly.
1. [Dump a copy of the game](./docs/extract_game.md) and extract **main.dol** and **foresta.rel.szs**.
2. Decompress **foresta.rel.szs** with yaz0 found in *tools/* (`yaz0 -d foresta.rel.szs foresta.rel`).
3. Place **main.dol** and **foresta.rel** in *dump/*.
4. Place **forest_1st.arc** and **forest_2nd.arc** in *dump/*.
5. Download the [CodeWarrior 1.3.2 and 1.2.5n compilers](https://files.decomp.dev/compilers_20230715.zip) and extract them to *tools/1.3.2/* and *tools/1.2.5n/*, respectively.
6. Download the [CodeWarrior 1.3.2r compiler](https://mega.nz/file/WuBFTCLT#TmB5R4-1mEFkk4G1Vjn9_cHXRD9wOIH9CtOLaVSWEas) and extract it to *tools/1.3.2r/*.
7. Install Python, pip, and [ninja](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages#package-managers) using your package manager of choice.
8. Install Python modules from requirements.txt (`pip install -r requirements.txt`).
9. Install [wibo](https://github.com/decompals/wibo)
- Wibo is a lightweight Wine replacement that's tailor-made for use with decomp projects. Regular Wine can be used if preferred, but for the purposes of this guide, these instructions will use wibo.
- Download [the latest GitHub release](https://github.com/decompals/wibo/releases/latest) and run `install ./wibo /usr/bin` to install it to your system.
10. Install devkitPPC.
- To get devkitPPC, you'll need [devkitPro Pacman](https://devkitpro.org/wiki/devkitPro_pacman#Installing_devkitPro_Pacman).
- Run `dkp-pacman -S devkitPPC` once dkp-pacman is installed to install devkitPPC.
- Set the `DEVKITPPC` environment variable to */opt/devkitpro/devkitPPC*.
11. Set the `N64_SDK` environment variable to the path of your libultra or equivalent headers. If you need headers, you can use the ones from [ultralib](https://github.com/decompals/ultralib).
- Headers should be located at `$N64_SDK/ultra/usr/include`.
- You may need to modify `Gpopmtx`'s `param` member to be `unsigned int` in **gbi.h**.
12. Run `python3 configure.py`.
13. Run `python3 build.py`.
## Quick Guides
- [Dumping Game Files](./docs/extract_game.md)
- [Ghidra Setup](./docs/ghidra_setup.md)
- [Generating Decomp Context](./docs/generating_decomp_context.md)
- [decomp.me Basics](./docs/decomp_me_basics.md)
- [Ghidra Basics](./docs/ghidra_basics.md)
- [m2c Basics](./docs/m2c_basics.md)
- [Decomp Basics](./docs/decomp_basics.md)
## Credits
- jamchamb, Cuyler36, NWPlayer123 and fraser125 for past documentation of Animal Crossing.
- SeekyCt for [ppcdis](https://github.com/SeekyCt/ppcdis/) and helping setting up the project.
- msg for helping with *tools/map.py*.