Archive.org has released a large number of MS-DOS games that can be played in the browser using em-dosbox. Here I'll show you how you can compile em-dosbox and put up your own MS-DOS programs on the web. This guide assumes you're using Mac OS X and Homebrew, but should be informative for other UNIX users as well.
So before we can build em-dosbox, we need to install emscripten. With Homebrew, you can review installation options with:
Homebrew tells you that you need to update your
~/.emscripten after running
emcc for the first time:
So let's run
~/.emscripten and comment out the line with
LLVM_ROOT. Set it to
what Homebrew suggests:
Now try running
emcc to verify that it runs without any errors.
That should create a
configure file. Now run that through
If that works fine, you should be able to build em-dosbox:
On a successful build, you should find
These are templates for the web page that you'll use to run MS-DOS programs.
To take an MS-DOS program called
TEST.EXE and bundle it with em-dosbox, you
That should create the files
However, on my system, it complains that it can't find
This is part of the emscripten package. With Homebrew, emscripten is
symlinked to the
Cellar directory. You should therefore set
~/.emscripten to point to where the emscripten files are
You can check what value
EMSCRIPTEN_ROOT is currently set to:
On my system I had to set this to /usr/local/Cellar/emscripten/1.28.2/libexec
~/.emscripten so it looked like:
Now, I have an old intro I made with Turbo Pascal and assembly, back in the
day. The file is called
A-SYSTEM.EXE, so I ran it through the packager:
a-system.html. But if I open this
in my browser, it won't be able to load the data files because of the
Therefore, I'll just start a simple web server in the current directory and
access it through that:
This works pretty well, but the intro runs quite slow. Hitting
speeds up the CPU and framerate considerably. But such settings can be put in a
configuration file. For this to work, you need to move the EXE-file into a
src/ and add a
I put this in
Then I built the entire directory with:
The first argument is still the prefix for the
second is the directory containing the EXE-file and config file, and the final
argument is which DOS program to embed.
I haven't tweaked the
settings yet, but you can view the
A-SYSTEM 28k intro here. Just be patient while it loads.
It uses XMLHttpRequest to download
are about 30 Mb each. For some reason, this is slow.
Update: I've tried compressing those files with gzip. While it seems to work fine with Firefox and Safari, on Chrome the emulator seems to ends abruptly. By the way, Firefox seems to be the one giving the best performance with em-dosbox.