in reply to Hack: Building a computer platform

A while back, I set out to write a Gameboy emulator in Perl. I had never done an emulator before and had assumed it was a place full of black magic incantations only uttered by the most highly skilled programmers.

I didn't intend to make a full emulator with graphics and sound (there are plenty of Gameboy emulators out there if you want to play real games). I considered getting the CPU and memory working to be a major accomplishment.

First, I needed the specification for the internal workings of the Gameboy. This turned out to be the hardest part. It took some quality time with Google to refine the search query until I got what I was looking for.

After I started implementing the emulator, I realized that it's actually quite easy. The memory can be represented as a large array. Each opcode does something which reads and/or modifies the memory.

I implemented a few opcodes, saw that the whole thing is actualy quite easy, got board, and abandoned the project. Reading various blogs/forum postings from people who wrote complete emulators, it seems that the hardest part is getting sound to work--you have to translate sound from the Gameboy format into the format for your given sound library, which is understandably difficult, especially when your given sound library is DirectSound :)

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.