{"slug": "make-ps2-games-with-one-prompt", "title": "Make PS2 games with one prompt", "summary": "A new open-source project, PS2-Forge, enables developers and AI agents to create PlayStation 2 games using a single C file and a minimal engine. The toolchain compiles genuine MIPS R5900 executables that run on real PS2 hardware or the Play! emulator, with a built-in testing and preview system. The project aims to simplify PS2 homebrew development and make it accessible to AI agents.", "body_md": "**Build PlayStation 2 games in one C file.** Tiny, readable C. One header,\n~20 core functions, **2D and 3D**. The entire engine fits on a single page\n([ AGENTS.md](/Ijtihed/ps2-forge/blob/main/AGENTS.md)), so an AI agent (or you) can write, build, and run a\nreal PS2 game from one read. Builds with the open\n\n`ps2dev`\n\ntoolchain; runs in the\n**Play!** emulator (no BIOS needed) and on\n\n**real PS2 hardware**.\n\n*a 60fps 3D cellular automaton, running on a PlayStation 2*\n\nCyclic CA |\nReaction-diffusion |\nPhysarum (slime mold) |\nMulti-neighborhood CA |\nGray-Scott coral |\n3D cellular automaton |\n\nSix of the sixteen systems in the showcase app\n( emergent-systems-ps2),\nall real PS2 output.\n\n```\n#include \"engine.h\"\ntypedef struct { int x, y; } Game;\n\nstatic void init  (void *s, Ctx *c){ Game *g=s; g->x=160; g->y=120; }\nstatic void update(void *s, Ctx *c){ Game *g=s; if (ctx_is_held(c,BTN_LEFT)) g->x--; }\nstatic void render(void *s, Ctx *c){ Game *g=s; e_rect(c, g->x,g->y, 12,12, 255,90,90); }\n\nint main(void){\n    static Game g;\n    Scene sc = { .state=&g, .init=init, .update=update, .render=render };\n    app_run(config_default(), &sc);     /* engine owns the loop, GS, pad, timing */\n}\n```\n\n3D is three calls:\n\n```\ne3d_begin(c, yaw, pitch);\nfor (...) e3d_voxel(x,y,z, r,g,b);\ne3d_end(c);\n```\n\n**1. Toolchain (one time, no sudo):**\n\n```\ntools/bootstrap.sh        # downloads the prebuilt ps2dev toolchain\n```\n\nExport the `PS2DEV`\n\n/ `PS2SDK`\n\n/ `GSKIT`\n\n+ `PATH`\n\nlines it prints.\n\n**2. Make your game:**\n\n```\ncp -r examples/template mygame\ncd mygame\n# edit game.c   (optional: rename the output .elf via EE_BIN in the Makefile)\n```\n\n**3. Build, run, test:**\n\n``` php\nmake          # -> game.elf   (a genuine MIPS R5900 / Emotion Engine executable)\nmake run      # boot it in the Play! emulator\nmake test     # build -> boot headless -> prints \"RENDER: PASS|FAIL\" + exit code\n```\n\n**4. Play it for real:** copy `game.elf`\n\nto a USB stick / memory card and launch\nit on a PlayStation 2 via FMCB or wLaunchELF.\n\nExamples: [ examples/template](/Ijtihed/ps2-forge/blob/main/examples/template) (2D),\n\n[(3D),](/Ijtihed/ps2-forge/blob/main/examples/spin3d)\n\n`examples/spin3d`\n\n[(Game of Life, the](/Ijtihed/ps2-forge/blob/main/examples/life)\n\n`examples/life`\n\n`e_image_draw`\n\ngrid pattern),\n[(a ported JS game).](/Ijtihed/ps2-forge/blob/main/examples/jsport)\n\n`examples/jsport`\n\nDon't want to think about `make`\n\n? Use the bundled `forge`\n\nCLI:\n\n```\n./forge doctor          # check your toolchain is ready\n./forge new mygame      # scaffold a new game in ./mygame\n./forge build           # compile the game in this folder -> .elf\n./forge run             # build + boot it in the emulator\n./forge test            # build + boot headless + print RENDER: PASS/FAIL\n./forge play spin3d     # build + run a bundled example\n./forge gui             # open a web dashboard to browse + preview games\n```\n\n`forge gui`\n\nserves a local dashboard ([http://localhost:8090](http://localhost:8090)) that lists every\nexample and, on click, **builds it, boots it headless, and shows the actual\nrendered PS2 frame** plus a PASS/FAIL verdict. The fastest way to see what the\nengine does. (The headless preview/test needs `Play!`\n\n, `Xvfb`\n\n, and a Python with\n`mss`\n\n+ `Pillow`\n\n; on a remote box, tunnel the port: `ssh -L 8090:localhost:8090 <host>`\n\n.)\n\n**2D:** filled rects, an alpha-tested font atlas (`e_text`\n\n), rotated quads,\ntextured sprites, a dynamic framebuffer blit (`e_image_draw`\n\n, for cellular\nautomata / software renderers), and a hardware scissor.\n**3D:** a software voxel renderer (`e3d_*`\n\n), depth-sorted, one blit, 60fps.\nPlus D-pad/button input and ADPCM sound effects.\n\nFull API + conventions on one page: .\n\n`AGENTS.md`\n\n**One contract.** is the complete API, build, run, and conventions. An agent reads it, copies`AGENTS.md`\n\n`examples/template`\n\n, and emits a game.**A skill.** scaffolds, builds, and verifies a game.`skills/make-ps2-game`\n\n**A built-in verdict loop.**`make test`\n\nbuilds the ELF, boots it headless, and prints`RENDER: PASS/FAIL`\n\n, so the loop is**edit, one command, verdict**, no eyeballing.\n\nMost agent-made games are HTML5-canvas or p5.js. Include\n[ engine/canvas.h](/Ijtihed/ps2-forge/blob/main/engine/canvas.h) and the calls line up nearly 1:1:\n\n```\ncv_fill(90,200,255); cv_rect(x,y,8,8);   // ctx.fillStyle + ctx.fillRect\ncv_text(8,8,\"SCORE\");                     // ctx.fillText\nif (cv_key(BTN_LEFT)) x--;                // keyIsDown(LEFT_ARROW)\n```\n\nFull mapping table + a worked example: [ PORTING.md](/Ijtihed/ps2-forge/blob/main/PORTING.md) and the\n\n`port-js-to-ps2`\n\nskill.[emergent-systems-ps2](https://github.com/Ijtihed/emergent-systems-ps2): sixteen\ncellular automata / emergent systems (the GIFs above), including a 60fps 3D one,\nrunning on real PS2 hardware.\n\nPRs welcome. See [ CONTRIBUTING.md](/Ijtihed/ps2-forge/blob/main/CONTRIBUTING.md) for the build setup, the\none-file-game convention, the\n\n`make test`\n\nverdict, and code style (notably: no em\ndashes). CI builds every example on each push.Engine code: MIT. Built on [PS2SDK](https://github.com/ps2dev/ps2sdk) and\n[gsKit](https://github.com/ps2dev/gsKit) (ps2dev): their licenses apply to them.", "url": "https://wpnews.pro/news/make-ps2-games-with-one-prompt", "canonical_source": "https://github.com/Ijtihed/ps2-forge", "published_at": "2026-06-26 15:45:42+00:00", "updated_at": "2026-06-26 16:05:11.787329+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "generative-ai"], "entities": ["PS2-Forge", "PlayStation 2", "Play!", "ps2dev", "FMCB", "wLaunchELF"], "alternates": {"html": "https://wpnews.pro/news/make-ps2-games-with-one-prompt", "markdown": "https://wpnews.pro/news/make-ps2-games-with-one-prompt.md", "text": "https://wpnews.pro/news/make-ps2-games-with-one-prompt.txt", "jsonld": "https://wpnews.pro/news/make-ps2-games-with-one-prompt.jsonld"}}