Monthly Archives: August 2011

Gameboy Z80 Programming! My new #altdevblogaday series

As I mentioned in my previous post, I’m learning to program Z80 Assembly for the Gameboy. To encourage myself to keep progressing, and to help myself learn, I’m starting a new series on #altdevblogaday that’s going to teach assembly programming through the Gameboy Z80.

Check out the first post! Though it doesn’t dive into assembly code just yet, it walks you through getting yourself set up and ready to hit the ground running, along with providing a lot of links if you want to dive in head-first yourself!

Learning Assembly through Gameboy Programming

My current on-and-off pet project is teaching myself to program Z80 Assembly for the original Gameboy. Though I have some experience with MIPS 2000 Assembly Language, I thought Gameboy programming might be fun after seeing the following video:

As I thought more about it, I realized that the Gameboy has a number of distinct advantages:

  1. They’re cheap. An original Gameboy (DMG-01) cost me only about $20 on eBay.
  2. They’re a full set of hardware all in one. The Gameboy has its display, processor, input, etc. all in one incredibly inexpensive unit.
  3. Flash carts are easy to acquire. In layman’s terms, a flash cart is a cartridge that can be written to and read from easily. To make it even more convenient, I can connect the cartridge to my computer with a USB cable. Essentially, this means I can easily run my code on the actual hardware with almost no hassle. The cartridge I purchased cost only $38.
  4. High-quality emulators are readily available. Though running code on the actual hardware is very cool, there are advantages to running it in an emulator. The BGB gameboy emulator has a powerful debugger built in, for example, which makes development a lot easier.
  5. You can develop for the Gameboy on many platforms. Whether you’re running Windows, Mac, or Linux, the proper tools to get the job done are available.

Of course, the primary motivation was that the project just sounds like fun! As-is, I’ve picked up all of the appropriate hardware and got a “hello world” program up and running:

(What? It was much more fun to display than “Hello World”)

Anyway, I plan to post more about this pet project as time goes on. As far as what game(s) I end up making… well, I’m not entirely sure! A schmupp sounds like it’d be a fun idea, but I’m open to suggestions.

Cheers!
Zach