Forum Index | FAQ | New User | Login | Search

Make a New PostPrevious ThreadView All ThreadsNext ThreadShow in Flat Mode*

SubjectRe: Emulator Writing Reply to this message
Posted bycodingsama
Posted on05/25/06 10:16 AM

Speaking as an NES emulator author, the most complex thing about writing an NES emulator is Memory Mappers. When you add mappers in to your emu, this is where you experience complexity.

So don't worry about them. Just support games like Baloon Fight, Mario, etc. that use "mapper 0": no mapper. has enough info on the NES (under 'technical docs' section) to write your emulator. I'll give you a few steps:

I use C++, personally, as it's an elegant way of representing a machine, but you can use the same process in C if you want.

1) Create an NES class or object of some form. It should contain the PPU(picture processing unit), the system memory, the CPU, and the joystick input units.

2) READ UP ON the nes! nes.txt and nestech.txt from are indespensible

3) Code up a simple routine to load the ROMs (since you won't be worrying about MMCs, you don't need a complex one, and you can just have a flat 64k array of memory to work with)

4) Now find something to get input and output with. I'd reccommend SDL or Allegro. has info on Allegro, and SDL, well, google it. Allegro is great for starting out, but its timers kind of suck.

5) Program the memory reads/writes. Small task, but make sure to pay attention to the documentation!

6) Most of the work you'll do now is just writing the PPU.
It draws the pictures to the screen. Joysticks are a bit of a pain, but in the end, very easy and short.

And then...all of the (hopefully) have a working NES emulator!

Unfortunately, programming the PPU is rather complex compared to the rest. Lots and lots of bit shifts and pointer maths. You can get it wrong very easy and have very little hope of debugging it. Just be very careful and make sure you understand the docs.

Entire Thread
Subject  Posted byPosted On
*Emulator Writing  caseh10/03/05 12:31 PM
.*Re: Emulator Writing  Jan_Klaassen10/07/05 05:56 PM
.*Re: Emulator Writing  erikduijs10/05/05 05:23 AM
.*Re: Emulator Writing  Bart T.10/04/05 00:05 AM
..*Re: Emulator Writing  Hyde10/04/05 01:26 PM
...*Re: Emulator Writing  Bart T.10/04/05 10:39 PM
....*Re: Emulator Writing  caseh10/14/05 07:37 PM
......Re: Emulator Writing  codingsama05/25/06 10:16 AM
.....*Re: Emulator Writing  Stainless01/12/06 11:36 AM
.....*Re: Emulator Writing  Jan_Klaassen10/15/05 09:51 AM