{"id":17672111,"url":"https://github.com/gmorales08/chip8emu","last_synced_at":"2025-03-30T15:24:41.703Z","repository":{"id":257098951,"uuid":"856326190","full_name":"gmorales08/chip8emu","owner":"gmorales08","description":"A CHIP-8 interpreter written in C++11 ","archived":false,"fork":false,"pushed_at":"2024-11-12T18:14:08.000Z","size":170,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T16:49:31.012Z","etag":null,"topics":["chip-8","chip8","chip8-emulator","cpp","cpp11","emulation","emulator","sdl2"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmorales08.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}},"created_at":"2024-09-12T11:47:58.000Z","updated_at":"2024-11-12T20:51:45.000Z","dependencies_parsed_at":"2024-10-24T06:20:49.863Z","dependency_job_id":"d7bb6886-44ac-43b9-bea6-e4b18ef51e26","html_url":"https://github.com/gmorales08/chip8emu","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"5ffb6b16adc594972a4d4df4b812a0baa1470531"},"previous_names":["gmorales08/chip8emu"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmorales08%2Fchip8emu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmorales08%2Fchip8emu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmorales08%2Fchip8emu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmorales08%2Fchip8emu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmorales08","download_url":"https://codeload.github.com/gmorales08/chip8emu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246336079,"owners_count":20760981,"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","chip8-emulator","cpp","cpp11","emulation","emulator","sdl2"],"created_at":"2024-10-24T04:06:58.846Z","updated_at":"2025-03-30T15:24:41.684Z","avatar_url":"https://github.com/gmorales08.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chip8emu\nThis is an interpreter for the CHIP-8 programming language. It aims to simulate the operation of a physical machine while abstracting some low-level concepts.\n\n\u003e For a CHIP-8 overview check [this document](./doc/chip8.md)\n\nThe project is organized into the following concepts: \n\n![machineDiagram](doc/img/machineStructure.svg)\n\n* **Machine**: Simulates a computer where the interpreter runs. It has a chip with the fontset, which is loaded into main memory during startup via the bus. The fontset used is the same as the one in the COSMAC VIP.\n\n* **CHIP-8/CPU**: The core of the interpreter. It contains the registers, timers and the stack.\n\n* **Main memory**: 4KB of memory that stores the font and the program data.\n\n* **Auxiliary memory**: Memory that stores the machine status flag, the status of the keys in two 8-bit registers, and the status of the display.\n\n* **Bus**: The bus is accessed directly by the CPU, the fontset chip, the keyboard controller, the display controller, and the sound controller. It handles reading and writing data to memory.\n\n* **Display**: The display controller checks the [machine status register](#machine-status-register) at 60 Hz. If the display flag is set, the display controller reads the display memory through the bus and output its bytes to the screen.\n\n* **Keyboard**: When needed, the CPU requests a keyboard scan with the control signal. Then, the keyboard controller reads the status of the keys and updates the [IO registers](#io-registers) through the bus.\n\n* **Sound**: The CPU has a sound timer that when is equal to 0, the sound controller must emit a fixed-frecuency tone. The sound controller checks the [machine status register](#machine-status-register) to know if it must emit sound. The sound timer is decremented at 60Hz, at the sound controller reads the [machine status register](#machine-status-register) at 60 Hz.\n\nThe **memory addresses** are organized as follows:\n* `0x0000` to `0x004F` are free\n* `0x0050` to `0x01FF` is where the fontset is loaded\n* `0x0200` to `0x0FFF` is where the programs are loaded\n* `0x1000` is the [machine status register](#machine-status-register)\n* `0x1001` and `0x1002` are the [IO registers](#io-registers)\n* `0x1003` to `0x1102` is where the CPU writes the display memory\n\nThe **machine status register** \u003ca id=\"machine-status-register\"\u003e\u003c/a\u003e is a byte that holds information about the current status of the machine:\n\n`\nMachine status register (0x1000): XXXXXX10\n`\n* display flag (bit 1): is set if the display needs to be updated.\n* sound flag (bit 0): is set if the speaker must emit sound.\n* The other bits are unused.\n\nThe **IO registers** \u003ca id=\"io-registers\"\u003e\u003c/a\u003e are two bytes that hold the status of the 16 keyboard keys. Each bit is set when its respective key is pressed.\nThe first register stores the status of the keys 0 to 7 and the second register stores the status of the keys 8 to F.\n\n`IO register 1 (0x1001): 01234567`\n\n`IO register 2 (0x1002): 89ABCDEF`\n\n\u003cbr\u003e\n\n\u003e **Note**: This is my own implementation and may differ from other CHIP-8 interpreters.\n\n## How to build chip8emu\n\nRequirements:\n* Cmake 3.10+\n* SDL2 \n\nIn the root of the project, run:\n```bash\ncmake -B ./build -S .\ncmake --build ./build\nsudo cmake --install build\n```\n\n## How to run games\n\n```bash \nchip8emu gameFile\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmorales08%2Fchip8emu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmorales08%2Fchip8emu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmorales08%2Fchip8emu/lists"}