This project's main purpose is to write a readable, understandable interpreter for Chip-8 using Rust. It is meant for developers that either never coded in Rust and/or never worked on an interpreter or emulator.
The interpreter is a work in progress. It are still some key parts missing, such as:
- Sound
- Enhance performance and playing experience
- Rust >= 1.59.0
To run a ROM in the interpreter, you need to pass the ROM location as an argument when calling the program. For instance, if you're using cargo
, you can do it like this:
cargo run ../../my-chip-8-roms/Pong.ch8
You can also run the tests in the usual Rust way:
cargo test
To make it feel "realistic," I've tried to separate everything as if it was a real computer:
- Motherboard: takes care of booting up the fetch-decode loop.
- CPU: fetches and decodes instructions, takes care of registers, timers, and the stack.
- Memory: stores and reads data from the ROM.
- Instruction: this was separated from the CPU because of the amount of data, and it localizes and executes the instructions on Chip-8.
- Interface: loads the screen where the emulator runs, controlling the display and input using minifb.
- Keyboard: contains information about which keys will be used in the interpreter.
To run the interpreter, you need to have ROMs that are compatible with Chip-8. These are some resources that can be found on Github:
The main resources I've used when developing the interpreter are: