Home CPSC 305

Compiling Game Boy Advance Programs

 

Overview

The Game Boy Advance is a very different piece of hardware from the computers you typically use. It has a different processor architecture, and does not have an operating system. Because of this, programs compiled for other machines cannot run on it. gcc and other compilers you have used are not able to produce code that runs on the GBA by default.

Because of this, we need to use a cross-compiler which is a compiler which generates code for a machine different from the one it is running on. This is a different version of gcc which has been configured to produce GBA code.

Our cross-compiler only runs on Linux. If you're using Windows or Mac, you will need to either develop on the CPSC server, or use the CPSC 350 virtual machine which is Linux-based. If you are using Linux on your own system, you can do either of these, or install the cross-compiler and tools on your own machine.

  1. For doing your development on the CPSC server see CPSC server instructions. This will involve developing on the server, and transferring the compiled GBA programs to your own local computer to test them.
  2. For using the CPSC 305 Virtual machine, see virtual machine instructions. This involves running a Linux virtual machine on your computer which contains all the tools needed for this class.
  3. For instructions on installing the cross-compiler and tools on your own machine (Linux only), see installing the GBA development tools.

 

Running GBA Programs on a Real GBA

This is certainly not needed for this class, but if you are interested in running the .gba files directly on a real Game Boy Advance instead of an emulator, instructions for doing that are given in Running Game Boy Advance Games on the Hardware.

Copyright © 2024 Ian Finlayson | Licensed under a Attribution-NonCommercial 4.0 International License.