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.
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.
| Assistant | Topic | Prompts |
|---|---|---|
| Codex | Gameplay, ROM research and code structure | 281 |
| Autopilot tactics and reliability | 27 | |
| Performance and the C/WebAssembly port | 112 | |
| Graphics, audio, recordings and the interface | 216 | |
| Claude Code | 3D models and the tile lab | 110 |
| The toy diorama, VR and performance | 147 | |
| This website, Quest testing and the dmnet.st front page | 27 | |
| Total | 920 | |
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.
| Category | TypeScript | JavaScript | C | Python | Lua | HTML, CSS | Total |
|---|---|---|---|---|---|---|---|
| Gameplay (the ROM translation) | 29,244 | 29,244 | |||||
| Sound drivers and mixing | 3,054 | 3,054 | |||||
| Autopilot | 4,962 | 2,881 | 2,995 | 10,838 | |||
| Rendering, 3D and the game page | 15,113 | 194 | 15,307 | ||||
| Recordings | 2,179 | 105 | 2,284 | ||||
| Tests | 43,079 | 1,927 | 9 | 45,015 | |||
| Analysis, diagnostics and labs | 21,155 | 6,376 | 893 | 28,424 | |||
| MAME tracing scripts | 13,879 | 13,879 | |||||
| Build, extraction and model tools | 579 | 1,997 | 12,589 | 15,165 | |||
| This website | 165 | 713 | 948 | 1,826 | |||
| Total | 119,365 | 11,419 | 2,995 | 15,229 | 13,879 | 2,149 | 165,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.
Architecture reference
The arcade hardware, how the ROM maps to TypeScript, object pools, motion bytecode, input, execution order and rendering, with a glossary.
Sound without the arcade's limits
Why effects no longer cut each other off: canonical samples, overlapping instances, sounds positioned on the object that made them, and two soundtracks.
The brick style
Building Area 1 from plates and bricks at three studs per tile, minifigure soldiers and the LDraw parts.
The 3D renderer
How the running game is drawn as a 3D stage from the same semantic objects as the arcade view.
Scenes in 3D
Title, entrance, section transitions, deaths and the ending: which scenes the 3D view draws and how.
Objects, not sprites
The game publishes soldiers, vehicles and bridges rather than sprite numbers, so the art can be swapped.
Measuring VR on a Quest 3
Profiling the toy diorama in the headset and on a phone: frame timing, draw calls and where the time goes.
Arcade sprites
How the original sprite hardware output is reproduced, piece by piece.
ROM coverage
Every byte of the main program classified as code, data or unknown, and what has been translated.
Other notes
- Active player control and frame effects ACTIVE_PLAYER.md
- Gate door `$14` GATE_DOOR.md
- Main command queue MAIN_COMMAND_QUEUE.md
- Main CPU RAM map MAIN_RAM_MAP.md
- Main scenes and startup MAIN_SCENES.md
- Background video writer $A759-$A791 NATIVE_BACKGROUND_VIDEO.md
- Native grenade and shared blast NATIVE_GRENADE.md
- Linked actors $01/$02 NATIVE_LINKED_ACTORS.md
- Native projectile pass and player fire NATIVE_PROJECTILES.md
- Queued player-shot/core contact — $AF28-$AF78 NATIVE_QUEUED_CONTACT.md
- Native scenery allocation, state and output NATIVE_SCENERY.md
- 3D pop-in audit POPIN_AUDIT.md
- ROM motion-script reader and core update ROM_SCRIPT_INTERPRETER.md
- Runtime JSON packs RUNTIME_JSON_PACK.md
- Shared scripted-actor scroll SCRIPTED_ACTOR_SCROLL.md
- Runtime state ownership correction STATE_OWNERSHIP.md
- Static spawn catalog STATIC_SPAWN_CATALOG.md