Gameboy Cartridge Reader/Writer: Halfway there!

I was browsing HackADay and noticed that a mysterious man named Alex had recently completed a Gameboy cartridge reader. “Well,” I said “I am working on a project quite similar to this. Dovoto graciously gave me a blog way-back-when, and I have used it very little. I wish to document my journey in Gameboy hackery as well, and what better place to do it than this?”

I am currently at a similar stage of development. This technological abomination resides in a cardboard box, as pictured here:

End my misery!

If you are like this guy, allow me to inform you that I used the Arduino because it is one of the few pieces of programmable I/O I own, because it has an easy development environment, and because at the time I began this project I was new to all this fancy reverse-engineering hackery and had essentially no idea what I was doing.

The current state of affairs is this. The Arduino runs a cute little state machine that can be told to change state with a variety of byte-long commands. It spits data out at my computer, which sends that data to a Processing sketch. That Processing sketch is another cute little state machine, and it bosses the Arduino around and stores all of the data it has received in a file when it is done. This is what a really awful homebrew development environment looks like:

Of course, I had some issues with the serial libraries, which prompted me to add in checksums and a bunch of other stuff to verify data integrity, but that’s boring. What’s important is that I managed to rip a copy of Zelda: Link’s Awakening, confirm that it checks out by comparing it to a known-good ROM, and open/play it in an emulator.

Now I am waiting for these to come in so that I can start making flash carts. Once I have replaced the ROM on my copy of Zelda with an EEPROM, I can begin working on software that will write to the cartridge so that I can put LSDJ and other gameboy homebrew on it. I will probably write a great deal of my own, as the Gameboy sound hardware is very easy to use, and I am interested in doing some generative music synthesis using multiple Gameboys and my four-player adapter.

Until then, all I can do is wait, refine my code, and rip more ROMs.

Hardware used:

  • 1 Cardboard box
  • 1 Cartridge slot (salvaged from an old DMG Gameboy)
  • 1 Arduino
  • 2 Protoboards
  • 3 Shift registers
  • 32 Wire-wrap wires
  • >30 Jumper wires
  • >40 Hours of my life

Multiplexing the DS Sprite Engine

So it turns out that you can update the DS sprite engine’s OAM in the middle of a VBlank to draw more sprites. Very neat. I’m going to use it for printing arbitrarilly sized text. Here’s some example code that prints 192 text sprites, 64 more than normally possible.


Messing Around

I spent a bit more time poking around with that synth code. I was trying to figure out how to implement a fixed point version of the power fuction, but it turns out that it’s not really feasable with the limited accuracy that comes along with fixed point math, so I gave in and used devkitARM’s floating point stuff to calculate frequencies from note values instead.

It’s not all that efficient, but the note values are being calculated at the input poll rate, not the sample rate, so it doesn’t matter too much. Anyways, here’s a little Kaosscilator clone based on my previous code to play with. With some tweaking, this could actually be a decent improvisational tool.


First Blog Post, Hello All!

Dovoto was kind enough to set me up here, so now I have an awesome blog. I plan on updating here with assorted portable music/audio applications. Here’s a rough demo of my currently-unfinished synthesis toolkit that sends a saw oscillator through a series of feedback delay lines.