This doc assumes you are somewhat familiar with using a terminal/command line. If not, you may find these instructions confusing and this project might not be for you at this stage. If you still want to continue, googling anything which you don't understand might be a first step and then asking in the discord would be a fallback option.
This project is designed to be built on MacOS or Linux.
Install WSL (Ubuntu). Once installed, open this project in the WSL terminal and follow the linux instructions. There are tutorials online for setting up WSL. You may need to mount this project in your WSL environment.
sudo apt update
sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libpng-dev xorg-dev libsdl2-dev g++-mingw-w64 gcc-mingw-w64 libarchive-tools
# Optional, if you want to compile for the PS2 you'll need
sudo apt install mkisofsbrew install libpng sdl2 mingw-w64 arm-none-eabi-gcc
# Optional, if you want to compile for the PS2 you'll need
brew install cdrtoolsFor compiling for the PSP or PS2, ensure that you install the required SDK
Clone/Download the repo
The repo targets multiple platforms. You don't need to build the GBA rom to build the port, so skip that step if you only want to run it on PC.
Run all commands in the same folder as this project. All outputs go into the same folder.
NOTE: You can significantly speed up initial build times by passing the number of processes you wish to use for the build. For example make -j4 with 4 being the number of cores
The codebase targets different platforms depending on where you are going to be playing it.
- Run
make SDL2.dll - Run
make sdl_win32 sa2.sdl_win32.exewill be created- Open the game in Windows by double clicking on it
Tip: On Linux and MacOS this can be opened with wine sa2.sdl_win32.exe
NOTE: If you get an error when running make SDL2.dll, you'll need to download and extract SDL2 to an ext folder in the root of the repo before building. Afterwards you can re-run make SDL2.dll
- Run
make sdl sa2.sdlwill be created- Launch the game from the terminal with
./sa2.sdl
- Run
make sdl_psp EBOOT.PBPwill be created
- Run
make ps2 sa2.ps2.isowill be created
-
Clone agbcc repo into another folder
-
Inside the
agbccfolder, run./build.shand then install the compiler in this repo./install.sh path/to/sa2 -
Run
make -
If the rom built successfully you will see this output:
sa2.gba: OK(if you modify the source code this will no longer outputOK) -
sa2.gbawill be output.
You can execute the rom in an emulator
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