A simple CHIP-8 emulator written in C++ using SDL3 for graphics and input. The emulator implements the standard CHIP-8 instruction set and runs classic ROMs such as Pong, Invaders, and Tetris.
- Linux (tested on Arch Linux)
- g++ (C++ compiler)
- pkg-config
- SDL3
On Arch Linux:
sudo pacman -S sdl3Verify SDL3 installation:
pkg-config --modversion sdl3CHIP8-emulator/
├── src/
│ ├── main.cpp
│ ├── chip8.cpp
│ └── chip8.h
├── roms/
│ ├── invaders.c8
│ ├── pong2.c8
│ └── tetris.c8
└── README.md
From the project root directory:
g++ src/main.cpp src/chip8.cpp -o chip8 `pkg-config --cflags --libs sdl3`Run the emulator by passing a CHIP-8 ROM file:
./chip8 roms/invaders.c8Other examples:
./chip8 roms/pong2.c8
./chip8 roms/tetris.c81 2 3 4 → 1 2 3 C
Q W E R → 4 5 6 D
A S D F → 7 8 9 E
Z X C V → A 0 B F
ESC → Quit emulator
- Emulator core is independent of SDL.
- Display resolution is 64×32, scaled for visibility.
- ROMs are loaded starting at memory address 0x200.
- Fontset is loaded at memory address 0x50.
- Detailed comments are provided for all CHIP-8 opcodes to explain instruction behavior and implementation logic.
The following references were used while implementing the emulator:
- https://multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/
- https://multigesture.net/wp-content/uploads/mirror/goldroad/chip8.shtml
- http://devernay.free.fr/hacks/chip8/C8TECH10.HTM#3.0
Public domain CHIP-8 games can be found here:
This project is intended for educational use. ROM licenses depend on their respective authors.

