Playing Classic 1990s DOS Games in Web Browsers Using DOSBox-WASM

A practical guide to how WebAssembly enables classic MS-DOS games to run in modern web browsers without local installation, covering audio, virtual filesystems, and controls.

During the late 1980s and 1990s, PC gaming was defined by pioneering titles like DOOM, Wolfenstein 3D, The Oregon Trail, and Prince of Persia. Running these 16-bit real-mode and protected-mode x86 games on modern 64-bit operating systems historically required installing standalone desktop emulators like DOSBox, manually mounting local folders as virtual drives, and configuring sound card interrupts.

Today, thanks to WebAssembly (WASM), the open-source DOSBox codebase can be compiled into a browser-executable format (commonly known as DOSBox-WASM or js-dos). Users can boot an emulated 486 PC, synthesize Sound Blaster audio, and run classic DOS software inside a standard browser tab on Windows, macOS, Linux, or ChromeOS with zero local software installation.

This guide explains how in-browser DOS emulation works and details how to load and configure titles.


1. How WebAssembly Emulates an MS-DOS PC

To run 1990s PC software in a browser, the WebAssembly port emulates the full x86 hardware architecture:

[16-Bit / 32-Bit DOS Binary (.EXE / .COM)]
                    │
                    ▼
[DOSBox-WASM Engine (Compiled from C++ to WebAssembly)]
   ├── Emulated x86 CPU Core (Real Mode & Protected Mode)
   ├── Emulated Sound Blaster 16 / OPL3 FM Synthesizer
   └── Virtual In-Memory File System (MEMFS / IndexedDB)
                    │
                    ▼
[HTML5 WebGL Canvas & Web Audio Output]
  • CPU Emulation: The C++ DOSBox interpreter compiles into .wasm bytecode. The host browser executes this bytecode using its native WebAssembly virtual machine, interpreting x86 machine instructions at full historical speeds.
  • Graphics Output: Emulated VGA (320x200 @ 256 colors) and SVGA modes are rendered to an offscreen pixel buffer and displayed via WebGL or 2D canvas primitives.
  • Audio Synthesis: Hardware sound cards of the era (such as the Sound Blaster 16, Gravis Ultrasound, and Yamaha OPL3 FM chip) are simulated in software, outputting PCM audio streams through the browser’s Web Audio API (AudioContext).
  • Virtual Storage: Because web pages cannot access your physical hard drive for security reasons, DOSBox-WASM constructs an in-memory virtual filesystem. Game files are mounted in memory or saved persistently using the browser’s IndexedDB storage.

2. Where to Play Curated DOS Games Online

Several digital preservation initiatives provide pre-configured DOSBox-WASM instances that launch directly from the browser:

  • The Internet Archive (MS-DOS Collection): Hosts thousands of historical DOS titles, educational programs, and shareware classics. Clicking the power button on an item page initializes an in-browser DOSBox-WASM session with pre-configured sound drivers and autoexec scripts.
  • DOSZone / js-dos Portals: Modern web frontends providing mobile touch controls, gamepad mapping, and browser-side save state storage.

3. Running Your Own DOS Files via Browser Players

If you own legacy DOS game files (such as shareware releases or archived backups from GOG):

  1. Place your game files into a standard .zip archive (ensure the main executable, such as GAME.EXE, is at the root of the archive).
  2. Open an in-browser DOSBox player (such as js-dos.com).
  3. Drag and drop the .zip archive onto the player canvas.
  4. The virtual machine will mount the archive to drive C:\.
  5. At the emulated command prompt, launch the executable:
    C:\> GAME.EXE

4. Managing Input and Pointer Lock

  • Mouse Capture: For first-person shooters like DOOM or flight simulators, click inside the canvas once to engage the Pointer Lock API. This captures your mouse cursor and delivers raw relative coordinate deltas, replicating the behavior of a physical serial mouse. Press Esc or Ctrl + F10 to release the cursor back to your desktop.
  • Sound Setup: If a game boots with video but no audio, check if the game folder includes a SETUP.EXE or SETSOUND.EXE utility. Standard DOSBox emulates a Sound Blaster 16 at Port 220, IRQ 7, and DMA 1.

Summary

DOSBox-WASM brings complete x86 PC emulation to the web browser through WebAssembly and HTML5 audio/canvas standards. Whether exploring historical preservation archives or running archived .zip game bundles, classic DOS software runs securely and smoothly without native installation.


Share this guide
DV

About the Author: Devin Vance

Devin Vance writes technical guides and performance benchmarks at TabGamer, covering browser graphics, WebGL flags, low-spec laptop optimization, and retro WebAssembly emulation.