A fully functional Chip-8 interpreter written in Rust, demonstrating deep understanding of emulation, low-level systems programming, and graphics rendering.
Technically, it is an interpreter and not an emulator.
- Accurate CPU Emulation: Implemented all 35 Chip-8 opcodes with precise instruction decoding and execution logic
- Memory Management: Designed and implemented a complete memory model (4KB RAM, stack, and registers) with proper address mapping
- Graphics Rendering: Integrated SDL2 for pixel-perfect display rendering at configurable scales
- Input Handling: Built a complete input system mapping hexadecimal keypad to AZERTY keyboard layouts
- ROM Compatibility: Successfully runs multiple ROM files including IBM logo, test suites, and games (Space Invaders, Pong variants)
Through this project, I learnt about the following subjects:
- Low-level systems programming: Understanding CPU instruction cycles, opcode, memory layout, and register operations
- Rust systems programming: using Rust for systems programming and working with binary operations
- Emulation architecture: Learning how interpreters decode and execute instructions, manage state, and handle timing
- SDL2 integration: Graphics programming and real-time input handling in Rust
- SDL2: Graphics and input library. Must be installed else program will not compile.
- Rust: 1.56 or later
Clone the repository and navigate to the project directory:
git clone https://github.com/morukele/Chip-8
cd Chip-8cargo run -- -r ROM-NAMEThis runs the interpreter with default settings and loads the specified CHIP-8 ROM file.
-r,--rom: Name of CHIP-8 ROM file (include file extension) [default:1-chip8-logo]-s,--scale: Display scale factor [default:10]-h,--help: Print help information-V,--version: Print version information
cargo run -- -r space_invaders.ch8 -s 15The Chip-8 was originally designed for AZERTY keyboards. This interpreter maps the 16-key hexadecimal keypad as follows:
| Chip-8 Key | AZERTY Key |
|---|---|
1 |
& |
2 |
é |
3 |
" |
C |
' |
4 |
a |
5 |
z |
6 |
e |
D |
r |
7 |
q |
8 |
s |
9 |
d |
E |
f |
A |
w |
0 |
x |
B |
c |
F |
v |




