This is a C library for interpreting, assembling, and disassembling CHIP-8 and SCHIP code, optionally utilizing the SDL2 library for graphics.
An example assembler, disassembler, and interpreter is located in tools/
.
cmake -DTARGET_GROUP=all .
make
This will build libc8 as well as the example tools.
SDL2 support is enabled by default. To disable it to use another graphics
library, run cmake
with -DSDL2=OFF
. If simulate()
is ever called in your
code, you must implement these functions with your preferred graphics library:
Note: the all
and tools
targets require SDL2
to be ON
.
void c8_deinit_graphics(void)
int c8_init_graphics(void)
void c8_render(c8_display_t *, int *)
int c8_tick(int *, int)
See this page for more information about these functions.
Full documentation for libc8 is available here.
Testing is done using ctest and Unity (See here for an overview).
cmake -DTARGET_GROUP=test -DSDL2=OFF
make && ctest --verbose
The libc8 CHIP-8 interpreter running Outlaw by John Earnest:
If you find a bug, submit an issue, PR, or email me with a description and/or patch.
Copyright (c) 2019-2025 Ben O’Neill ben@oneill.sh. This work is released under the terms of the MIT License. See LICENSE for the license terms.