Reliving the 90s through Video Games

A few days ago 3D Realms (used to be Apogee Software) released a bundle of most of their old DOS games in a form that runs on modern Windows. I grew up playing the shareware versions of Commander Keen, Monster Bash, and a couple others they made so I bought the anthology figuring it would be fun to actually beat them finally, even though they’re only advertising Linux-compatibility sometime in the future.

The first thing I discovered when I launched one of the games was that Windows 7 compatibility is based on running the games through DOSBox. That’s not surprising and I’ve actually resurrected old shareware through DOSBox before, but it made me realize how easy it would be to set up the emulator to run on Linux myself. I probably spent more time Friday night cleaning up their installed files (the DOSBox runtime was included in every single game directory) and rewriting the config files and launch scripts to run on Linux than I did actually playing games.

First item of note: Dosbox can be extracted to be in just the root directory of the games anthology to save a couple hundred megabytes of disk space. Instead of:
Anthology
    Commander Keen - Galaxy
        Dosbox
    Commander Keen - Vorticons
        Dosbox
    ...

flatten the structure to:
Anthology
    Dosbox
    Commander Keen - Galaxy
    Commander Keen - Vorticons
    ...

For that move to work two things need to be updated: the .conf files used to initialize DOSBox and the .bat launch scripts.

Old launch script:
@echo off
cd "Commander Keen - Vorticons\dosbox"
start dosbox -conf "..\KEEN VORTICONS.conf" -noconsole -c
exit

That won’t work now because that’s not where DOSBox is, and changing into the directory of DOSBox doesn’t make sense if the installation isn’t associated with a specific game. My rewritten script is:
@echo off
start Dosbox\dosbox -conf "Commander Keen - Vorticons\KEEN VORTICONS.conf" -noconsole -c
exit

I called the dosbox executable directly by relative path instead of going to its directory, then I updated the relative path to the .conf file.

The .conf file is rather large, so I’ll only include the portion I changed (which was near the bottom). Old:
[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.

@echo off
Mount C ".."
C:
cls
...

This is code that executes after DOSBox is launched. In this case it’s setting the C:\ drive to be “..” then running a menu for launching the different chapters of the game. The “..” path won’t work because we’re no longer changing directory to an embedded DOSBox folder, so to be consistent with the new launch script change it to:
[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.

@echo off
Mount C "Commander Keen - Vorticons"
C:
cls
...

You can also change general DOSBox configuration details in the conf file, such as setting it to default to not fullscreen.

The other effect of changing the .conf files is that if you have DOSBox installed the games can now be run directly from the Anthology folder with a command like:
dosbox -conf "Commander Keen - Vorticons/KEEN VORTICONS.conf" -noconsole -c
Having that command work was actually the inspiration to modify the .conf scripts because I deleted all the dosbox folders before copying all the games to my Linux machine. It was only later I realized that I could update the bat scripts to support the new conf, which means that if I boot my laptop into Windows I can run the games from the same place and have all my save data available.

For convenience I’ve made bash scripts to launch the games:
#!/bin/sh
cd `dirname $0`
dosbox -conf "Commander Keen - Vorticons/KEEN VORTICONS.conf" -noconsole -c