Port a 90s DOS demoscene intro to JavaScript from its assembly

Kévin Drapel had Codex on its cheapest plan translate the 1997 64k intro Gamma by MFX from x86 assembly into a browser JavaScript player, checked against a Unicorn-based oracle.

Done withCodex· Oct 30, 2026

What they did

Drapel, who has ported several old demoscene productions, picked Gamma, a 1997 64k intro by the Finnish group MFX that uses the FPU for real-time raytracing. He first had an AI tool add an autocapture mode to DOSBox that saves a screenshot, CPU and FPU registers, VGA state and a full memory dump every second; that gave 142 checkpoints. He disassembled a memory dump in IDA Free instead of unpacking the compressed executable. Codex, running Sol 6.1 at low reasoning on the cheapest subscription, then built an oracle in Unicorn that runs original routines and compares them with their JavaScript versions, and translated function after function. He set a long /goal asking for a standalone browser player with the original visuals, music and scene order, backed by differential tests, and steered it by asking for a playable build of each translated scene.

How it went

In about 13 minutes Codex had a first set of oracle functions and around a dozen unit tests. Pointing it at the oracle from his earlier port of the intro Bjoer let it reuse the x87 restoration code; the new ray setup tests then passed all 12 cases, and the agent eventually rendered a scene that matched frames of the original. Early player builds still crashed on unhandled intersection blocks. The article walks through one iteration rather than reporting a finished port or total cost.

Worth knowing

Drapel found local Qwen models and GLM Flash misread stack handling and x86 flags and kept reasoning confidently from the wrong processor state, so he used them only to run tests. Reusing an oracle from a previous port saves the most time, and progress counts like functions ported are less useful than a build you can watch.

Try it

With Codex· 7 parts to fill in

Port [program name], an old [DOS or other platform] executable, to a JavaScript browser player. You have a disassembly in [folder] and emulator captures (registers, memory dumps, screenshots) taken every [interval] in [folder]. First build an oracle with [Unicorn or another CPU emulator] that runs original routines from the dumps so each JavaScript function can be checked against them. Then translate one routine at a time and add a differential test for each. Reuse what you can from [path to an earlier port's oracle]. Do not fake effects or play back recorded frames. After each scene works, give me a playable browser build so I can compare it with the original, and stop and ask before starting the next scene.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related