XDXA

Blog / GBA Development on a Mac

GBA Development on a Mac

In my media devices ar­chi­tec­ture class, we are developing on the GBA. Un­for­tu­nate­ly, most of the students are developing on windows machines, which leaves me and a few others the odd men out. On macs, we're using devkitarm as our compiler with a provided makefile. Un­for­tu­nate­ly, the Makefile had a few flags mis­con­fig­ured.

The stock makefile worked perfectly until we started dealing with sound. The problem was two fold:

  1. Setting the interrupt handler would cause the GBA to reset
  2. Sound files larger than thirty seconds would overflow the ewram

There were two macros in the make file that were used for compiling and linking re­spec­tive­ly:

MODEL = -mthumb -mthumb-interwork
SPECS = -specs=gba_mb.specs

The model affects how the assembly is compiled, and the specs defines the way the linker will link the c objects together. I figured out that mthumb wasn't needed by looking at the windows makefile. Removing it resolved the rebooting issue.

I knew that the overflow had to do with the linker, because that's where it failed. I was at the point where I was actually trying to modify the linker script to manually force the audio memory to go to the right region when I realized there was a second gba .specs file. Switching to that file resolved the issue.

The resulting makefile macros are as followed:

MODEL = -mthumb-interwork
SPECS = -specs=gba.specs

I am not a compiler expert. So, I can't tell you the full im­pli­ca­tions of changing these flags, but it did work for me. I'm still working on what I believe to be a compiler bug and plan to submit a bug report soon. If it turns out to be in­ter­est­ing, I'll make another post here.

« Microsoft Natural Ergonomic Asus P4C800 Rev 2 »