dmnet.st Commando

Behind the scenes

How it works

Nothing here is emulated. The Xenon 2 port next door runs the original program inside an emulator; this one is a translation. The arcade's Z80 routines were read from the ROM one by one and rewritten as typed TypeScript, then compared, frame by frame, with the MAME emulator running the real board.

Arcade ROMYour copy of the 1985 program, tiles, sprites, palette and sound data.
ExtractionGraphics, maps, collision, placement streams and tables, read straight from the ROM bytes.
Game runtimeThe ROM's routines as TypeScript: the same pools, timers, scripts and order of work.
ObjectsEach update publishes soldiers, vehicles and bridges, not sprite numbers.
Your screenDrawn as arcade pixels, or as a 3D toy diorama with three.js, in the browser or in VR.

The arcade board

Commando ran on two Zilog Z80 processors: a main CPU at 4 MHz that plays the game, and a sound CPU at 3 MHz driving two Yamaha YM2203 chips, each with three FM voices and three square-wave voices. The picture is a 256×224 screen turned on its side, so the game scrolls up a tall, narrow portrait view of 224×256 pixels.

Translating the program, not emulating it

The game's world lives in a few fixed tables in RAM: pools of actor records for enemies, vehicles and shots, a queue of commands to the video and sound hardware, and scripts in a small bytecode that move scripted soldiers and trucks along their paths. The translation keeps those structures and the order in which the ROM works through them each frame, because Commando's behaviour depends on it: which soldier spawns in which slot, which shot is free, who is hit first.

Before a routine was translated, its callers, every branch, the tables it reads, the fields it keeps between frames and the side effects it causes were listed in an obligation ledger, and each one had to be implemented and checked, or excluded with a reason. Every byte of the main program is now classified as code, data or unknown on the coverage map.

Checked against MAME

Lua scripts drive MAME through controlled inputs and save the board's RAM and screen at chosen frames; the browser runtime replays the same inputs and is compared field by field. One route of recorded inputs plays all eight sections, the ending and the start of the next loop identically in both. The first comparison frame matches MAME to the pixel (0 of 57,344 pixels different). What has not been verified, such as every possible timing of the original hardware, is recorded as open rather than assumed.

Objects, not sprites

Every update, the runtime reports what is on the battlefield as whole objects (a soldier crouching behind sandbags, a jeep with its gunner, a bridge with its emplacement) rather than as the arcade's sprite pieces. The arcade view draws them with the original sprites; the 3D view puts a model in the same place, facing the same way, playing the same action. The same game state feeds both, so switching views never changes the game.

What is new

Sound without the channel limits

The original driver gives sound effects two groups of square-wave voices, so a new effect cuts off an old one. Here the arcade's 21 effects (rendered once through its own translated sound driver) and the C64 version's 16 play as independent, overlapping sounds, positioned in 3D on the object that made them. Music keeps its own synthesis.

Two soundtracks

The arcade music by Tamayo Kawamoto, translated from the sound CPU's driver and played on an emulated YM2203 (ymfm); or Rob Hubbard's Commodore 64 score, played on an emulated SID chip (reSIDfp), with the C64 game's own sound effects.

The toy diorama

The battlefield as a moulded toy landscape: the ground's relief, colours and shadows are baked from the arcade's own tiles at build time, buildings, vehicles and palms are toy models, and the soldiers are minifigures that fall apart when hit.

VR on a Quest 3

Choose Enter VR in the toy view and the game becomes a tabletop diorama with the score above it. The left stick moves, a trigger fires, grip or A throws a grenade, and the right stick zooms and turns the table. Making it hold the headset's 90 frames a second took baked lighting, baked soldier poses and careful measurement.

Autopilot

Press Autopilot On and the computer plays from wherever you are: it reads the same game state, plans routes over the real collision terrain, predicts every shot and grenade, and collects supplies. In twenty fresh runs it completed all eight sections and the ending without being hit once.

Recordings

Every game can be recorded exactly, with its sound, then replayed, rewound, inspected object by object, and exported as an MP4 video with music. The recording viewer is not on this site yet.

Sound explorer

Every sound command of the arcade (13 tunes and jingles, 21 effects, 13 controls) and the C64 version's 3 songs and 16 effects, playable one by one or layered on top of each other. Open it →

Phones and touch

A touch pad and Fire and Grenade buttons appear when you touch the screen. The arcade view starts with a few small JavaScript files; three.js and the 3D models load only when you choose the toy diorama.

Built by conversation

The project was written with two AI coding assistants, OpenAI Codex and Anthropic's Claude Code, directed by one person. They took 920 prompts: questions, corrections, decisions and "try again". Codex did most of the ROM research and the translation; Claude Code built the 3D models, the toy diorama, VR and this site. The assistants' mistakes, and what was changed so they would not happen again, are in the AI errors log.

AssistantTopicPrompts
CodexGameplay, ROM research and code structure281
Autopilot tactics and reliability27
Performance and the C/WebAssembly port112
Graphics, audio, recordings and the interface216
Claude Code3D models and the tile lab110
The toy diorama, VR and performance147
This website, Quest testing and the dmnet.st front page27
Total920

Lines of code

About 165,000 lines, not counting blank lines, data files or the documentation. The game itself, as this site serves it, is about 61,000 of them; the rest checks it, measures it against the arcade, or builds its assets. The C is the autopilot's search, compiled to WebAssembly so it can plan in real time; the Lua scripts drive MAME to record the original board for comparison.

CategoryTypeScriptJavaScriptCPythonLuaHTML, CSSTotal
Gameplay (the ROM translation)29,24429,244
Sound drivers and mixing3,0543,054
Autopilot4,9622,8812,99510,838
Rendering, 3D and the game page15,11319415,307
Recordings2,1791052,284
Tests43,0791,927945,015
Analysis, diagnostics and labs21,1556,37689328,424
MAME tracing scripts13,87913,879
Build, extraction and model tools5791,99712,58915,165
This website1657139481,826
Total119,36511,4192,99515,22913,8792,149165,036

Counted in November 2026. HTML and CSS include the website's deploy script (85 lines of PowerShell).

Interactive

Self-contained pages. They open in the same tab; use the bar at the top to come back.

Write-ups

The working notes, rendered as they are. They were written while building the game, so expect ROM addresses, register names and references to source files that are not published. Each describes the project as it stood when it was written.

Other notes