1
0
Fork
You've already forked chipzzzzzzzz
0
CHIP-8 Interpreter written in Zig
  • Zig 99.4%
  • Nix 0.6%
2025年06月10日 14:10:59 +08:00
roms update readme & clean up roms 2024年11月27日 09:15:24 -05:00
src update to SDL3, use Zig v0.14.0, & add nix-shell 2025年06月10日 14:10:59 +08:00
.gitignore better json config loading 2024年11月27日 10:11:43 -05:00
build.zig update to SDL3, use Zig v0.14.0, & add nix-shell 2025年06月10日 14:10:59 +08:00
build.zig.zon update to SDL3, use Zig v0.14.0, & add nix-shell 2025年06月10日 14:10:59 +08:00
config.json.example config file used as an example 2024年11月27日 09:34:16 -05:00
demo1.png add demo image to readme 2024年11月26日 15:05:28 -05:00
demo2.png demo pict added to readme 2024年11月26日 17:21:50 -05:00
LICENSE Initial commit 2024年11月20日 15:41:55 +00:00
README.md better json config loading 2024年11月27日 10:11:43 -05:00
shell.nix update to SDL3, use Zig v0.14.0, & add nix-shell 2025年06月10日 14:10:59 +08:00

Chipzzzzzzzz (Chip with 8 Zs)

Chipzzzzzzzz Interpreter displaying the IBM logo in pink color Chipzzzzzzzz Interpreter displaying the Test Opcode results in pink color

A CHIP-8 Interpreter written in Zig (currently working on v0.14.0). This was my first project using Zig after working through Ziglings.

Building

Assuming zig executable lives in your PATH, simply run zig build. This will result in an executable file chipzzzzzzzz in the ./zig-out/bin/ folder. You can move it to where ever you store executable for your OS (ex. /usr/local/bin/) or run it from this repo directly if you don't want to install it.

Starting a ROM

To load a ROM, simply pass in the file path as a CLI argument:

./zig-out/bin/chipzzzzzzzz <path to ROM file>

There are several ROMs included in the ./roms/ folder in this repo to get started:

./zig-out/bin/chipzzzzzzzz roms/test_opcode.ch8

Important Keys

  • Pressing ESC will quit the program
  • Pressing P will pause the execution of the program. Pressing P again will resume execution.

Setting Custom Config

If it exists, a config.json file placed in the root of this repo can be used to configure many parameters of CHIP8 system. The parameters end-users can configure are:

  • debug (bool): Controls if debugging output (instruction values, register values, etc) should be printed to the console. Defaults to FALSE.
  • font_color: (struct Rgb { r: u8, g: u8, b: u8 }): Change the font color with passed red, green, and blue values (0-255). Defaults to white pixels.
  • display_scale: (u4) Starting scale of display length/width by a factor of N set here. Defaults to 10.

NOTE: You can copy the config.json.example file to config.json as a starting point and then modify or remove fields to suit your needs.

Helpful Resources

Here is a running list of helpful tutorials, resources, etc that I utilized while building out this project: