This is a CHIP-8 Virtual Machine built in C.
These were the most useful CHIP-8 references used during development:
You need to have SDL2 installed, including development headers.
brew install sdl2If necessary, ensure your library path includes SDL2:
export LIBRARY_PATH="$LIBRARY_PATH:/opt/homebrew/lib"sudo apt update
sudo apt install libsdl2-dev pkg-configMake sure you also have a C compiler (gcc or clang) and make installed.
To use this project, follow these steps:
- Clone the repository to your local machine:
git clone <repository_url>
cd <repository_name>- Build the project:
make- Run the program with the path to your game file:
./chip8 rom/game.ch8To enable debug logging and save the output to a file (debug.log), use the following command:
DEBUG=1 ./chip8 rom/game.ch8When DEBUG is enabled:
- All log levels (INFO, ERROR, WARNING, DEBUG) are written to
debug.log - INFO, ERROR, and WARNING messages are also displayed on the console
- DEBUG messages are only written to the log file
Without DEBUG:
- INFO, ERROR, and WARNING messages are displayed on the console only
- No log file is created
You can find public-domain CHIP-8 games here.
This project is released under an open license for educational and personal use.
