Extensions to a WIP decompilation of Sonic Advance 2 - a GameBoy Advance game written in C — Fork of https://github.com/SAT-R/sa2 (mirror: upstream/sa2)
  • C 83.3%
  • Assembly 16.4%
  • Makefile 0.3%
Find a file
bitten2up 8a5fab9986
Some checks are pending
CI / format (push) Waiting to run
CI / build (push) Waiting to run
add readable names to the unused level select functions (#131)
2024-02-28 22:59:37 +00:00
.devcontainer Extract and match all 4bpp object frames (#31) 2022-12-19 12:17:42 +00:00
.github/workflows BriBaSA_ex - Initial Commit (#123) 2023-12-10 12:49:22 +01:00
.vscode start mp_player 2024-02-27 01:33:04 +00:00
asm Stage collision and some player_1.s (#130) 2024-02-27 20:15:15 +01:00
chao_garden Match collision.c (#128) 2024-02-08 13:30:11 +01:00
constants Stage stuff (#85) 2023-06-01 17:43:22 +02:00
data Stage collision and some player_1.s (#130) 2024-02-27 20:15:15 +01:00
graphics input_buffer.c and Boss 4. (#129) 2024-02-18 11:14:58 +01:00
include Stage collision and some player_1.s (#130) 2024-02-27 20:15:15 +01:00
multi_boot fix build (add missing files) 2023-05-14 04:28:03 +01:00
scripts extract boss2 data 2024-01-28 08:05:36 +00:00
sound bg_triangles and player_super_sonic (#124) 2024-01-09 02:03:35 +01:00
src add readable names to the unused level select functions (#131) 2024-02-28 22:59:37 +00:00
tools Some documentation stuff to keep SA1 and SA2 as up to date with eachother as possible. (#127) 2024-01-29 20:45:28 +01:00
.clang-format format: downgrade to clang-13 2022-11-12 12:46:03 +00:00
.git-blame-ignore-revs ignore formatting commit 2022-11-14 10:56:38 +00:00
.gitattributes add scripts to vendored attributes 2022-12-19 14:21:26 +00:00
.gitignore BriBaSA_ex - Initial Commit (#123) 2023-12-10 12:49:22 +01:00
asmdiff.sh extract boss2 data 2024-01-28 08:05:36 +00:00
binary_diff.sh split songs into separate files, match some midi files, more scripts 2022-04-24 02:42:27 +01:00
calcrom.pl add some useful scripts 2022-05-05 00:21:08 +01:00
config.mk get closer to europe match 2023-05-13 12:58:29 +01:00
genctx.py Add comment to context script (#64) 2023-03-06 22:04:12 +00:00
graphics.mk Some documentation stuff to keep SA1 and SA2 as up to date with eachother as possible. (#127) 2024-01-29 20:45:28 +01:00
ldscript.txt Stage collision and some player_1.s (#130) 2024-02-27 20:15:15 +01:00
Makefile Make Makefile be more consistent with SA1 (#126) 2024-01-15 17:01:10 +01:00
README.md start on gohla, update discord link 2023-10-14 23:15:55 +01:00
sa2.sha1 get closer to europe match 2023-05-13 12:58:29 +01:00
sa2_europe.sha1 finish dissasembling collect rings 2023-05-13 21:45:12 +01:00
songs.mk bg_triangles and player_super_sonic (#124) 2024-01-09 02:03:35 +01:00

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)

Current state

  • 🎉 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

Community

Join us on discord to get started in helping out

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

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>

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