Inspired by Scet’s Tub of Awesome, I opted to continue work on my old emulator, DrilNES.
And here it is! DrilNES in all its glory! Note that it does not support PAL NES timing, it only runs NTSC games (so US and Japanese games only).

A Brief History of the World

I first attempted to tackle NES emulation back in 1999. I had the goal of getting three games to be playable: Castlevania 3, Startropics, and Crystalis. Turns out, these three games are some of the harder games to emulate, due to the tricky nature of the cartridge hardware that they run on. However well it ran at the time, it was woefully inaccurate, and this bothered me. In mid-2004, I apparently decided to try again.

Emulator Action

The great thing about having started this project over in 2004 is that I have the entire history of the emulator’s development in SVN, so I can see exactly what I did, and in what order. Here’s a quick list of the hilights:

Wrote the CPU emulation code (runs opcodes, etc).

Got the PPU (pixel processing unit) up and running

Rewrote the CPU emulation code to be more accurate with regards to instruction length counting (all instructions now emulate every read and write of the instruction, even the unnecessary ones, and the CPU cycle is clocked on each memory access).

Added input and mappers. Mappers are emulators of the hardware that came IN the various cartridges. Originally mappers were just for memory mapping, but the hardware eventually added additional graphical, sound, and interrupt capabilities as well.

Added more mapper support

Added support for the color emphasis bits which…tweak the output color from the NES in various ways.

Added sound output.

Got various IRQs running (for interrupting the CPU at certain points in the audio playback or at certain scanlines)

Added savestates.

Added a custom rom open dialog, with a treeview and stuff

Even more mappers

Two-player support

Rewrote the MMC3 mapper from scratch, because the MMC3 code was nasty and ugly and I hated it. And it insulted my mother. And your mother.

IRQ fixes. At this point, judging from some…colorful SVN log comments, I was starting to hate IRQ work.

Set down the code for a year.

Complete PPU rewrite to be way more accurate. This was the point at which I was starting to hate Battletoads, which is probably the most touchy game when it comes to accurate timing.

Complete PPU rewrite. Yes, I know that is also on the previous line. I rewrote it again. Seriously.

Rewrote the CPU. This time the CPU is awesome and infallible and will never need to be rewritten or even fixed ever again. Also, I think I was slowly losing my sanity.

Added a faster read of guaranteed in-ROM memory, without going through all of the IO handling code. I didn’t notice for over a year and a half, but this totally broke the accurate CPU timing that I had going for me.

Rewrote the CPU again. Apparently last time I was wrong. Boy this is awesome!

Stopped working on DrilNES for a year and a half. I’m not sure but I think I’d had enough.

Started last weekend! Multithreaded the emulator.

Added a whole bunch of GUI features (including ripping out the now-hideous custom rom open dialog that I added back in early 2005)

But, in general, it’s nice to be “done” with it (though there are tons of things that I would like to do with it still).

This entry was posted
on Tuesday, February 5th, 2008 at 10:07 pm and is filed under DrilNES.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.