This is a simple implementation of Pong I wrote for the GameBoy Advance (GBA) as a proof-of-concept in preparation for more-complicated games.
It follows this introduction for the basic approach to developing the code.
Compiling this C code into a GBA module requires the ARM module of devkitPro
Once installed, ensure devkitpro/devkitARM/bin
is in your PATH
The following commands will turn main.c
into a GBA ROM main.gba
:
arm-none-eabi-gcc -c main.c -mthumb-interwork -mthumb -O2 -o main.o
arm-none-eabi-gcc main.o -mthumb-interwork -mthumb -specs=gba.specs -o main.elf
arm-none-eabi-objcopy -v -O binary main.elf main.gba
gbafix main.gba
I've compiled these commands into a Makefile. Please note that make clean
does not work on Windows.
The generated ROM can be loaded onto a GBA cartridge, or run through an emulator. For Windows on x86, I recommend VisualBoyEmulator. For OSx, I recommend Boycott Advance.
For more detail on the specifications of the GBA, see akkit.org
As this is a test space for code, I will not be accepting any contributions.
This code is subject to the GNU General Public License.