Development Tools

Host Environment

Toolchain

.gba

Type Name Link Toolchain devkitARM devkitARM_r23b-i686-linux.tar.bz2 Library (Source) libgba libgba-src-20060720.tar.bz2 Library (Source) libnds libnds-src-20071023.tar.bz2 Examples gba gba-examples-20060718.tar.bz2 Examples nds nds-examples-20080427.tar.bz2

NOTE: I've included the Nintendo DS (nds) libraries and examples, because that is today's most common hardware for playing Game Boy Advance games; Slot 2 on the Nintendo DS. Also, after I master Game Boy Advance development, I plan to leverage this into Nintendo DS development. As I understand it, the hardware and concepts involved are quite similar.

NOTE: I've indicated the source packages of the libraries libgba and libnds . Compiling them is an important step that confirms the toolchain has been installed properly. If you can't compile the libraries from source, you probably won't be able to compile a program for the Game Boy Advance either. Better to work out the problems now, as it will save you lots of trouble later.

Toolchain Installation

TODO: Add instructions for installing the toolchain for the system instead of just one user.

~

#!/bin/bash # install-devkitPro.sh cd ~ mkdir devkitPro cd devkitPro tar xjf ~/devkitARM_r23b-i686-linux.tar.bz2 mkdir examples cd examples mkdir gba cd gba tar xjf ~/gba-examples-20060718.tar.bz2 cd .. mkdir nds cd nds tar xjf ~/nds-examples-20080427.tar.bz2 cd .. cd .. mkdir libgba cd libgba tar xjf ~/libgba-src-20060720.tar.bz2 cd .. mkdir libnds cd libnds tar xjf ~/libnds-src-20071023.tar.bz2 cd ~ echo "DONE: devkitPro installed! Be sure to modify ~/.bashrc and ~/.gnomerc"

CAVEAT: Some people have warned against using graphical tools to unpack the packages, as they don't preserve the structure properly. If you don't use the script above, you may want to consider still using the command line for this task.

devkitPro | +-- devkitARM +-- examples | +-- gba +-- nds +-- libgba +-- libnds

~/.bashrc

~/.gnomerc

# define variables for devkitPro export DEVKITPRO=$HOME/devkitPro export DEVKITARM=$DEVKITPRO/devkitARM

~/.gnomerc

Library Compilation

libgba

libnds

~/devkitPro/libgba

make && make install

~/devkitPro/libgba

libnds

Example Compilation

~/devkitPro/examples/gba

make

CAVEAT: Some of the examples do not compile properly for me. /gba/audio/ApexAudio and /gba/audio/Krawall do not compile properly. I don't know why yet.

Emulator

Visual Boy Advance

sudo apt-get install visualboyadvance-gtk

gvba [optional-rom]

CAVEAT: Very few emulators are 100% perfect, and Visual Boy Advance is no exception. If you plan to run your program on a Game Boy Advance, you will need to test on a Game Boy Advance. The emulator is quick and convenient for development, but it is not a substitute for testing on the actual hardware.

Integrated Development Environment (IDE)

Eclipse 3.2

NetBeans 6.0.1

sudo apt-get install netbeans

NetBeans Project

TIP: The examples installed to $DEVKITPRO/examples/gba/ can be made into NetBeans projects this way.

TIP: John Philpott wrote to inform me about getting NetBeans to find devkitPro when launched from GNOME instead of the command line. The modifications to ~/.gnomerc enable this, so if you want NetBeans to know where to find devkitPro, it is important to create this file.

TODO: Figure out how to get NetBeans to launch the emulator with the ROM built by the project.

Documentation

Community

TIP: Use the right forum. devkitpro.org supports the devkitPro toolchain. gbadev.org is a community of people who develop for the Game Boy Advance and Nintendo DS.

CAVEAT: The toolchain is provided to you for free by the generosity of the community. Participation in the gbadev.org community is voluntary. Strolling in with an arrogant attitude and/or ordering people to fix things for you is a faux pas and unlikely to work out as you hope. Likewise, discussion of methods for making illegal copies of commercial games or how to locate an illegal copy of the Official Nintendo SDK, is likely to get you banned. These forums are an invaluable resource to beginners and experts alike. Don't abuse it, ever.

This section covers the tools I'm using for Game Boy Advance development.I'm using Ubuntu Linux 8.04 for my host environment. It's free software , and I find it very useful and convenient for software development. Microsoft Windows is another common host environment for Game Boy Advance development. Because I do not use it for development, I won't comment on it any further.A toolchain is a set of the software tools that translate source code and binary resource files (graphics, sounds, etc) into a form that can be used by the Game Boy Advance. This usable form is commonly called a ROM, and often ends with the extension "". devkitPro is the most advanced toolchain available for Game Boy Advance development. devkitPro for Linux is available for download from SourceForge , a popular site for open source and free software. The following table will help you obtain the toolchain packages you will need for Game Boy Advance development:Once you've downloaded the packages, it's time to install them. Although it's possible to make the toolchain available to every user on the system, I am the only user on my system. So, to save myself the hassle, I just install them in my home directory.In order to use the script I've provided below, you'll need to save the packages to your home directory ().It's not the most elegant or concise script, but it is hopefully easy to follow.When the script is finished, you should have a structure similar to the one in the devkitPro wiki There is one final step. Depending on your environment, programs need to know where devkitPro is located. Add the following lines to the filesandYou may need to create the file. On my Ubuntu system, it didn't exist by default.Here is the litmus test. Assuming the toolchain has been installed properly, you should now be able to compile the librariesandfrom the source packages. Change into thedirectory and issue the following command:It should run through a compilation sequence and end with a list of files installed to thedirectory. If it did, congratulations; you have a working Game Boy Advance development toolchain at your disposal! At your option, you may also compile thelibrary.With the libraries fully compiled, you should be able to compile the Game Boy Advance examples as well. Change into thedirectory and issue the following command:It should recursively compile all of the examples.In order to test your programs for the Game Boy Advance, it is necessary to run them. The host environment has no direct support for running Game Boy Advance programs, so most developers use an emulator. An emulator is itself a program, designed to mimic the hardware and software of the Game Boy Advance. Your host environment runs the emulator, and the emulator runs your program in ROM format, allowing you to test it. Visual Boy Advance is the most comprehensive and stable emulator for the Game Boy Advance as of this writing. On Ubuntu Linux, it is easy to install Visual Boy Advance with the following command:The emulator can then be run from the command line with the following command:If the path to a ROM file is provided on the command-line, Visual Boy Advance will automatically load and execute the ROM when it starts. Otherwise, you can use the GUI menus to find and open the ROM file you want to run.An Integrated Development Environment (IDE) is a program software developers use to create software. Technically, any text editor can be used to create source code files. However, an IDE usually provides tools that highlight mistakes, allow you to browse the source code, and even automate some simple repetitive programming tasks.I was able to get the devkitARM toolchain working from NetBeans 6.0.1 . On Ubuntu Linux, it is easy to install NetBeans with the following command:After this you need to install C/C++ development support. The commands are: Tools | PlugIns (menu), Available Plugins (tab), C/C++ (checkbox). The rest is just clicking Next until it decides to install.Setting up a NetBeans project that makes use of the devkitARM toolchain is not difficult. The commands are: File | New Project (menu), Categories: C/C++ (list), Projects: C/C++ Project From Existing Code, Browse... (button), Find the Makefile for your project. The rest is just clicking Next until it creates the project.The second most important thing for development is documentation. Tutorials teach you what you need to know. Reference documents allow you to leverage that knowledge into working programs. Here is a list of sites I've found with very useful documentation:The most important thing for development is community. Here is a list of sites where you can discuss Game Boy Advance development: