{"id":19154992,"url":"https://github.com/rkdud007/solchip8","last_synced_at":"2025-05-07T06:32:02.954Z","repository":{"id":259933769,"uuid":"879754044","full_name":"rkdud007/solchip8","owner":"rkdud007","description":"SolChip8 is the first 100% on-chain Chip8 emulator smart contract where you can run chip8 games on EVM","archived":false,"fork":false,"pushed_at":"2024-11-17T05:08:35.000Z","size":27673,"stargazers_count":32,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T19:35:04.265Z","etag":null,"topics":["chip8","emulation","emulator","smart-contracts","solidity"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/rkdud007.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null}},"created_at":"2024-10-28T13:46:54.000Z","updated_at":"2025-04-04T15:27:44.000Z","dependencies_parsed_at":"2025-04-19T17:44:30.312Z","dependency_job_id":null,"html_url":"https://github.com/rkdud007/solchip8","commit_stats":null,"previous_names":["rkdud007/solchip8"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkdud007%2Fsolchip8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkdud007%2Fsolchip8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkdud007%2Fsolchip8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkdud007%2Fsolchip8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkdud007","download_url":"https://codeload.github.com/rkdud007/solchip8/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252826867,"owners_count":21810195,"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":["chip8","emulation","emulator","smart-contracts","solidity"],"created_at":"2024-11-09T08:29:07.476Z","updated_at":"2025-05-07T06:32:02.935Z","avatar_url":"https://github.com/rkdud007.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SolChip8\n\n`SolChip8` is the first 100% on-chain [Chip8](https://en.wikipedia.org/wiki/CHIP-8) emulator smart contract where you can run chip8 games on EVM environment. CHIP-8 is an interpreted programming language, initially used on the 8-bit microcomputers made in the mid-1970s. [blog post](https://www.piapark.me/chip-8-emulation-on-evm/)\n\n![SolChip](./.github/solchip.gif)\n\n### Installation\n\n```\nforge install rkdud007/solchip8\n```\n\n### Deployment \n\n- unified contract address start with `0xc8c8c8c8` to represent chip8 by using CREATE2 contract using [`create2deploy` cli tool](https://github.com/rkdud007/create2deploy)\n\n```console\n❯ cast create2 \\\n    --deployer 0x0000000000FFe8B47B3e2130213B802212439497 \\\n    --caller 0x0000000000000000000000000000000000000000 \\\n    --init-code-hash 614b9ac9323beeaffd9de369597fc476014aee6e350489c0601b5f47b1146334 \\\n    --starts-with c8c8c8c8\n```\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eChain\u003c/th\u003e\n            \u003cth\u003eChain ID\u003c/th\u003e\n            \u003cth\u003eContract\u003c/th\u003e\n            \u003cth\u003ev0.0.1\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=\"1\"\u003eBase mainnet\u003c/td\u003e\n            \u003ctd rowspan=\"1\"\u003e8453\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://github.com/rkdud007/solchip8/blob/3382502e44f840b2d974570b93913e18f761cc0e/src/Solchip8.sol\"\u003eSolchip8\u003c/a\u003e\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://base.blockscout.com/address/0xc8c8c8c8421e85597881ae753d040449e81e528a\"\u003e0xc8c8c8c8421e85597881ae753d040449e81e528a\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=\"1\"\u003eEthereum sepolia\u003c/td\u003e\n            \u003ctd rowspan=\"1\"\u003e11155111\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://github.com/rkdud007/solchip8/blob/3382502e44f840b2d974570b93913e18f761cc0e/src/Solchip8.sol\"\u003eSolchip8\u003c/a\u003e\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://sepolia.etherscan.io/address/0xc8c8c8c8421e85597881ae753d040449e81e528a\"\u003e0xc8c8c8c8421e85597881ae753d040449e81e528a\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n         \u003ctr\u003e\n            \u003ctd rowspan=\"1\"\u003eArbitrum sepolia\u003c/td\u003e\n            \u003ctd rowspan=\"1\"\u003e421614\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://github.com/rkdud007/solchip8/blob/3382502e44f840b2d974570b93913e18f761cc0e/src/Solchip8.sol\"\u003eSolchip8\u003c/a\u003e\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://sepolia.arbiscan.io/address/0xc8c8c8c8421e85597881ae753d040449e81e528a\"\u003e0xc8c8c8c8421e85597881ae753d040449e81e528a\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=\"1\"\u003eBase sepolia\u003c/td\u003e\n            \u003ctd rowspan=\"1\"\u003e84532\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://github.com/rkdud007/solchip8/blob/3382502e44f840b2d974570b93913e18f761cc0e/src/Solchip8.sol\"\u003eSolchip8\u003c/a\u003e\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://sepolia-explorer.base.org/address/0xc8c8c8c8421e85597881ae753d040449e81e528a\"\u003e0xc8c8c8c8421e85597881ae753d040449e81e528a\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n         \u003ctr\u003e\n            \u003ctd rowspan=\"1\"\u003eOptimism sepolia\u003c/td\u003e\n            \u003ctd rowspan=\"1\"\u003e11155420\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://github.com/rkdud007/solchip8/blob/3382502e44f840b2d974570b93913e18f761cc0e/src/Solchip8.sol\"\u003eSolchip8\u003c/a\u003e\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://sepolia-optimism.etherscan.io/address/0xc8c8c8c8421e85597881ae753d040449e81e528a\"\u003e0xc8c8c8c8421e85597881ae753d040449e81e528a\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd rowspan=\"1\"\u003eOdyssey testnet\u003c/td\u003e\n            \u003ctd rowspan=\"1\"\u003e911867\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://github.com/rkdud007/solchip8/blob/3382502e44f840b2d974570b93913e18f761cc0e/src/Solchip8.sol\"\u003eSolchip8\u003c/a\u003e\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e\u003ca href=\"https://odyssey-explorer.ithaca.xyz/address/0xc8c8c8c81fd75f59103ded843a1082ce403885f4\"\u003e0xc8c8c8c81fd75f59103ded843a1082ce403885f4\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003ctable\u003e\n\n\n### Features\n\n- A 64x32 monochrome display\n- Sixteen 8-bit general purpose registers\n- 4096 bytes of RAM\n- Example [ROM games](./c8games/) from [Chip-8 Games Pack](https://www.zophar.net/pdroms/chip8/chip-8-games-pack.html)\n- Run demo with [desktop](./desktop/)\n\n\n### **Supported CHIP-8 Opcodes**\n\nTested [here](./test/Solchip8.t.sol)\n\n| Opcode | Mnemonic          | Description                                                         |\n| ------ | ----------------- | ------------------------------------------------------------------- |\n| 0000   | **NOP**           | Nothing                                                             |\n| 00E0   | **CLS**           | Clear the display                                                   |\n| 00EE   | **RET**           | Return from a subroutine                                            |\n| 1NNN   | **JP NNN**        | Jump to address `NNN`                                               |\n| 2NNN   | **CALL NNN**      | Call subroutine at `NNN`                                            |\n| 3XNN   | **SE Vx, NN**     | Skip next instruction if `Vx` equals `NN`                           |\n| 4XNN   | **SNE Vx, NN**    | Skip next instruction if `Vx` does not equal `NN`                   |\n| 5XY0   | **SE Vx, Vy**     | Skip next instruction if `Vx` equals `Vy`                           |\n| 6XNN   | **LD Vx, NN**     | Load value `NN` into register `Vx`                                  |\n| 7XNN   | **ADD Vx, NN**    | Add value `NN` to register `Vx`                                     |\n| 8XY0   | **LD Vx, Vy**     | Set `Vx` equal to `Vy`                                              |\n| 8XY1   | **OR Vx, Vy**     | Set `Vx` to `Vx` OR `Vy`                                            |\n| 8XY2   | **AND Vx, Vy**    | Set `Vx` to `Vx` AND `Vy`                                           |\n| 8XY3   | **XOR Vx, Vy**    | Set `Vx` to `Vx` XOR `Vy`                                           |\n| 8XY4   | **ADD Vx, Vy**    | Add `Vy` to `Vx`, set VF to carry                                   |\n| 8XY5   | **SUB Vx, Vy**    | Subtract `Vy` from `Vx`, set VF to NOT borrow                       |\n| 8XY6   | **SHR Vx**        | Shift `Vx` right by 1, set VF to least significant bit              |\n| 8XY7   | **SUBN Vx, Vy**   | Set `Vx` to `Vy` minus `Vx`, set VF to NOT borrow                   |\n| 8XYE   | **SHL Vx**        | Shift `Vx` left by 1, set VF to most significant bit                |\n| 9XY0   | **SNE Vx, Vy**    | Skip next instruction if `Vx` does not equal `Vy`                   |\n| ANNN   | **LD I, NNN**     | Set `I` to address `NNN`                                            |\n| BNNN   | **JP V0, NNN**    | Jump to address `V0 + NNN`                                          |\n| CXNN   | **RND Vx, NN**    | Set `Vx` to random byte AND `NN`                                    |\n| DXYN   | **DRW Vx, Vy, N** | Draw sprite at (`Vx`, `Vy`) with height `N`, set VF on collision    |\n| EX9E   | **SKP Vx**        | Skip next instruction if key `Vx` is pressed                        |\n| EXA1   | **SKNP Vx**       | Skip next instruction if key `Vx` is not pressed                    |\n| FX07   | **LD Vx, DT**     | Set `Vx` to the value of the delay timer                            |\n| FX0A   | **LD Vx, K**      | Wait for a key press, store the value in `Vx`                       |\n| FX15   | **LD DT, Vx**     | Set the delay timer to `Vx`                                         |\n| FX18   | **LD ST, Vx**     | Set the sound timer to `Vx`                                         |\n| FX1E   | **ADD I, Vx**     | Add `Vx` to `I`                                                     |\n| FX29   | **LD F, Vx**      | Set `I` to the location of the sprite for digit `Vx`                |\n| FX33   | **LD B, Vx**      | Store BCD representation of `Vx` in memory at `I`, `I+1`, and `I+2` |\n| FX55   | **LD [I], Vx**    | Store registers `V0` to `Vx` in memory starting at `I`              |\n| FX65   | **LD Vx, [I]**    | Read registers `V0` to `Vx` from memory starting at `I`             |\n\n### Resources\n\n- [chip8](http://devernay.free.fr/hacks/chip8/C8TECH10.HTM#8xy3)\n- [An Introduction to Chip-8 Emulation using the Rust Programming Language](https://aquova.net/chip8/chip8.pdf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkdud007%2Fsolchip8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkdud007%2Fsolchip8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkdud007%2Fsolchip8/lists"}