zc8 is a lightweight Chip-8 emulator implemented in Zig, designed to provide a clean and minimal implementation of the classic Chip-8 virtual machine. It is well-suited for experimentation, and running retro games.
The emulator is compiled to WebAssembly using Emscripten, allowing it to run directly in the browser. SDL3 is used for handling graphics and input and sound.
This project was developed as a way to gain hands-on experience with Zig, WebAssembly, Emscripten, and emulator development.
![]() |
![]() |
---|---|
![]() |
![]() |
nix develop
Note
To Resolve the emscripten cache issue : NixOS/nixpkgs#139943 (comment)
zig build -Dtarget=wasm32-emscripten -Doptimize=Debug --sysroot "$(em-config CACHE)/sysroot"
- Copy over the
zc8.js
andzc8.wasm
towebsite
directory and runemrun index.html
inside website directory
zig build test --summary all
- Guide To Making A CHIP-8 Emulator
- Revisiting Chip 8
- CHIP-8 Research Facility
- Cowgod's Chip-8 Technical Reference
- https://github.com/castholm/SDL
- SDL3 Example: audio/03-load-wav
- Emscripten: Interacting With Code
- Octo : A Chip 8 IDE
- chip-8-test-suite
- chip-8-test-rom
- Chip-8-Archive
- Chip-8-Roms
- Building a CHIP-8 Emulator - C++
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.