A CHIP-8 emulator/interpreter built using C++. Lightweight and simple. Uses the COSMAC VIP specifications along with modern tweaks. Trying out a few optimizations along the way.
demo (ROM taken from here)
Loads and runs basic, classic CHIP-8 ROMs (like Pong, Breakout, Space Invaders, etc). This allows you to build and play your favorite classic games. The emulator handles input, rendering, timers, and sound.
NOTE: Customizing the
ipfvalue allows you to change how fast the ROM runs. Different programs have different preferred values. For a full guide on tuning this value, refer to this guide.
To use this emulator, you have two options.
-
Download one of the release binaries we have built for each platform (
Windows,Linux,MacOS). Refer to our release links here to download. After your download, you can use CLI command./chip_8_emulator <ROM_path> <ipf>to run the emulator. -
Clone this repository and build the binaries yourself. Refer to guide below.
Any C/C++ compiler should work fine with support of C++20 or above.
Libraries
SDL2SDL2_image
# Example: Ubuntu/Debian
sudo apt-get install libsdl2-2.0-0git clone https://github.com/Waterfountain10/chip-8-emulator.git
cd chip-8-emulator
mkdir build && cd build
cmake ..
make
# Run your favorite ROM using the format: ./chip_8_emulator <ROM_path> <ipf>
./chip_8_emulator ../chip8-roms/pong.ch8 12Some personal tweaks and optimizations:
- computed go-to table for mapping instructions in O(alpha) rather than switch-case's O(logn)
- custom instruction-per-frame (IPF) control (make your game speedy if you want)
- async key handling so input doesn’t block the whole system
- fonts can be loaded from a custom hex address
- some debug-friendly logging for draw calls and memory
- flexible architecture split between platform / chip / gui
Mostly to get more comfortable with C++, memory management, and SDL.

