libc8

Build Status.

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/.

Building

cmake -DTARGET_GROUP=all .
make

This will build libc8 as well as the example tools.

SDL2

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.

See this page for more information about these functions.

Example Tools

Documentation

Full documentation for libc8 is available here.

Testing

Testing is done using ctest and Unity (See here for an overview).

cmake -DTARGET_GROUP=test -DSDL2=OFF
make && ctest --verbose

Screenshots

The libc8 CHIP-8 interpreter running Outlaw by John Earnest:

libc8 running outlaw

Further Reading

Bugs

If you find a bug, submit an issue, PR, or email me with a description and/or patch.

License

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.