Things to know before starting Game Boy development
Interested in Game Boy development but want to get a bit of an idea what’s involved first? Here’s a quick list of things I think are useful to know.
1 – You’ll be writing code in CPU assembly
While there is stuff like GB Studio I’m going to assume you’re here because you’ve already decided you don’t want to do that and are keen to program for the hardware. If that is the case then you’re probably going to be writing assembly code for the CPU. Writing something in C then compiling to the architecture is possible but since the CPU is only 4.19 MHz and has very limited memory the extra control of assembly will have its advantages. Don’t worry, since the CPU is very basic there’s not too much to learn.
2 – The CPU is a custom chip with some quirks (by modern day standards)
When looking more into the CPU online you’ll find a lot of people saying that it’s a Z80 but not quite (the Zilog Z80 being quite a prolific chip in the 80’s, used in things like the ZX Spectrum and Sega Master System). While you should be aware that the CPU has a couple of bugs, the first thing you’re going to encounter is that the CPU only deals in whole numbers and doesn’t have instructions for multiplying or dividing numbers. Math is really basic on this device and you’re going to need to think (or Google) outside the box to do more complex things.
3 – You can still write assembly for this with modern source code editors
It’s not all “living in the dark ages” when developing for the Game Boy, I know at a minimum both Visual Studio Code and Sublime Text have plugins for syntax highlighting Game Boy assembly. Hell, this plugin for Visual Studio Code has code completion with documented instruction snippets.
4 – It’s not too difficult to get your code onto real hardware
The homebrew scene has made this process fairly simple. Personally I use a Gameboy LinkNLoad32 USB Flash Cart from InsideGadgets which is a cart with a USB-C port for transferring data onto it using software like FlashGBX.
What next?
Check out my next post Game Boy CPU basics.
Tags: #Development #Gameboy