While preparing to write a Dreamcast emulator I decided to build an emulator for the Nintendo Entertainment System (NES), or Family Computer (Famicom) as it was known in Japan. The NES is a simple 8 bit system that was first released between 1983 and 1986 and also happened to be the first game console that I owned.



Features

This software emulator faithfully mimics the behavior of the Ricoh 2A03 CPU and 2C02 PPU, and is able to successfully boot and play many different kinds of games.

Notable features include:

  1. Semi-cycle-accurate CPU and PPU cycle emulation (but not pixel level)

  2. Functionally precise emulation of all NES supported 6502 opcodes

  3. Emulates the well known 6502 indirect addressing bug

  4. Support for vertical and horizontal scrolling

  5. Emulation of sprite zero hit and max hits per scanline flags

  6. 8x8 sprite and background tile rendering

  7. Properly mirrored palette addresses

  8. Support for proper screen clipping

  9. Sprite layering with correct priorities

  10. iNES ROM file support

  11. Support for two controllers

  12. Output display rendering using OpenGL



Goals

The primary goal for this project was to quickly experiment with building a simple emulator from scratch, based on publicly available documentation. There is a wealth of information about the NES floating around the Internet, but unfortunately it's often incomplete or inconsistent. Parsing out the useful information is itself a bit of a challenge.

Screenshots




Source Code

Quick disclaimer: this emulator was designed to run test simulations and homebrew games. Before you attempt to run it with any commerical game, please check to make sure you are in full compliance with local laws in your area, which may restrict or prohibit such activity.

  SimpleNES Emulator Source (Github).