Classic demoscene productions run in the browser — recompiled to WebAssembly

Translated by a model; the original is in Russian.

· Technology
The demoscene-recomp project takes the original DOS code of legendary early-1990s demos and turns it into WebAssembly instruction by instruction, preserving exact cycle timing.

cover.svg

A developer has put together a project that runs famous DOS-era demos directly in the browser — without an emulator in the usual sense. Instead of "playing back" the old program on top of a virtual machine, the author chose static recompilation: the original code is translated into a modern format one instruction at a time.

How it works

First the demo is run on an x86 emulator that records every block of code the CPU actually executes over the whole run. That recording is translated into C — the same instructions, one for one, with the exact cycle timing of the emulated machine. The C is then compiled to WebAssembly, together with models of the hardware the demo talks to: the timer, the VGA card and the Sound Blaster.

The result is checked against the emulator event for event — every interrupt, every port access, every frame lands at the same moment of emulated time. The demos' own loaders, music players and effects run exactly as they did in 1992 and 1993; only the hardware is modelled.

What you can watch

The collection includes Unreal and Second Reality by Future Crew, Crystal Dream II by Triton and Stars: Wonders of the World by NoooN. All were released free to the demoscene back in the day. The original release files are served unmodified — exactly as the demos read them at run time.

One caveat: the demos ran on VGA at 70 Hz, so they look smoothest on a display running at 70 Hz — or 140 Hz and higher. Visits are counted anonymously, with no IP addresses, tracking cookies or personal identifiers.


Source: Hacker News

Comments

Sign in, to comment.

  • No comments yet.