Levels gets decompiled BF1942 running multiplayer on phones
The agent also upgraded the game to v1.61 and explained, step by step, how it unstretched the HUD in portrait mode.
Pieter Levels says the decompiled Battlefield 1942 now plays as full multiplayer in mobile browsers on iPhone and Android. The piece that makes it work is a graphics layer Claude Code wrote itself, translating Direct3D instructions to WebGL and sitting between the game's machine code and the browser. Because the translation happens there, Levels says the resolution can be set to anything.
Claude Code built its own graphic layer that translates Direct3D (DirectX) instructions to WebGL, sitting between the game's machine code and the browser
This follows the original browser port. Two other things changed since.
v1.0 to v1.61
Levels upgraded the game and server from v1.0, the demo, to v1.61, the last release, which he says shipped in 2004, two years after the original. That meant another round of decompiling plus a batch of bug fixes to keep multiplayer working in the web build. Max players is now 64, and he recommends Chrome on a laptop.
The HUD fix
The first mobile build had a visible flaw. Levels said geometry got cut off, arms and the insides of vehicles, because the game was never meant to run in portrait. He then fixed the stretched interface by modding the engine, and posted Claude Code's own description of the method.
The agent said it separates HUD draws from 3D world draws by looking at the projection matrix the game sets before each draw, since the world uses a perspective projection and the HUD a flat one. For each HUD element, the ticket count, the map, an ammo icon, it computes on the CPU where the corners land on screen using the same matrix math the GPU would do, then shrinks the height by a 2.9x factor toward a fixed edge, top elements toward the top, bottom toward the bottom, middle toward the center, so the map and its icons stay aligned. Big panels like the scoreboard and the loading photo keep the old stretch so their layout does not change, and on menus text shrinks around its own center so tap targets stay put.
For working engineers, the demo is a game, but the work is not game work. It is an agent writing a graphics API translation shim against machine code it decompiled itself, then reasoning about projection matrices in a binary nobody on the project wrote. This is one person's project and the only evidence is what Levels posted, so treat it as a single detailed receipt rather than a measured result.
Have the good opinion, not the loud one
One email a day. Under three minutes. What working engineers found out about coding with AI.
