Saturday, August 2, 2008

Getting Started

After enough pestering from random folk, and donations of hardware from the wonderful people at Electrobee, I've decided to go ahead and port my Gameboy Advance game Anguna to the Nintendo DS. It should be a fairly straightforward port, as the DS's 2d hardware is remarkably similar to the GBA, but the fact that my wife and I have 5 month old twins really slows things down. So, since the development will be slightly slow, I figured it'd be interesting to keep a record of where I'm at, and what progress I am (or am not) making on it.

For starters, I decided my first tasks should be:
  1. Get the GBA code to build on Linux. I did the GBA version working entirely in Windows, but I've recently switched over to mostly using Linux, so the build framework needed to work in Linux.
  2. Clean up the messy/ugly bits. There were plenty of those, and plenty of places where I built in dependencies on gameboy hardware at too high a level. This, I thought, would be the perfect time to fix those.
  3. Change just enough stuff to get it to compile and run, in some fashion, on the DS.
I've managed to get 2 out of the 3 taken care of. Getting it to build on Linux wasn't too hard. The toolchain was all based on gcc and MinGW stuff, so it was perfect for moving to linux. The hardest parts were some stupid places where I had been abusing windows' case insensitivity, some issues with the line break differences between *nix and windows, and a few of the graphics/level conversion tools that had been compiled as windows command line programs. Some of those tools I recompiled in linux, and one (which I could never find the right linux libraries for) I just run under wine.

The cleaning up of messy bits then got started. And after a few hours of starting to move stuff around, my eyes started glazing over, and I realized I could spend forever just on this task. Once you start trying to get something perfect, you could spend years on it. And with the twins, years of development time is something I don't really have at the moment. So after awhile, being the pragmatist that I am, I decided to leave the ugly code alone, and just go on with things.

That left converting it over to run on the DS. This was annoying, but not too bad. After an hour or two with twiddling with my makefile, and a few more hours of doing mass amounts of vim regular expressions to replace the GBA constants, memory locations, and functions with their DS counterparts, the thing compiled and ran. Most of the graphics are completely messed up, and there's no sound, but it runs! Next step: getting the graphics fixed.

No comments:

NES Anguna

Well, I had a little bit of time still, while Frankengraphics is finishing up her game Project Blue, to have a little downtime on Halcyon, s...