A from-scratch CHIP-8 emulator in modern C++23: instruction decoding, a multi-threaded execution model (separate CPU and timer threads, synchronized with mutexes and atomics), and an SDL3 front end for display, audio, and keyboard input.
This was built as a personal project to get hands-on with C++, so there's no expectation of continued development or support -- but the emulator is feature-complete, and its correctness is checked by both a unit test suite and a community-standard reference ROM suite (see below).
- All instructions are implemented
- Sound
- Keyboard input
- Timers
This project depends on SDL and Catch2, vendored as git submodules. Clone
with --recursive, or run git submodule update --init --recursive in an
existing checkout.
Then build and run with:
./run.shThis configures and builds the project with CMake into build/, then
launches the emulator. Run ./run.sh test instead to build and run the unit
test suite.
./run.sh always launches a native file-open dialog to pick a ROM; it
doesn't forward a ROM path. To load one directly, invoke the built binary
yourself after building:
build/debug/chip8 path/to/rom.ch8The CHIP-8 hex keypad (0-9, a-f) is mapped directly to the
corresponding keys on your keyboard.
There is a suite of test ROMs created by Timendus and can be found here. These run inside the emulator itself and report pass/fail on screen; there is no automated harness around them, so results have to be checked by eye.
There also exists a number of unit tests, which test some of the trickier instructions and display logic. The unit tests alone are not sufficient, if you make changes to the software please ensure the test suite still completes successfully.
This project is licensed under the BSD 2-Clause License.
