A simple CHIP-8 Emulator written in C!
Requires Raylib.
CHIP-8 is regarded by some as an interpreted programming language. It is meant to serve as a "fantasy" hardware instruction set. This is my attempt at making an emulator capable of running software written to be used on that architecture.
I created this software mainly as a challenge to myself, since I have long been fascinated by emulators and their innter workings. I feel that I still have much to learn, but I am really glad to have learned what I have learned so far. I hope to eventually apply these principles later on, especially as I learn more about software virtualization and containerization.
A demo of me running this emulator can be found here.
To develop this emulator, I used:
- Neovim (as my IDE)
- Raylib (Graphics library)
- The C compiler provided by the GNU Compiler Collection
Here are some resources that proved most helpful to me:
- Source code for JohnEarnest's OCTO, a CHIP-8 IDE, which includes a very well-made JavaScript implementation
- Wikipedia's page on the CHIP-8 (although its lack of documentation on hardware quirks may have slowed me down overall)
- Tobias V. Langhoff's Guide to making a CHIP-8 emulator
- Timendus's CHIP-8 Test Suite, a powerful collection of test ROMs that really helped me identify what little things I got wrong
git clone https://github.com/pgattic/kronch && cd kronch
make
./kronch [ROM].ch8
The output binary is called "kronch". After compiling, you can install the emulator system-wide with:
sudo make install
- Start the emulator with
kronch [ROM].ch8
- Try running
gcc src/main.c -o kronch -lraylib -lGL -lm -lpthread -ldl -lrt
from the root of this repository! No guarantees that it will all work on other operating systems.