levelsio decompiled Battlefield 1942 into a web build
A port he abandoned six months ago, redone with Opus 5.5 and shipped with multiplayer.
Pieter Levels (@levelsio) says he decompiled the free Battlefield 1942 shareware demo and put it on the web with multiplayer, with Claude Code doing most of the work. His account of the pipeline is specific. It disassembled the raw x86 machine code to find 57,000 x86 functions, translated each one into a C function, emitted 100,000 lines of C, and compiled that to WebAssembly with Emscripten. Around 300 Windows and Direct3D calls had to be rewritten to WebGL 2 and OpenGL to run in a browser, and he and the model built a network stack so the game could reach a multiplayer server over WebSockets.
I have no idea how it did any of this but it did it and it seems to work!
there was literally absolutely nothing to work on top of, nobody had ever ported it and there was no open source engine for it
The before and after is the interesting part. Levels says he tried this same port six months ago and essentially gave up, then tried again with Opus 5.5 by asking "can you try port the BF1942 demo in this folder to web". He is explicit that this was harder than his earlier Quake and DOOM ports, because those had open source projects behind them. For BF1942 there was nothing to build on, nobody had ported it, and the makers never open sourced the engine the way id Software did with Quake 3.
What it cost
About a million output tokens, which Levels puts at roughly $100 at API prices. He pays $100 a month for Claude instead. He has since decompiled the Wake Island map as well, and says he plans to add it to the main server rotation once he has tested it enough, though he cannot work out the controls to fly the planes yet.
For working engineers
This is one person's report on one binary, not a benchmark, and the honest caveat is in the post itself. Levels says he has no idea how the model did any of this, and admits he does not know what the assembly translation examples mean. He also says it seems to work, which is a different claim from correctness. Static recompilation of a 2002 game binary is a known technique and the output is machine generated C that nobody is reading, so the test is whether the thing runs and plays, not whether the code is good.
What changed between the two attempts is not documented beyond the model name. Levels did not publish a diff of his approach, so whether the difference is the model, the harness or his own second pass at the problem is not something the post settles.
Have the good opinion, not the loud one
One email a day. Under three minutes. What working engineers found out about coding with AI.
