Skip to content

bmoneill/libc8

Repository files navigation

libc8

CI Status Doxygen Status Clang-format 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

Linux

cmake -S . -B build
cmake --build build
sudo cmake --install build

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.

Testing

Testing is done using ctest and Unity.

git submodule update
cmake -S . -B build -DTARGET_GROUP=test -DSDL2=OFF
cmake --build build 
cd build
ctest --verbose

Note: When built with tests enabled (-DTARGET_GROUP=test), libc8 will not halt execution after encountering an error, potentially leading to undefined behavior.

Showcase

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

libc8 running outlaw

Documentation

Library documentation for libc8 is available on the GitHub pages site.

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-2026 Ben O'Neill ben@oneill.sh. This work is released under the terms of the MIT License. See LICENSE for the license terms.

Releases

No releases published

Packages

No packages published