Skip to content
/ sa2 Public
forked from SAT-R/sa2

WIP decompilation of Sonic Advance 2

Notifications You must be signed in to change notification settings

JaceCear/sa2

 
 

Repository files navigation

Sonic Advance 2 (USA)

CI status Decompilation Progress Contributors

This is a work in progress matching decompilation of Sonic Advance 2

It so far builds the following ROM:

  • sa2.gba sha1: 7bcd6a07af7c894746fa28073fe0c0e34408022d

Current state

  • Assembly code extracted, disassembled, and somewhat categorised
  • All libraries decompiled to C or referenced from agbcc
  • Initialisation of game state, main task logic, save game logic, nearly all UI, Multiplayer code, Special Stage
  • All songs have been extracted, and documented as matching MIDI files
  • ⚠️ The build is not yet shiftable, meaning all significant code modifications will cause the rom to crash

Setting up the repository

Provide assets

You must have a copy of the Sonic Advance 2 (USA) ROM named baserom.gba in the repository directory.

Dev container

If you use vscode then consider using the provided Dev Container which skips the requirement for any setup.

Install build requirements (without dev container)

On Linux systems

sudo apt install binutils-arm-none-eabi gcc-arm-none-eabi libpng-dev

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

Code formatting

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

Notes

  • 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

Credits

About

WIP decompilation of Sonic Advance 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Assembly 75.8%
  • C 22.0%
  • Python 0.9%
  • Makefile 0.7%
  • C# 0.5%
  • Perl 0.1%