{"id":15049225,"url":"https://github.com/permutationlock/dumb_cycle","last_synced_at":"2026-01-02T00:13:48.575Z","repository":{"id":231710989,"uuid":"781666486","full_name":"permutationlock/dumb_cycle","owner":"permutationlock","description":"A snake game for x86_64-linux written in C99 with no preprocessor or libraries.","archived":false,"fork":false,"pushed_at":"2024-04-09T07:43:12.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T20:40:56.662Z","etag":null,"topics":["assembly","c99","linux","qbe","x86-64"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/permutationlock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-04-03T20:14:25.000Z","updated_at":"2024-04-09T07:57:43.000Z","dependencies_parsed_at":"2024-10-12T17:20:29.931Z","dependency_job_id":null,"html_url":"https://github.com/permutationlock/dumb_cycle","commit_stats":null,"previous_names":["permutationlock/dumb_cycle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutationlock%2Fdumb_cycle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutationlock%2Fdumb_cycle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutationlock%2Fdumb_cycle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutationlock%2Fdumb_cycle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/permutationlock","download_url":"https://codeload.github.com/permutationlock/dumb_cycle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243505960,"owners_count":20301619,"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","c99","linux","qbe","x86-64"],"created_at":"2024-09-24T21:19:10.534Z","updated_at":"2026-01-02T00:13:48.551Z","avatar_url":"https://github.com/permutationlock.png","language":"C","readme":"# DumbCycle\n\nA simple Snake/LightCycle game for `x86_64` Linux implemented in\nassembly and C99 with no linked libraries (no libc) and no preprocessor\ndirectives (no `#ifdef`,  `#define`, `#include`, etc).\n\nImages are drawn to the screen using the \"dumb buffer\" API provided by the\nDirect Rendering Manager (DRM) subsystem of Linux. Keyboard input is read\ndirectly from a keyboard device file. DumbCycle should run on any `x86_64`\nLinux system with DRM support, a video card, and a keyboard[^1]. \n\nDumbCycle can be compiled with any C compiler that supports C99 and ATT\nsyntax `x86_64` assembly. The primary motivation for eschewing the C\npreprocessor is to allow the project to compile using only\n[cproc-qbe][1], [QBE][2], and [GNU binutils][3] (for `as` and `ld`).\nPassing the game code through cproc and QBE results just over 2000\nlines of simple and readable `x86_64` assembly.\n\n## Building and running\n\nRun the game by executing `make run` (or `make run_cproc`) with the required\npermissions[^1]. You can also run `make` and `./dumb_cycle`, but `make run`\nalso executes `clear` to automatically restore terminal when the game exits.\n\n## Playing\n\nSteer with WASD and avoid the walls. Press ESC to exit.\n\n## References\n\n - [musl libc][4]\n - [libdrm][5]\n - [linux kernel][6]\n - [drm\\_howto][7]\n\n [^1]: The executable must have permissions to open the video device\n    `/dev/dri/card0` and the input devices in `/dev/input/`.\n    No other programs should be drawing to `/dev/dri/card0`, i.e.\n    you need to close your X11 and/or Wayland server.\n\n[1]: https://sr.ht/~mcf/cproc/\n[2]: https://c9x.me/compile/\n[3]: https://sourceware.org/binutils/\n[4]: https://musl-libc.org\n[5]: https://gitlab.freedesktop.org/mesa/drm\n[6]: https://github.com/torvalds/linux\n[7]: https://github.com/dranger003/drm-howto\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutationlock%2Fdumb_cycle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermutationlock%2Fdumb_cycle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutationlock%2Fdumb_cycle/lists"}