Crates.io | nescore |
lib.rs | nescore |
version | 0.2.0 |
source | src |
created_at | 2020-09-13 18:48:48.851525 |
updated_at | 2020-10-25 01:18:33.330993 |
description | NES emulator |
homepage | |
repository | https://github.com/nnarain/nescore |
max_upload_size | |
id | 288307 |
size | 346,601 |
NES emulator and tools
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
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.
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