A Chip8 emulator written in Rust. This project implements a fully functional Chip8 virtual machine that can run classic Chip8 ROMs.
- Complete implementation of the Chip8 instruction set
- Real-time emulation with configurable speed
- Graphical display using the Pixels library
- Keyboard input mapping for game controls
- Sound and timer support
- ROM loading from file
- Rust and Cargo (install from rustup.rs)
- Clone the repository
- Build the project:
cargo build --releaseThe compiled binary will be available in target/release/.
Run the emulator with a ROM file:
chip8 --rom path/to/your/romYou can also configure the emulation speed by specifying the delay between cycles:
chip8 --rom path/to/your/rom --delay 5The delay is specified in milliseconds and defaults to 3ms if not provided.
The Chip8 uses a 16-key hexadecimal keypad. This emulator maps those keys to the following keyboard layout:
Original: Mapped to:
1 2 3 C 1 2 3 4
4 5 6 D Q W E R
7 8 9 E A S D F
A 0 B F Z X C V
src/graphics/- Display and rendering componentssrc/hardware/- CPU and memory implementationsrc/system/- Main emulator logic and coordination
pixels- GPU-accelerated pixel frame renderingwinit- Cross-platform window handlingclap- Command-line argument parsingrand- Random number generationcrossbeam-channel- Multi-producer, multi-consumer channels for message passing
This project is open source and available under the MIT License.
This project is inspired by the original Chip8 interpreter from the 1970s and various resources on Chip8 emulation.