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

Documentation

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

Testing

Testing is done using ctest and Unity.

git submodule update
cmake -DTARGET_GROUP=test -DSDL2=OFF
make && 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

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 [email protected]. 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