{"id":33312746,"url":"https://github.com/w84death/cortex-labs-assembly-game","last_synced_at":"2026-06-13T12:31:58.643Z","repository":{"id":297779394,"uuid":"997831883","full_name":"w84death/cortex-labs-assembly-game","owner":"w84death","description":"Cortex Labs - Real-time, puzzle, strategy game for x86 processors made in assembly. MS-DOS.","archived":false,"fork":false,"pushed_at":"2026-05-27T20:40:08.000Z","size":19047,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-27T21:12:46.402Z","etag":null,"topics":["assembly-language","assembly-x86","baremetal","baremetal-programming","floppy","freedos","game","msdos","msdos-game","strategy-game"],"latest_commit_sha":null,"homepage":"","language":"Assembly","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/w84death.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-07T09:27:07.000Z","updated_at":"2026-05-27T20:40:13.000Z","dependencies_parsed_at":"2025-06-28T22:23:11.568Z","dependency_job_id":"c5bd2539-f812-4da8-9af5-af53de11db81","html_url":"https://github.com/w84death/cortex-labs-assembly-game","commit_stats":null,"previous_names":["w84death/game12-asm","w84death/cortex-labs-assembly-game"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/w84death/cortex-labs-assembly-game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w84death%2Fcortex-labs-assembly-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w84death%2Fcortex-labs-assembly-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w84death%2Fcortex-labs-assembly-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w84death%2Fcortex-labs-assembly-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w84death","download_url":"https://codeload.github.com/w84death/cortex-labs-assembly-game/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w84death%2Fcortex-labs-assembly-game/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34285190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","assembly-x86","baremetal","baremetal-programming","floppy","freedos","game","msdos","msdos-game","strategy-game"],"created_at":"2025-11-19T07:04:51.880Z","updated_at":"2026-06-13T12:31:58.638Z","avatar_url":"https://github.com/w84death.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![Cortex Labs](docs/logo.png)\n\nReal-time strategy for x86 processors made in pure assembly. Art made in custom tool (Zig).\n\n# Latest build\n\n* PLAY HERE IN [WEB DOS EMULATOR](https://smol.p1x.in/assembly/game12/game12.html)\n\n# The Game\n\n![Game screen](docs/title-screen.png)\n\n\u003e Cortex Labs is still in development and has no finished gameplay yet. The main goal of the project is to learn x86 assembly, keep the game code within a 16 KB limit, and make it run on bare-metal PCs.\n\nCortex Labs is a strategic resource management game set on the hostile planet Kepler-486i, where you command robotic expeditions to harvest Neurofung - a revolutionary organism that can enhance human cognition and extend life by centuries. Operating from a safe orbital distance, you'll build an automated rail network to extract and transport three vital resources across a challenging 128x128 tile map.\n\nDeploy cargo pods on your expanding railway system, strategically placing switches at junctions to optimize routes between extractors and your main base. Establish stations with specialized buildings - factories to refine resources, laboratories to unlock new technologies. Balance the collection of crystals for construction, veins for fuel, and the precious Neurofung mushrooms that must be carefully managed to avoid depletion.\n\n## Story\n\nEarth’s last unaging generation is dying.\nFor three decades the greatest minds of Cortex Labs have chased a single impossible dream: Neurofung, the wild mushroom that grows only on the surface of Kepler-486i. A single gram extends human cognition and cellular lifespan by centuries. A kilogram could rewrite the future of our species.\n\nYou are Orbital Commander, voice and mind of the automated expedition.\n\nYour mission is to harvest as much Neurofung as possible before the meteorite storm closes in and destroys the return rocket. This is the last chance to secure the precious fungi!\n\nGood luck.\n\n\n## Resources\n\n* *Aetherweave* - delicate, glowing white root-like veins that spread through the upper layers of Kepler-486i’s crust. These organic-mineral hybrids constantly release volatile methane-rich gases. \n\n* *Cryonite* - dense, metallic-blue crystal rock formations embedded in the planet’s ancient basalt plates. Cryonite is incredibly hard yet surprisingly workable once fractured. It serves as the primary structural material for rail tracks, factories, extractors, and base expansions. \n\n* *Neurofung* — the most precious biomass in the known galaxy. Harvest carefully. Over-extraction collapses the fungal network for decades. Under-extraction dooms Earth.\n\n\n## Features\n* VGA 320x200, 16 colors (DawnBringer palette), 256-color mode\n* 2D tile-based, top-down view\n* Full keyboard and mouse support\n* Bare-metal PS/2 mouse driver packed into the boot sector; DOS builds use the system `int 33h` mouse driver\n* 16x16 sprites/tiles (2-bit palette compression, 4 colors + transparency)\n* Procedural map generation (weighted adjacency rules)\n* 128x128 tile map with viewport scrolling\n* Double-buffered framebuffer with partial terrain redraw\n* RLE image compression for pre-rendered backgrounds\n* Sound effects via PC Speaker (IRQ-driven PIT playback)\n* Rail system with automatic track orientation and switch logic\n* Pod (cart) entity system: moving goods on rails, collision handling\n* Base expansion and building placement\n* 8 building types: silos, collector, extractor, refinery, lab, radar, pod factory, power\n* 3 resource types (white, blue, green): extraction, transport, refinement\n* Extractor setup with targeting and resource type selection\n* Fog of war with radar visibility expansion\n* Radar minimap (satellite view)\n* UPX-compressed COM output for DOS\n* Bootable FAT12 floppy image with boot-sector mouse driver for bare-metal runs\n* Development tools (vibe coded C):\n  * png2asm - convert PNG tilemap to 2-bit paletted assembly\n  * rleimg2asm - convert images to RLE-compressed assembly\n  * fnt2asm - convert font charset to 1-bit assembly\n* All game graphics were made with my own tool: **P1Xel Tool**\n  * Source code: https://github.com/w84death/p1xel-tool\n  * Binary included in this repo: `tools/p1xel_tool`\n\n## Tileset\n![Sprites](docs/sprites.png)\n\n## Running\nBoot from a floppy or run from MS-DOS (FreeDOS). The floppy image contains `GAME.COM`, the manual, and a FAT12 boot sector for bare-metal runs. On bare metal, the boot sector installs a tiny PS/2 mouse driver before jumping to the game, so the game can use the same `int 33h` mouse path as it does under DOS.\n\n![Menu screen](docs/screenshot-2.png)\n![Menu screen](docs/screenshot-3.png)\n![Menu screen](docs/screenshot-4.png)\n![Menu screen](docs/screenshot-5.png)\n\n## Building\nUses Zig build system (`build.zig`) with FASM assembler.\n\n### Requirements\n- `zig`\n- `fasm`\n- `upx`\n- `mtools` (`mformat`, `mcopy`, `mdir`) for floppy image creation\n- Optional runners: `qemu-system-i386`, `bochs`\n\nBuild bootable floppy image (default):\n```\nzig build\n```\n\nBuild compressed COM file with UPX:\n```\nzig build com\n```\n\nBuild uncompressed COM file:\n```\nzig build com-raw\n```\n\nRun in QEMU:\n```\nzig build qemu\n```\n\nRun in Bochs:\n```\nzig build bochs\n```\n\nBuild jsdos archive:\n```\nzig build jsdos\n```\n\nBurn floppy image to physical device (`/dev/sdb` in build script):\n```\nzig build burn\n```\n\nDisplay project statistics:\n```\nzig build stats\n```\n\nDisplay opcode usage stats:\n```\nzig build opcodes\n```\n\nBuild release tooling executable:\n```\nzig build tools\n```\n\nDecompress COM file for debugging:\n```\nzig build decompress\n```\n\nTest UPX compression levels:\n```\nzig build test-upx\n```\n\nCheck UPX compression status:\n```\nzig build check-upx\n```\n\nBuild DOSBox portable bundles:\n```\nzig build bundle-windows\nzig build bundle-linux\nzig build bundle\n```\n\nPackage DOSBox release archives:\n```\nzig build package-windows\nzig build package-linux\nzig build package\n```\n\nClean artifacts:\n```\nzig build clean\nzig build clean-tools\n```\n\nShow all available targets:\n```\nzig build help\n```\n\n## DOSBox Releases\n\nPrebuilt DOSBox bundles are published on the GitHub Releases page:\n\nhttps://github.com/w84death/game12-asm/releases\n\nLook for:\n- `Cortex-Labs-windows.zip`\n- `Cortex-Labs-linux.tar.gz`\n\n## Tools\n\n### png2asm\nFor converting .png tilemap into 2-bit compressed and palettes assembly code.\n```./png2asm tileset.png palettes.png ../../src/tiles.asm```\n\n### rleimg2asm\nFor converting .png image into RLE compressed assembly code.\n```./rleimg2asm frames/p1x.png ../../src/rle_p1x.asm -asm p1x_logo_image -stats```\n### fnt2asm\nFor converting .png font charset into 1-bit compressed assembly code.\n```./fnt2asm font.png ../../src/font.asm```\n\n![P1X logo screen](docs/screenshot-0.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw84death%2Fcortex-labs-assembly-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw84death%2Fcortex-labs-assembly-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw84death%2Fcortex-labs-assembly-game/lists"}