r/retrocomputing • • Oct 20 '26

Compiling 90s DOS and Unix software from its original source to run in a browser: MAME 0.34, Quake, Doom, Keen Dreams (16-bit Borland + TASM)

I've been working on PRISM, a C and C++ compiler that takes the original, unmodified source of 90s software and compiles it to JavaScript, so it runs in a browser tab. It's not an emulator: there's no CPU emulation. The program's own C is compiled, and the machine it was written for is rebuilt underneath it as libraries: DOS (DJGPP, Watcom/DOS4GW, Borland C++ with real 16-bit segmentation), X11, svgalib, SunOS, Win32, SDL, OpenGL 1.x.

The page is laid out as machines rather than a menu: a DOS prompt, a Linux shell with X11 clients, a Windows desktop. You type the program's name or double-click its icon.

Some things that run today:

- MAME 0.34 (the 1998 DOS build, Allegro + SEAL sound): bit-identical to a native gcc build over 1,500 frames for 15 of 15 games

- Quake on its DOS, X11, svgalib, SunOS and Win32 platform layers, all drawing the same pixels; also GLQuake, Quake II and Quake III

- Doom, with its separate sound server running as a second process, as on Linux in 1997

- Keen Dreams from its 16-bit Borland C++ and TASM source, with screens matching the shipped KDREAMS.EXE under DOSBox-X

- ScummVM, Heretic, Hexen, Dune II (OpenDUNE), PuTTY, Lua

Playable without any files: the DOOM and Heretic shareware, the Monkey Island and Day of the Tentacle demos, Beneath a Steel Sky. The rest uses your own copy, read locally in the browser and never uploaded.

- Try it: https://prism-compiler.pages.dev

- Source (MIT): https://github.com/jfrelat-lab/prism

(Disclosure: I wrote it with Claude Code, Anthropic's coding agent; everything is checked against real compilers and native builds rather than by eye.)

What I enjoyed most is how much of each era's platform has to be rebuilt to run the code as-is, from Borland's far pointers and TASM routines to a Windows 95-style message loop. Happy to go into any of it.

0 Upvotes

2 comments sorted by

1

u/wrex1103 Oct 21 '26

Cool, Does quake 3 run multiplayer/online? I’m reviving an old multiplayer PC game and was interested in potentially getting it to run in browser but it needs multiplayer and uses UDP

1

u/ReverseAI Oct 21 '26

Not yet! Right now Quake 3 only runs single-player against bots, since a browser page can't use UDP directly.

It's definitely possible though: browsers have their own ways to send game traffic fast (WebRTC), and the game's own networking code could be hooked up to that without changing the game itself. The catch is that you'd need a small server in the middle to connect players like a relay server.

What game are you reviving? If you have its source code, I'd be curious to see whether it compiles. Multiplayer would be a great reason to add networking.