DotNES: An NES Emulator in C#

 

About

I started DotNES in September of 2004 as an attempt to write an emulator for my favorite game console in my favorite language. Originally I was going to call it SharpNES, an amazingly clever name devised by my friend Brian... however in my quest for perfection I waited too long to release it and in that time another emulator with the same name has been released into the wild. So as to avoid confusion, I've renamed my emulator to DotNES. Not quite as clever, but still annoyingly punny.

I designed and implemented my own 6502 core, PPU, Sound, Mapping and general NES hardware implementation for DotNES, it is not a port of any existing NES emulator. After writing it (or what's currently completed anyway), I have to say that the NES is one complicated machine. If I have seen so far, it is because I have stood on the shoulders of giants -- the documents at NesDev made this emulator possible and the people who put in an insane amount of effort in reverse-engineering the NES's hardware deserve a ton of credit for their amazing work.

Current Status (v0.30)

DotNES emulates the NES's 6502 CPU, PPU, Sound, and Joypad 1. But you'd pretty much expect that from any emulator. Current features include:

v0.30 has increased performance about 25% over the prior versions, though it's still not all that impressive. A lot of this has to do with the architecture, I'm debating doing some refactoring to gain some speed.

Download

The requirements to run DotNES are: Windows, DirectX9 and .NET Framework 2.0. You'll definitely need a fairly decent machine (I can get ~360fps on a single core of an AMD Phenom 9950, your mileage may vary), and if your machine lacks DirectX video acceleration in hardware, performance will be quite slow.

Download DotNES v0.30 Now!

NOTE: You will almost certainly need the Managed DirectX runtime installed, this can be obtained here. Supposedly (and I have not tested it) the end-user runtime installer now contains the Managed DirectX stuff so you no longer need to download the entire SDK just to run the emulator. Progress!

For a slight (2-4%) speed improvement you can generate a native image of the emulator (the released binary is JITted); eventually I'll have some sort of installer that will do this for you for your current architecture. For right now, I'm lazy and you'll have to do it by hand. (%windir%\Microsoft.NET\Framework\v2.050727\ngen.exe NES.exe should do the trick.) I suggest that if you really need that 4% increase that you look into using another emulator that isn't written in a managed language :).

The default keys for the emulator are as follows (and can be reconfigured -- however these changes are not currently saved when you exit the emulator):

PC Keyboard
NES
A
A
Z
B
S
Select
X

Start

Arrows
D-Pad

 

Additionally you can configure a joystick of your choice instead of using the Keyboard; currently only standard joystick buttons and POV hats (which many gamepads use for d-pads) are supported and these settings are ALSO not saved when you exit. Sorry about that. To be fixed in an upcoming release, I promise!

Note: There are no ROM files included with this emulator. If you want ROMs, they are probably among the easiest things to find on the Internet right now using a search engine. Consider thyself warned: If you e-mail me asking for ROM files, you will be entering a world of pain.

Screenshots:

Here are some obligatory screen shots of my marvy emulator in action! You can barely restrain yourself, you're so excited.

   

Back to Projects