| Crates.io | chip8sys |
| lib.rs | chip8sys |
| version | 0.1.0 |
| created_at | 2026-01-13 02:22:38.569601+00 |
| updated_at | 2026-01-13 02:22:38.569601+00 |
| description | A CHIP-8 emulator library |
| homepage | https://github.com/nebulous-code/chip-8 |
| repository | https://github.com/nebulous-code/chip-8 |
| max_upload_size | |
| id | 2039183 |
| size | 126,284 |
This crate contains the CHIP-8 emulator core. It handles CPU state, timers, keypad input, and framebuffer output without any UI dependencies.
Repository: https://github.com/nebulous-code/chip-8
cargo add chip8sys
use chip8sys::chip8::Chip8Sys;
fn main() {
let mut emulator = Chip8Sys::new_chip_8();
let rom_bytes = std::fs::read("roms/1-chip8-logo.ch8")
.expect("ROM should load");
emulator.load_rom_bytes(&rom_bytes);
emulator.tick(10).expect("tick should succeed");
emulator.tick_timers(1);
let framebuffer = emulator.framebuffer_packed();
println!("Framebuffer bytes: {}", framebuffer.len());
}
Typical embedding loop:
load_rom_bytes.set_keys or set_keys_mask.tick.tick_timers.Quirk flags are available through Chip8Quirks, and can be applied by calling
set_quirks. Timer behavior can be configured via set_timer_mode.
chip8wasm: A wasm-bindgen wrapper around chip8sys for browser use.Fork the repository and open a pull request with the changes.