A Nintendo Entertainment System emulator written in C++. This has only been tested on Linux but should be cross-platform.
- 6502 CPU
- iNES cartridge loading
- background rendering
- sprite rendering
- user input
- audio
- support for most common mappers
Currently implemented mappers:
- NROM (000)
- MMC1 (001)
- UxROM (002)
- MMC3 (004)
- A button: X
- B button: Z
- Start: S
- Select: A
- D-pad: Arrow keys
- Play/pause: Space
- Step single CPU instruction (while paused): Enter
- Cycle displayed nametable: Tab
- Cycle colour palette: P
The main screen is drawn to the left, with debug information drawn to the right. This includes the values of internal registers, the selected nametable (changed by pressing tab), and the pattern tables.
The structure of the code closely resembles the structure of the hardware itself, with busses being used to map addresses to the correct components. The functionality of the PPU bus is encapsulated within the PPU class, whereas the CPU bus is its own class which can be though of as the main class of the emulator.
This structure is shown by the following diagram:
- Nesdev Wiki - Hardware reference
- olcPixelGameEngine - Library used to draw window
- tiny file dialogs - Library used for the file picker UI
- javidx9 youtube channel - Great video series on NES emulation