This is a work in progress matching decompilation of Sonic Advance 2
It so far builds the following ROMs:
- sa2.gba
sha1: 7bcd6a07af7c894746fa28073fe0c0e34408022d
(USA) (En,Ja,Fr,De,Es,It) - sa2_europe.gba
sha1: b0f64bdca097f2de8f05ac4c8caea2b80c5faeb1
(Europe) (En,Ja,Fr,De,Es,It) - sa2_japan.gba
sha1: dffd0188fc78154b42b401398a224ae0713edf23
(Japan) (En,Ja,Fr,De,Es,It) (:warning: Work in Progress)
- 🎉 The build is shiftable! You can make any code or asset additions/modifications you like, and most aspects of the game will continue to function.
- Assembly code extracted, disassembled, and somewhat categorised
- All libraries decompiled to C or referenced from
agbcc
- Most aspects of the game, including all interactables, have been decompiled to matching C code. Most have not been fully documented, but major functions are.
- All songs have been extracted, and documented as matching MIDI files
- All sprite animation frames have been extracted to PNGs and are used to build the matching rom
- Most tilemaps (backgrounds) have been documented and had their tiles extracted
Join us on discord to get started in helping out
Dev container
If you use vscode
then consider using the provided Dev Container which skips the requirement for any setup. This requires docker is installed on your system. Once running, skip to Build the rom
Install system requirements (without dev container)
On Linux systems
sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libpng-dev xorg-dev libsdl2-dev gcc-mingw-w64 libarchive-tools
On MacOS and Windows install devkitARM
Install agbcc
into the repo
Clone the agbcc repo into another folder
Inside the agbcc
repo and run ./build.sh
and then install the compiler in this repo ./install.sh path/to/sa2
Build the rom
On Linux and MacOS, run make
in the root of the repo to build.
On Windows you can build using make
in the MSYS environment provided with devkitARM.
This command will also build all the required tooling in the tools
directory.
The tools
directory contains a bunch of tooling (built by pret) which is used to build assets and create a matching rom.
If the rom built successfully you will see this output
sa2.gba: OK
NOTE: You can significantly speed up initial build times by passing the number of processes you wish to use for the build make -j<number>
All C code in this repo is formatted with clang-format-13
. If using the Dev Container this is installed automatically.
To format code run make format
- The Kirby & The Amazing Mirror decompilation uses a very similar codebase, as it was written by the same dev team (Dimps)
- https://decomp.me is a great resource for helping to create matching functions
ldscript.txt
tells the linker the order which files should be linked- For more info, see the FAQs section of TMC
- Shout out to @froggestspirit for the drive to set this project up
- Special thanks to @normmatt for the initial repo setup and sounds decompilation
- JaceCear for his dedication to understanding the internals of the graphics engine and writing tools to extract this data, as well as massive effort in contributing towards the decompilation process
- Pokemon Reverse Engineering Team for their help with the project, and tooling for GBA decompilations
- Kermalis for their tool which was used to dump the game midis
- 琪姬 for their exellent work documenting all the quirks of matching midis