2 unstable releases

0.2.0 Oct 25, 2020
0.1.0 Sep 13, 2020

#92 in Emulators

Custom license

285KB
7.5K SLoC

NES Core

Build Status codecov nescore crate

NES emulator and tools

Image not found

Build

cargo build

Several ROM tests such as nestest, nes_instr_test and sprite_zero_hit are run as integration tests. They can be run with the following:

# Pull in test ROMs first
git submodule update --init --recursive
# Run all tests
cargo test

nescore

Core library for emulating the NES.

The basics so far:

use nescore::{Nes, Cartridge, Button};

fn main() {
    let mut nes: Nes = Cartridge::from_path("/path/to/rom").unwrap().into();

    // Run the NES for a single frame and return video/audio buffers.
    let (framebuffer, samplebuffer) = nes.emulate_frame();

    // Update display and audio on platform of your choice.
    // ...

    // Standard controller input: Press the 'A' button
    nes.input(Button::A, true);
}

Check out nescli for a full SDL example.

nescli

Some tooling for interacting with ROM files.

nescli run    <ROM> # Run the ROM file
nescli run -d <ROM> # Run the ROM file with CPU debug output

nescli info <ROM>   # Display cartridge header information
nescli img  <ROM>   # Dump CHR ROM to a PNG file

nescli audio <ROM>  # Just play ROM audio

No runtime deps