A cycle-accurate NES emulator written in Rust 🦀 with an egui frontend. Cycle-accuracy in this context means that the hardware is emulated one CPU cycle at a time (rather than one CPU instruction at a time). This supports the emulation of games that depend on hardware quirks (open bus behaviour, dummy reads, tight interrupt timings) without relying on game-specific hacks.
- Cycle-accurate emulation with full audio/video support (CPU, PPU and APU implemented)
- Controller support with configurable button mappings
- "Rewind" save-state feature (shown below ⬇️)
- Adjustable emulation speed
- CPU debugger (in development)
Games with any of the following mappers are supported. This covers over 1000 NES games.
- iNES mapper 0 / NROM
- iNES mapper 1 / MMC1
- iNES mapper 2 / UxROM
- iNES mapper 3 / CNROM
- iNES mapper 4 / MMC3
- iNES mapper 7 / AxROM
A handful of games are known to not work (one of which is Battletoads) due to a bug in my sprite 0 hit detection.
Compiled binaries aren't yet available, so you must build from source. First install Rust if you haven't already.
git clone https://github.com/AdamBlance/nes-emu.git
cd nes-emu
cargo build --release
A specific version of Rust nightly (as defined in rust-toolchain.toml
) should be automatically installed when attempting to build (as the emulator depends on unstable features).
Run with cargo run --release
. Note that without the --release
flag the emulator will not perform well.
If the emulator is struggling to keep up, try uncommenting the following lines in Cargo.toml
and building again.
[profile.release]
lto = "fat"
codegen-units = 1
The compilation will take a long time but this should yield a binary that performs better.
This project is not based on any existing emulator and was not developed with reference to any existing emulator code. It has been written to match the behaviour of NES hardware as described by/on/in: