Even though my Java-based Commodore 64 emulator isn’t yet complete, I’ve decided to start on an NES emulator. One of my reasons is that I’d like to test out my design for how the emulator is structured to see how reusable the components are. Technically the only shared component is the MOS 6502/6510 that acts as the main processor. In addition to that same physical component, the two will share the way that memory reads and interrupts are handled.
My hope is that coming at the system from a different angle will help me work out kinks in the design in addition to any inaccuracies in the emulation at the low level. Not all of the instructions in my 6502 having correct timing, and I believe that could relate to why some of the games have odd behavior. The actual implementations (aside from the BCD code in the SBC instruction) are all correct and pass the tests in the excellent C64 Emulator Test suite developed by Wolfgang Lorenz as part of his PC64 emulator.
Eventually I would like to be able to “build” virtual machines a property file and some form of IoC (Inversion of Control) with Spring or the likes to wire everything together. As it stands, most components are fairly independent from each other and only know about some interfaces. Without doing any modifications to the core really (only added support for NMI), I’ve already managed to read in an NES ROM and start executing instructions. The graphics aren’t implemented yet, so there it’s not doing anything obvious, but we shall see.
This page also serves as a marker for me to know when I started it and track some progress.
I want to put some thanks right now to all of those out there (much of which can be found through NesDev) who have created excellent documentation.