21

Possible duplicate of How do Emulators Work and How are they Written?

I want to program an emulator ( may be NES or C64, I haven't decided yet ), I know there are lots of them so many may ask why would someone want to make one from scratch, but I want to include some specific characteristics in it, and also for the sake of building it myself.
I'd like to read a guide from someone who has built one and can transmit the experience, it doesn't have to be platform-specific ( better if it's not ) since I know how to program, what I don't is how to emulate.

Community
  • 1
  • 1
Petruza
  • 11,026
  • 24
  • 79
  • 128
  • I suspect you would just simulate the archtecture of the hardware, memory and the instruction set of the device. – acheo Jan 22 '10 at 15:36
  • 4
    http://stackoverflow.com/questions/448673/how-do-emulators-work-and-how-are-they-written – acheo Jan 22 '10 at 15:45
  • +1 PeanutPower, that link is great! thanks. If I just could mark it as the answer :D – Petruza Jan 24 '10 at 12:55
  • 2
    If you like JavaScript, I wrote something that might help: [Emulating the NES with JavaScript](http://blog.alexanderdickson.com/javascript-nes-emulator-part-1) – alex Oct 16 '13 at 01:39
  • @alex What happened with the tutorial? you only wrote part 1. – Petruza Jun 27 '15 at 20:04
  • @Petruza I know.. I started it, just need to finish it. – alex Jun 29 '15 at 00:23
  • I'd recommend checking out projects that exist and reading up as much as you can. Also, a book is never a bad idea either (https://goo.gl/4kMYaR). –  Sep 01 '15 at 07:36

2 Answers2

9

Well, you can google lots of articles, but there's one resource I found particularly useful :
http://www.nesdev.com
Here you'll find pretty much all you need to know to write a working NES emu, from complete hardware specifications, to the instruction set, and test roms. Have fun.

Community
  • 1
  • 1
fingerprint211b
  • 1,176
  • 11
  • 23
4

Both the NES and C64 are based on the 8 bit 65xx processor. Writing an instruction set emulator for that chip is pretty trivial since the instruction set is small.

The larger issue is to emulate the other support hardware, video controller, etc. It's been a long time since I programmed a C64, and I never programmed an NES, so my memory is foggy. As I recall the C64 had a one or two chip solution for video and interfaces.

Richard Pennington
  • 19,319
  • 4
  • 41
  • 70
  • Thanks, the technical stuff is not so much the problem, as I programmed for the NES and have a good understanding of it's graphic processor, what I'm looking for is a general guide on building an emulator, no matter what platform. – Petruza Jan 22 '10 at 17:35