nescore

Crates.ionescore
lib.rsnescore
version0.2.0
sourcesrc
created_at2020-09-13 18:48:48.851525
updated_at2020-10-25 01:18:33.330993
descriptionNES emulator
homepage
repositoryhttps://github.com/nnarain/nescore
max_upload_size
id288307
size346,601
Natesh Narain (nnarain)

documentation

README

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
Commit count: 302

cargo fmt