Demake: Building Retro ROMs from a Single Source
Writing code for retro hardware usually means fighting with archaic memory constraints, bizarre color palettes, and resolution limits that vary wildly between a Game Boy and a NES. Demake solves this by acting as a compilation layer that allows one source project to target multiple retro game console ROMs without rewriting the core logic for every single piece of hardware.
The project actually evolved from a very specific pain point regarding generative AI. While LLMs and image generators are great at creating "retro-style" sprites, they are notoriously bad at adhering to strict hardware constraints. They might give you a sprite that looks 8-bit, but it will often use colors or pixel dimensions that the actual hardware cannot render. By building a tool that understands these constraints, it becomes possible to bridge the gap between AI-generated assets and actual playable ROMs.
The engine relies on a custom declarative language called Demotic. Instead of getting bogged down in the implementation details of a specific CPU or GPU architecture, you describe the game logic and layout using a high-level syntax. To handle the different screen sizes and aspect ratios of various handhelds and consoles, Demotic implements relative units similar to modern CSS:
- vw / vh: Viewport width and height
- vmin / vmax: The minimum or maximum of the two viewport dimensions
For those looking to integrate this into a development pipeline, there are three ways to interact with the tool: a web-based UI for quick prototyping, a CLI for power users, and an NPM package for those integrating it into a JS-based AI workflow.
If you are trying to build a project from scratch using retro constraints, this approach is significantly faster than learning the assembly language of five different consoles. You can focus on the prompt engineering for your assets and the game logic in Demotic, then let the compiler handle the deployment to the specific ROM format. It effectively treats retro hardware as a deployment target rather than a coding restriction.
Since it is still a work in progress, the current focus is on expanding the list of supported consoles and refining the Demotic language to be even more concise. For anyone interested in LLM agents that can generate actual playable games, this kind of middleware is exactly what is needed to make those agents useful in a real-world production environment.
All Replies (3)
Want a live back-and-forth? Join the global AI chat room — login to talk.
Curious how this handles audio chip constraints across platforms. Does it automate that or is it manual?