Table of contents
TRIP-8 is a CHIP-8 emulator written in C99 using the SDL2 library.
- CPU cycle is 660Hz, but can be edited in emulator.c with the
CYCLE_MS
macro. - Refresh rate is 60Hz (includes updating of timers), but can be edited in emulator.c with the
REFRESH_MS
macro. - Window scale is 12 (768x384), but the window is resizable and the default scale can be edited in emulator.c with the
WINDOW_SCALE
macro. - The compatibility is strictly CHIP-8 as described in the flags and quirks tests of the CHIP-8 test suite. This compatibility choice breaks some games, like Blinky.
- Uses a procedural sine wave sound for beep, which can be customized in system_audio.c.
Key | Action |
---|---|
Escape | Quit the emulator |
Return | Restart the emulator |
Left, up, right and down arrow keys are mapped to CHIP-8 4
, 2
, 6
and 8
keys respectively due
to being commonly used for 4-way movement. The numpad keys are mapped to the corresponding CHIP-8
number keys. Controls can be modified in system_keyboard.c.
The following is required to compile the emulator:
- A C99 compiler
- Makefile
- SDL2
$ apt install gcc make libsdl2-dev
$ pacman -S gcc make sdl2
$ xbps-install gcc make SDL2-devel
$ apk add gcc make sdl2
$ brew install gcc make sdl2
$ git clone https://github.com/LordOfTrident/trip-8
$ make release
$ ./trip8 roms/trip8.rom
You can find games and other roms in the roms folder and compatibility tests in the tests folder.
If you are on Linux (or a Unix OS), you can use make install
to install the emulator into /usr/bin/trip8
:
$ make install
$ trip8 roms/trip8.rom
- https://en.wikipedia.org/wiki/CHIP-8#Opcode_table
- Cowgod's CHIP-8 Technical Reference
- https://www.laurencescotford.net/2020/07/19/chip-8-on-the-cosmac-vip-drawing-sprites/
- Blue monochrome color palette
If you find any bugs, please, create an issue and report them.