Skip to content
/ sa2 Public

A decompilation and port of Sonic Advance 2 - a GameBoy Advance game written in C

Notifications You must be signed in to change notification settings

SAT-R/sa2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sonic Advance 2

CI status Decompilation Progress Contributors Discord

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 repo also builds the following:

  • sa2.sdl make sdl (Linux/MacOS SDL 64bit port)
  • sa2.sdl_win32.exe make sdl_win32 (Windows SDL 32bit port)
  • sa2.win32.exe make win32 (Win32 native port, not functional)

Current state

Community

Join us on discord to get started in helping out

Setting up the repository

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 GBA 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 install devkitARM (if building for GBA) and

brew install libpng sdl2 mingw-w64

On windows install devkitARM

Install agbcc into the repo (skip if not compiling for the GBA)

Clone the agbcc repo into another folder

Inside the agbcc folder, run ./build.sh and then install the compiler in this repo ./install.sh path/to/sa2

Build the GBA 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

Build the port On Windows: make sdl_win32 On Linux and MacOS: make sdl

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 of CPU cores>

NOTE: When building for Windows, you'll need to download and extract SDL2 to the ext folder in the root of the repo before building. You can use make SDL2.dll to do this for you.

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