RC RANDOM CHAOS

An LLM read 72K lines of 68000 assembly to port a 1993 Iraqi Amiga game to Godot

· via Hacker News

Original source

Porting my 1993 Amiga game to Godot, with an LLM reading the 68000 assembly

Hacker News →

Babylonian Twins was written in 1993 on an Amiga 500 in Baghdad — pure hand-tuned 68000 assembly, bit-banging the hardware directly under sanctions with electricity a few hours a day. Billed as the first commercial game made in Iraq, it was hand-ported once before, in 2010, as a 34,000-line C++ engine for iOS that passed two million downloads. For this third life the original developer didn’t write the port himself; he handed the source to Claude Fable 5 running inside Claude Code and let it do the archaeology, reviewing the result each night and making only the calls that needed someone who was there.

The run was staged as a controlled experiment. Step one moved the existing 2010 C++ into Godot 4 — the safe baseline — and produced a playable character roughly 21 minutes into an evening. Step two was the real test: reconstruct the original 72,758 lines of commentless assembly for a dead machine, running at the Amiga’s native 50 Hz. Step three nested that 1993 build inside the modern game. All three worked, and the binary level format that had taken multiple rounds and manual hints with an earlier model a year prior came out correctly in a single pass — the author’s point being that sparse Amiga assembly in training data forces the model to reason rather than recall. Crucially, the model wasn’t just reading; with terminal and filesystem access it drove real toolchains (vasm to assemble, FS-UAE to boot), diffed rebuilt binaries, and added headless CLI flags so it could pose characters, script button presses frame-by-frame, and screenshot builds to test itself.

The engineering details are the substance. The port preserved two separate tick rates — 50 Hz for the 1993 build, 60 Hz for the modern one — because friction is applied as a per-frame multiplier, so changing the clock silently warps every acceleration curve without any crash or visible diff. It also declined Godot’s standard CharacterBody2D and move_and_slide in favor of transplanting the original 150-line hand-written collision routine verbatim, fudge constants and stray magic numbers intact. The honest caveat: nothing checked whether the game ‘felt right,’ there were no image comparisons, and some of the AI’s decisions were simply wrong — the author didn’t catch them for weeks. It’s a concrete look at LLMs as reasoning tools for legacy reverse-engineering, and at where automated verification still stops.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.