A CHIP-8 emulator written in Rust.
- Full CHIP-8 instruction set
- 64×32 display rendered with
pixels+winit - 440 Hz beep audio via
rodio - 60 Hz frame loop with 10 CPU cycles per frame
- Standard QWERTY → CHIP-8 hex keypad mapping
- Rust (stable)
cargo build --release
cargo run --release -- path/to/rom.ch8Pass the path to any .ch8 ROM file as the first argument.
The original CHIP-8 used a 16-key hex keypad. This emulator maps it to QWERTY as follows:
| QWERTY | CHIP-8 |
|---|---|
| 1 2 3 4 | 1 2 3 C |
| Q W E R | 4 5 6 D |
| A S D F | 7 8 9 E |
| Z X C V | A 0 B F |
| File | Purpose |
|---|---|
src/chip8.rs |
Core emulator — CPU, memory, display, timers |
src/utils.rs |
Opcode nibble extraction helpers |
src/main.rs |
Window setup, event loop, audio, key mapping |
Memory layout:
0x000–0x04F: Reserved0x050–0x09F: Built-in fontset (digits 0–F)0x200–0xFFF: ROM + program memory
Implementation notes:
op_store_regs/op_load_regsdo not incrementI(modern CHIP-8 behaviour)- RNG uses a simple LCG — no external
randcrate - Timers decrement once per frame (tied to the 60 Hz loop, not a separate 60 Hz tick)
This repository does not include any ROMs. The included Breakout.ch8 ROM used during development is not mine — it was sourced from the internet. Many public-domain CHIP-8 ROMs are available at places like chip8Archive or Zophar's Domain.
You can load any compatible .ch8 file by passing its path on the command line.
MIT