{"id":13740854,"url":"https://github.com/Arwalk/ChipZ","last_synced_at":"2025-05-08T20:32:49.869Z","repository":{"id":196307212,"uuid":"357574095","full_name":"Arwalk/ChipZ","owner":"Arwalk","description":"A simple Chip8 emulator (executable and library) written in Zig.","archived":false,"fork":false,"pushed_at":"2024-06-13T21:28:31.000Z","size":84,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T04:58:09.051Z","etag":null,"topics":["chip-8","chip8","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arwalk.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-13T14:02:10.000Z","updated_at":"2024-08-12T19:48:50.000Z","dependencies_parsed_at":"2024-11-15T10:33:24.150Z","dependency_job_id":"14b3026c-f01e-4d8b-808e-8a35d3268dae","html_url":"https://github.com/Arwalk/ChipZ","commit_stats":null,"previous_names":["arwalk/chipz"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arwalk%2FChipZ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arwalk%2FChipZ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arwalk%2FChipZ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arwalk%2FChipZ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arwalk","download_url":"https://codeload.github.com/Arwalk/ChipZ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253145090,"owners_count":21861185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chip-8","chip8","ziglang"],"created_at":"2024-08-03T04:00:52.972Z","updated_at":"2025-05-08T20:32:49.519Z","avatar_url":"https://github.com/Arwalk.png","language":"Zig","funding_links":[],"categories":["Applications"],"sub_categories":[],"readme":"= ChipZ\n\nThis is a simple Chip8 emulator built using the Zig programming language.\n\nThis software was mostly meant to be for me to learn the basics of Zig, but it should be working for general Chip8 emulation.\n\nThis emulator was built following https://tobiasvl.github.io/blog/write-a-chip-8-emulator/[This guide] for the Chip 8 emulation itself, and https://dev.to/fabioarnold/setup-zig-for-gamedev-2bmf[This other guide] for the SDL2 setup.\n\nSome demo files are in this repository. Here are the sources and description. All credits to the original creators.\n\n- https://github.com/corax89/chip8-test-rom[test_opcode.ch8] is a a general test for Chip 8 emulators\n- https://github.com/daniel5151/AC8E/tree/master/roms[bc_test.ch8] is another general test file for Chip 8 emulators\n- https://github.com/loktar00/chip8/tree/master/roms[IBM Logo.ch8] was found at this link (many interesting roms here!) and is just a display test\n- https://github.com/Skosulor/c8int[c8_test.c8] is an excellent testing rom too, with tests on timers.\n\n== Building and running\n\n=== Using the library\n\n`src/lib/chipz.zig` is a file containing everything needed to start chip 8 emulation. You just need to bring the GUI part to it. For your own use, add this file as a package to your `build.zig` file.\n\nFor an example of how to use the library, check out `main.zig` or this simple example:\n\n[source, zig]\n----\nvar general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){};\nconst gpa = general_purpose_allocator.allocator();\n\nvar emu = chipz.ChipZ.init(gpa);\nemu.load_program(buffer);\n\nwhile (true): {\n    if (emu.cycle()) {} else |_| {\n        @panic(\"Faulting instruction\");\n    }\n    if (emu.flags.display_update) {\n        // refresh display according to the content of emu.display\n    }\n}\n\n----\n\n=== Building the main program\n\nThe ChipZ emulator relies on SDL2. You need to have the SDL2 library available in your system library path to build and run it.\n\nIt has been tested on windows and macOS(arm) successfully so far, but should work with linux too.\n\n=== Running the tests\n\nThere are a few tests. `zig build test` will run them.\n\n== Using the emulator\n\nTo use the emulator, run \"chipz.exe\" and pass the rom path as a parameter (i.e `chipz.exe my_path/to/my/rom.ch8`).\n\nThe Chip 8 \"COSMAC VIP\" keyboard is mapped like this: \n\n.keys\n[width=\"40%\"]\n|=============\n|1\t|2\t|3\t|4\n|Q\t|W\t|E\t|R\n|A\t|S\t|D\t|F\n|Z\t|X\t|C\t|V\n|=============\n\nKeyboard scancodes are used so any non-qwerty keyboard should have the same mapping.\n\nSound isn't managed and won't be implemented.\n\nPressing the UP or DOWN key allows to resize the window.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArwalk%2FChipZ","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArwalk%2FChipZ","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArwalk%2FChipZ/lists"}