- Update software renderer to the gpsp renderer (fast enough to render on slow hardware) - Convert audio emulation to fixed point (since float is slower on these systems) - Add PSP as a target for SDL - Add PS2 as its own target, though it's still using software rendering Thanks to @kikugrave for adding the initial psp boilerplate and inspiring me to finally finish the ps2 port!
3.3 KiB
Building/Installing SA2
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.
Before building
This project is designed to be built on MacOS or Linux.
If you only have a windows computer
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.
Install system requirements
On Linux (including WSL)
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 mkisofs
On MacOS
brew install libpng sdl2 mingw-w64 arm-none-eabi-gcc
# Optional, if you want to compile for the PS2 you'll need
brew install cdrtools
PS2DEV and PSPDEV
For compiling for the PSP or PS2, ensure that you install the required SDK
Building
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
Ports
The codebase targets different platforms depending on where you are going to be playing it.
For Windows
- 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
For Linux/MacOS
- Run
make sdl sa2.sdlwill be created- Launch the game from the terminal with
./sa2.sdl
For PSP
- Run
make sdl_psp EBOOT.PBPwill be created
For PS2
- Run
make ps2 sa2.ps2.isowill be created
GBA rom
-
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
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