A CHIP-8 emulator developed in C using the CodeLite IDE as part of an academic project at Polytech Tours.
CHIP-8 is an interpreted programming language developed in the 1970s, originally designed to run on the COSMAC VIP microcomputer. This project implements a CHIP-8 emulator capable of loading and running .ch8 ROM files.
This project relies on a pre-existing Display / Keyboard / Sprite library provided by the engineering school Polytech Tours. This library is built on top of SDL2 and handles:
- Display – rendering the 64×32 pixel screen
- Keyboard – mapping the CHIP-8 hexadecimal keypad to host keyboard input
- Sprites – managing built-in font/sprite data
The provided library is located in
chip8/libprovided/.
The project uses a Makefile generated by CodeLite. To build, run:
make -f chip8/chip8.mkMake sure SDL2 is installed on your system before building.
After building, run the emulator by passing a ROM path. The default ROM path can be changed in chip8/main.c:
const char* romPath = "path/to/your/rom.ch8";Then launch the emulator:
./chip8Press the window's close button to exit.
| ROM | Status |
|---|---|
| CHIP-8 Logo | ✅ Validated |
| IBM Logo | ✅ Validated |
| Corax+ | ✅ Validated – all opcodes correctly implemented |
| Flags | ✅ Validated – all opcodes correctly implemented |
| Quirks | ✅ Validated – all quirk settings correctly implemented |
| Keypad | |
| Beep | ✅ Validated – sound works correctly |
The FX0A opcode uses the keyboard_wait function from the provided library, which is blocking. This prevents the emulator from updating timers while waiting for input, causing the Keypad ROM to report the opcode as "not halting". Implementing a non-blocking alternative using raw SDL2 events was not completed due to time constraints.
Several games were tested, including Pong. All tested games run correctly and are fully playable.
chip8/
├── collections/ # Core CHIP-8 data structures and processor logic
├── libprovided/ # Display / Keyboard / Sprite library from Polytech Tours (SDL2)
├── test/ # ROM test utilities
├── utils/ # Helper utilities (ROM loader, etc.)
└── main.c # Entry point