Page 1 of 1

NES Emulation begginer, where to start

Posted: Fri Jul 18, 2008 9:20 am
by Coldberg
Hello everyone , I'm new here , i hope i won't upset anyone by asking... but
Where does one start when writing a NES emulator ?
And don't tell me at the beginning :P
Anyway I have a very good background in programming in C, C++ and x86 Assembly (at least 6 years worth), so i got that covered.
And i do have my ideas on how i could do it, but then again i only found very limited information on the NES architecture.
I'd like to hear from experienced emu writers where is the beginning.
One of my approaches would be to take a minimal ROM , load it and hack away at the cpu code till i reach a point where it needs to interface other hardware and so on.
But i don't know if this is a good way to do so.
Long story short ... what could you recomend ? DOC's, approache strategies so on...

Posted: Fri Jul 18, 2008 9:57 am
by mic_
I'd say start by emulating the CPU and memory access. Then write some simple test sequences in hardcoded 6502 machine code and have your CPU emulator run them and check that the result is what you'd expect (you can output the CPU's status to a text console or whatever).
Then fix your memory access routines to handle the basic memory layout of the NES and try to run some really basic demo ROM, like ColourBars.
After that you can start adding some graphical output, joypad input etc.

Posted: Fri Jul 18, 2008 10:03 am
by Coldberg
what about actually taking a simple game like donkey kong ?

Posted: Fri Jul 18, 2008 10:31 am
by mic_
That's still far more complicated than some of the simplest homemade test ROMs. If you want an easy game to try to run, this one isn't that hard to get to work.

Posted: Fri Jul 18, 2008 12:29 pm
by Coldberg
thanks :)

Posted: Thu Apr 22, 2010 5:37 pm
by aphex
Sorry for necroposting, but this will be helpfull to get people started.

This link
helped me get started with emulation, I successfully wrote a chip8 and gameboy emulator with this blog (also has detailed walthough on the master system)

Good luck