19/2/2007
GameBoy Advance Coding
A few years ago I tried writing some code for the GameBoy Advance. I thought I’d see if I can get something in 3d on a platform that doesn’t really support it very well. Overall it was great fun, and useful experience with a chipset I hadn't developed for before.
What I ended up with after a couple of days hacking was a transparent polygon filler and a basic 3d engine. There are two demos, to run them yourself you’ll need a GBA emulator, try [VisualBoyAdvance] as it’s a small download and works fine for this demo. The demos also run on real hardware, but I assume that if you wanted to do that you'd be able to without any more advice from me.
There are six levels of transparency, faces can be drawn in red, blue or green and the blending is handled automatically by the engine. I’m using the GBA’s low-res mode, which is why everything is in the top-left corner. I use lookup tables for sin, cosine and division, and unrolled loops whereever possible. I should probably stretch that out to fill the whole screen. I have no idea if it runs on “real” GBA hardware, as I don’t have the required kit to test it.
I’m not handing out the full sourcecode, but if anyone wants it the ARM assembly code for some of the more interesting functions is available.
There may also be more interesting demos available in the future - I fully understand that rotating cubes aren’t exactly the most visually appealing graphical wonder… I might try to get a simple version of Lightbikes running, or some other simple game demo.


Download the [ROM images] - use
a GBA emulator to run them.
portfolio