I've been hacking the NES for quite a long time, and since them, I've always been asked for writing an emulator. Although it was never a priority, everytime a question like that stands, I usually answer: "Why not?".
Let's think over. Why should I, and why you should to? There are already several good emulators available, why write another one?
Moreover, googling about the subject "write nes emulator", there are several good stories. I've put the most relevant links at the bottom. I also recomend you to read them.
Therefore. What to tell abount NES emulators that haven't already being told? Well, not saying that I do intend to fishish it, but let's explore more the ideia.
In order to write the emulator, we need to keep up with the overall architecture that was involved. For now, let's focus on the CPU. NES had a Ricoh 2A03 CPU with the same instruaction set of the 6502. Since we are talking about code. Let highlight the code from Niels Widger's Nintengo. It's very polished, and more important, it's filled with tests. So as a experiment, I've rewrote the tests and used on the James Tauber's ApplePy, most impressive, without mush effort, the test spec payoff, and show how well made ApplePy is.
You can checkout the progress at wedNESday repository.
- Get a better understand on how IRQ and NMI works
- try to do the same with py65.