DOS Emulation

Taking the lead from the Internet Archive, in the past couple of weeks, I have rolled out a significant update to the site. One in which we can now all run Defacto2’s entire collection of  1,350+ DOS scene productions online and in the browser!

The idea for this has been simmering for the past couple of years ever since the Internet Archive’s first DOS emulation announcement. But I have held back, waiting for the quality of the JavaScript emulation to improve, specifically its audio.

Thankfully that time came and I’ve successfully rolled out a very customised implementation of The Emularity, a front-end for Em-DOSBox; an Emscripten port for the famous DOS emulator. I believe this, for the most part, is the same set of tools that the Internet Archive uses for its massive DOS emulation project?

Now we are free to run and view over 75 demos, 500 cracktros and 400 BBS loaders in the browser without having to fuss around with downloads, package extractions, emulation configurations and possible troubleshoots.

More importantly nearly 200 PC e-mags (electronic magazines) are readable in-browser. These contain thousands of articles and interviews with scene participants of the era that were previously inaccessible to most people.

You can even play around with numerous intro makers, ANSI editors, software patches and cracking tools. Here are just a few highlights.

Rave out to Faith’s 1993 Caesar’s Palace cracktro
Be wowed by Future Crews Unreal 1.1 demo with GUS audio
Pretend you’re a 1990s hipster viewing Paradigm’s Rouge Squadron cracktro running on a horribly underpowered machine
Learn about ANSI Bombs and ANSI Music by reading ACiD’s The Product

Overall I am very happy with the results. There is full-screen support with correct aspect ratio on widescreen monitors and even the ability to capture screenshots and save them to the browser’s download folder.

2016-03-14_15-42-57

Finally, it uses web friendly, linkable DOS hardware configurations that users can change by submitting a web form or an URL query string. A wide range of hardware configurations is supported from CGA through to Super-VGA, Covox Speech Thing to the Gravis Ultrasound (with sound patches). Even the ability to change the screen render and effects so you can emulate a CRT monitor or keep a clean, crisp LCD look.  The implementation uses modular, automatic configurations with the goal to be as low maintenance as possible.

2016-03-14_15-42-36

There have been a few interesting observations learned from scene applications by my rolling out and troubleshooting this project.

In the early days scene members or scene’rs both in the cracking and demo communities expected a high technical knowledge from its user base. Take this question  from Cascada’s 1990 X-Mas demo, “Please select your outport in hex for the sound”. As you will see there is very little handholding.

ac1f348

Scene’rs of the era were frequently teenage, bedroom coders with very little Q/A experience. An application may have claimed support for a set of hardware but often the implementation was untested and sometimes broken. In the days of DOS, there were no multimedia APIs. So it was left to the software, not the operating system to implement support for hardware. But amateur programmers often did not have access to all the hardware they attempted to support.

A couple of show-stopping issues I encountered were related to sound emulation. By default DOSBox has multiple types of audio hardware emulated at once. This would confuse and ultimately crash some intros that tried to detect which soundcard to support. I was forced to implement a setup that only permitted the emulation of one sound card at a time.

DOSBox uses Super VGA as default, as it is the most compatible graphics configuration for DOS games. However, I found with some intros the SVGA machine type would create glitches and even outright crash whereas the VGA machine type would work seamlessly. 

Razor 1911 Ninja Gaiden 2 loader in SVGA and VGA machine modes.

A real annoyance that took a long time to troubleshoot was a ZIP archive incompatibility. The Emularity uses the BrowserFS library to mount zip files into EM-DOSBox as the emulated DOS c: hard drive. This works fine most of the time, except not all zip archives are created equal. There are some incompatibilities with legacy archives created with ancient copies of PKZIP’s DOS archive tools. BrowserFS still mounts these zip archives but some of the hosted files will fail and be unreadable. Needless to say, it was a real pain to troubleshoot the first time it cropped up. This is not a problem that is unique to BrowserFS and I have also seen it with modern desktop tools such as 7-Zip.

2016-03-14_17-25-34
7-Zip failing with old archives

Some intros, especially from the demo scene, take a ridiculously long time to load. I am guessing this could be due to unoptimised decompression, decryption or self-modifying code? There is not much that can be done about this, unfortunately.

Finally, the only other downside to this implementation is its initial user download and setup. For first time users, there is around 40MB of transfers which is a silly large background download for a web page. Thankfully those on slower connections or older hardware can turn off the emulation functionality completely and this happens by default for all iOS and Android mobile devices.

Other then that I hope you enjoy your time warp to the late 20th century and have fun hacking those emulated DOS prompts.

P.S. Last month Defacto2 celebrated 20 years of existence online. Here’s hoping for another 20 years!

Advertisements

6 thoughts on “DOS Emulation

  1. Could you file a bug with BrowserFS with one of the failing zip archives? I’d like to examine why it failed to decompress.

    Thanks!

    Like

  2. Can you tell me more about how to change the emulation mode in this? I run many games in DOSBOX with Tandy 1000 mode. I know that demos did not use Tandy mode, but many DOS games did.

    Like

    1. Hi Matt, ‘change the mode in this’ do you mean in the emulatior running on Defacto2? Or the actual code?

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s