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.
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:
Semi-cycle-accurate CPU and PPU cycle emulation (but not pixel level)
Functionally precise emulation of all NES supported 6502 opcodes
Emulates the well known 6502 indirect addressing bug
Support for vertical and horizontal scrolling
Emulation of sprite zero hit and max hits per scanline flags
8x8 sprite and background tile rendering
Properly mirrored palette addresses
Support for proper screen clipping
Sprite layering with correct priorities
iNES ROM file support
Support for two controllers
Output display rendering using OpenGL
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.
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).