A simple CHIP-8 emulator written in C++
Passed all the tests from the Timendus chip8-test-suite.
First clone this repository
git clone <repository_url>You can create a build folder and execute the following commands:
mkdir build
cd build
cmake ..
makeThe generated executable is called emulator.
There are 3 options required to correctly run the emulator:
- ROM path
- Resolution scale factor
- CPU cycle delay
Here's an example command to properly use the binary:
./emulator roms/pong.ch8 10 1You can build the project's container by running this command:
docker build -t chip8pp .Then, two options can be considered to run the container.
To run the container this way, you have to create a .env file following the .env.example template.
On Linux, you need to grant access to the X11 server for Docker, because SDL needs to open a graphical window. If you choose to use the Docker Compose command, you must first run the following command:
xhost +local:dockerNote: This is required only if you are using the X11 display server. On systems running Wayland (e.g., recent Ubuntu, Fedora), additional configuration may be needed, as xhost might not be sufficient.
Then just run the following command:
docker compose run --rm chip8ppNote that you can also specify one or more arguments to override the values in .env.
Here's an example
ROM_PATH=roms/superpong.ch8 docker compose run --rm chip8ppThere's also a script that you can use to run the container. It requires 3 arguments (same as before) to run properly. You can use it like this:
./run_container.sh -r roms/pong.ch8 -s 10 -d 1Here are some bonus features/modes
| Key | function |
|---|---|
| m | Mute emulator sound |
I would like to thank Cowgod's for the amazing Chip-8 Technical Reference and Timendus for the CHIP-8 test suite repository.
These resources allowed me to precisely understand how Chip-8 works and test/debug the emulator properly !




