A simple CHIP-8 emulator written in C++23 using Raylib for graphics and audio. This emulator implements all 35 CHIP-8 opcodes and provides a modern, user-friendly interface.
| ROM Selection Menu | Pong Gameplay |
|---|---|
![]() |
![]() |
| Browse and select from available ROM files | Classic Pong game with sound |
| Tetris Gameplay | IBM Logo |
|---|---|
![]() |
![]() |
| Tetris running on the emulator | Display IBMs logo |
- Complete CHIP-8 Instruction Set - All 35 opcodes implemented
- ROM Selection Menu - Easy browsing and selection of ROM files
- Audio Support - Programmatically generated beep sounds
- Adjustable Speed - Control emulation speed (0.5x to 10x)
- ESC to Menu - Return to ROM selector anytime during gameplay
- Cross-Platform - Works on macOS, Windows, and Linux
- CMake 3.20 or higher
- C++23 compatible compiler:
- GCC 13+ (Linux)
- Clang 16+ (macOS/Linux)
- MSVC 2022+ (Windows)
- Raylib 5.0 or higher
brew install raylibsudo apt-get install libraylib-devsudo dnf install raylib-devel- Download Raylib from raylib.com
- Extract and set
RAYLIB_PATHenvironment variable, OR - Use vcpkg:
vcpkg install raylib
If raylib is not available via package manager, CMake will attempt to download and build it automatically using FetchContent.
# Clone the repository
git clone https://github.com/yourusername/Chip8_Emulator.git
cd Chip8_Emulator
# Create build directory
mkdir build && cd build
# Configure and build
cmake ..
cmake --build .
# Run the emulator
./Chip8_Emulatormkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j$(sysctl -n hw.ncpu)
./Chip8_Emulatormkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j$(nproc)
./Chip8_Emulatormkdir build
cd build
cmake .. -G "Visual Studio 17 2022"
cmake --build . --config Release
.\Release\Chip8_Emulator.exemkdir build && cd build
cmake .. -G "MinGW Makefiles"
cmake --build .
.\Chip8_Emulator.exe-
Interactive Mode (Recommended):
./Chip8_Emulator
This will show a ROM selection menu where you can browse and select ROM files.
-
Direct ROM Loading:
./Chip8_Emulator roms/PONG.ch8
- Arrow Keys (↑/↓): Navigate through ROM list
- Enter/Space: Select ROM
- ESC: Exit (on first menu) or return to menu (after playing)
- 1-4, Q-R, A-F, Z-V: CHIP-8 keypad input
- ESC: Return to ROM selection menu
- - (Minus): Decrease emulation speed
- + (Plus): Increase emulation speed
Place your .ch8 ROM files in the roms/ directory. The emulator will automatically scan and list all available ROMs.
The emulator follows a clean architecture with clear separation of concerns:
- Core Layer: Pure CHIP-8 emulation logic, no graphics dependencies
- App Layer: Raylib integration for rendering, input, and audio
Test your emulator with these popular CHIP-8 ROMs:
- PONG.ch8 - Classic Pong game
- TETRIS.ch8 - Tetris
- INVADERS.ch8 - Space Invaders
- IBM.ch8 - IBM logo test ROM
MIT License
- Cowgod's Chip-8 Technical Reference - CHIP-8 specification
- Raylib - Amazing graphics library. Raylib Cheatsheet
- CHIP-8 community for ROM files and testing. ROM files
If CMake can't find Raylib:
- Make sure Raylib is installed via package manager, OR
- CMake will automatically download and build Raylib using FetchContent
- Ensure ROM files are in the
roms/directory - ROM files must have
.ch8extension - Check that the
roms/directory exists in the same directory as the executable
- Ensure you have a C++23 compatible compiler
- Update CMake to version 3.20 or higher
- On Windows, make sure you have Visual Studio Build Tools installed



