{"id":15060432,"url":"https://github.com/johnearnest/c-octo","last_synced_at":"2025-04-10T05:50:50.790Z","repository":{"id":43078764,"uuid":"320065759","full_name":"JohnEarnest/c-octo","owner":"JohnEarnest","description":"A C rewrite of the Octo CHIP-8 IDE","archived":false,"fork":false,"pushed_at":"2023-08-22T14:21:22.000Z","size":1313,"stargazers_count":93,"open_issues_count":2,"forks_count":9,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-24T07:04:16.444Z","etag":null,"topics":["assembly-language","chip8","fantasy-console","ide"],"latest_commit_sha":null,"homepage":"","language":"Roff","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/JohnEarnest.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2020-12-09T20:00:57.000Z","updated_at":"2025-03-04T07:45:25.000Z","dependencies_parsed_at":"2025-02-16T19:43:14.422Z","dependency_job_id":null,"html_url":"https://github.com/JohnEarnest/c-octo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnEarnest%2Fc-octo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnEarnest%2Fc-octo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnEarnest%2Fc-octo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnEarnest%2Fc-octo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnEarnest","download_url":"https://codeload.github.com/JohnEarnest/c-octo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166926,"owners_count":21058480,"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":["assembly-language","chip8","fantasy-console","ide"],"created_at":"2024-09-24T22:58:34.688Z","updated_at":"2025-04-10T05:50:50.768Z","avatar_url":"https://github.com/JohnEarnest.png","language":"Roff","funding_links":[],"categories":[],"sub_categories":[],"readme":"C-Octo\n======\n![Octode Demo](docs/images/octode_demo.gif)\n\nThis project is a rewrite of the web-based [Octo](https://github.com/JohnEarnest/Octo) CHIP-8 development toolkit in C. This port can run on a wide variety of older or lower-powered devices which would struggle with a modern web browser. C-Octo also provides an enhanced CLI and offline experience for those who prefer to use an external text editor.\n\nThe C-Octo suite includes `octo-cli`, a command-line compiler, `octo-run`, a minimal runtime and debugger that can be executed from the command-line, `octo-de`, a self-contained \"Fantasy Console\"-style programming environment, and several reusable libraries. Why not give Octo a spin on the _PocketCHIP_ gathering dust in your closet?\n\nProject Structure\n-----------------\nC-Octo is split into several files by function:\n\n- `octo_compiler.h`: a freestanding compiler for [Octo Assembly Language](https://github.com/JohnEarnest/Octo/blob/gh-pages/docs/Manual.md).\n- `octo_emulator.h`: a CHIP-8, SCHIP, and XO-CHIP compatible emulator core which performs no IO.\n- `octo_cartridge.h`: routines for reading and producing \"Octocarts\", which encode both an Octo program and configuration metadata into a GIF image.\n- `octo_util.h`: assorted support routines shared by `octo_run.c` and `octo_de.c`.\n- `octo_cli.c`: a minimal interface for the Octo compiler which depends only upon the C standard library and `\u003csys/stat.h\u003e`.\n- `octo_run.c`: a minimal graphical frontend for the Octo emulator and compiler which depends on SDL2.\n- `octo_de.c`: a richer graphical frontend including a text editor, sprite editor, and other conveniences.\n\nInstallation\n------------\nTo build from source you will need a C compiler and (probably) [SDL2](https://www.libsdl.org/index.php). The provided Makefile will build everything, attempt to copy binaries to `/usr/local/bin/`, and create a configuration `.octo.rc` file in your home directory.\n\nFor detailed information about building and installing on different platforms, see the [Build Guide](docs/BuildGuide.md).\n\nOcto-CLI\n--------\n```\n$octo-cli\nusage: ./octo-cli \u003csource\u003e [\u003cdestination\u003e] [-s \u003csymfile\u003e]\n```\nThe `source` file may be a `.8o` source file or a `.gif` octocart. If the `destination` has a `.ch8` extension, a CHIP-8 binary will be produced. If the destination has a `.gif` extension, an octocart will be produced. If the `destination` has a `.8o` extension, the source text of an input octocart will be extracted. If no destination is specified, the resultant `.ch8` binary will be piped to _stdout_.\n\nif the `-s` flag is provided, the compiler will write out a CSV file containing all the _symbols_ defined in the input program: breakpoints, constants (including labels), aliases, and monitors, for use with external debugging tools. For example:\n\n```\n$ cat symdemo.8o\n:monitor v6 8\n: main\n\t:alias acc v2\n\tacc += 1\n\t:breakpoint \"wait, then go\"\n\tacc := 0\n\n$ octo-cli symdemo.8o temp.ch8 -s syms.csv \u0026\u0026 cat syms.csv\ntype,name,value\nbreakpoint,\"wait, then go\",514\nconstant,main,512\nalias,unpack-hi,0\nalias,unpack-lo,1\nalias,acc,2\nmonitor,v6,8\n```\n\nThe `make testcli` target will run a series of integration tests for this tool.\n\nOcto-Run\n--------\n```\n$octo-run\nocto-run v1.0\nusage: ./octo-run \u003csource\u003e [-c \u003cpath\u003e]\nwhere \u003csource\u003e is a .ch8 or .8o\n```\nOcto-run will execute a `.ch8` binary or compile and run an Octo program. While executing, the same basic debugging features are available as in web-octo: `i` toggles a user interrupt and the display of the register file, `o` single-steps while interrupted, and `m` toggles the display of memory monitors, if any are registered. Command-F or Ctrl-F toggle fullscreen mode and Escape or backtick quit.\n\nIf provided, the `-c` flag may be used to indicate a configuration file which should override the global `.octo.rc` file. This makes it easier to configure colors, speed, and other options for an individual program while working on multiple projects.\n\nIf a gamepad is detected, axes will be mapped to mirror `A`,`S`,`W`, and `D` on the keyboard and buttons will similarly be mapped to `E` and `Q`.\n\nOctode\n------\n```\n$octo-de\n```\nOctode includes a text editor, sprite editor, palette editor, and a runtime/debugger identical to `octo-run`. With the exception of the sprite editor, the user interface can be controlled entirely via the keyboard, and should work equally well with a mouse or touchscreen. For detailed information about Octode, see the [Octode User Guide](docs/OctodeUserGuide.md).\n\nConfiguration File\n------------------\nOcto-run and Octode look for a file named `.octo.rc` in the user's home directory. If present, it can be used to configure a variety of useful settings for the tools. The file has a traditional `.INI` structure- empty lines or lines beginning with `#` are ignored, and anything else consists of a key and value separated by `=`. Meaningful keys are as follows:\n\n- `ui.windowed`: if `1`, the tool runs in a window. If `0`, it will attempt to run in fullscreen.\n- `ui.software_render`: if `1`, prefer a software renderer over hardware-acceleration. On some low-power devices, \"accelerated\" mode is unusably slow!\n- `ui.win_scale`: if greater than `1`, scale up the \"logical\" window dimensions by an integer factor.\n- `ui.win_width`: horizontal size in pixels when in windowed mode.\n- `ui.win_height`: vertical size in pixels when in windowed mode.\n- `ui.volume`: volume of XO-CHIP sound (0-127). A value of `0` will disable audio entirely.\n\n- `core.tickrate`: number of CHIP-8 instructions to execute per 60hz frame.\n- `core.max_rom`: the maximum number of bytes the compiler will permit when assembling a ROM.\n- `core.rotation`: one of {`0`, `90`, `180`, `270`} to rotate the CHIP-8 display. Does not impact the rest of the UI.\n- `core.font`: one of {`octo`, `vip`, `dream_6800`, `eti_660`, `schip`, `fish`} to select the built-in CHIP-8 font.\n\n- `color.plane0`, `color.plane1`, `color.plane2`, `color.plane3`: colors for the 4 XO-CHIP \"plane\" colors.\n- `color.background`: the border drawn behind the CHIP-8 display when no sound is being played.\n- `color.sound`: the alternate border color when sound is being played.\n\n- `quirks.shift`: if `1`, `vx \u003c\u003c= vy` and `vx \u003e\u003e= vy` modify `vx` in place and ignore `vy`, like SCHIP.\n- `quirks.loadstore`: if `1`, `load` and `store` do not post-increment `i`, like SCHIP.\n- `quirks.jump0`: if `1`, emulate a buggy behavior of SCHIP on the HP-48: the 4 high bits of the target address of `jump0` determines the offset register used (instead of always `v0`).\n- `quirks.logic`: if `1`, clear `vf` after `\u0026=`,`|=` and `^=`. On the VIP, these instructions leave `vf` in an unknown state.\n- `quirks.clip`: if `1`, do not \"wrap\" sprite drawing around the edges of the display.\n- `quirks.vblank`: if `1`, drawing a sprite will block until the end of the 60hz frame, like the VIP.\n\nAll colors are specified as 6-digit RGB in hexadecimal, like `996600`. The default quirks settings, palette, and other options correspond to those of web-octo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnearnest%2Fc-octo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnearnest%2Fc-octo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnearnest%2Fc-octo/lists"}