This project was used to learn about the Chip8 emulator based on this reference: http://devernay.free.fr/hacks/chip8/C8TECH10.HTM . I originally wrote it in Gleam, but ran into some issues since it isn't low level enough.
The emulator relies on Minifb for the graphics, Clap for the CLI, and rand for the CXKK opecode.
- Cpu runs on a separate thread at 500 Hz, or 500 instructions a second (2ms per instruction).
- Window runs at 60fps.
- Runs off binary .rom and .ch8 files.
I have mapped the Original CHIP-8 Keypad:
| 1 | 2 | 3 | C |
|---|---|---|---|
| 4 | 5 | 6 | D |
| 7 | 8 | 9 | E |
| A | 0 | B | F |
to this:
| 1 | 2 | 3 | 4 |
|---|---|---|---|
| Q | W | E | R |
| A | S | D | F |
| Z | X | C | V |
Usage: chippy <ROM>
Arguments:
<ROM> Path to the ROM file
Options:
-h, --help Print helpI used Claude Code to build out the integration tests. I then used this, in conjuction with the tests I wrote to make improvements to the implementation and discover bugs. Everything else was written by me as I wanted to learn how to make this emulator.