Thursday, November 23, 2017

Linux, GOG, and Windows-only DOSBox Games

I wanted to create a quick guide on how to get DOSBox based games from GOG running in Linux. I've seen in a number of places now people just downloading old, DOS based games that are supposedly Windows-only, and just running them in Wine. The problem here is that you have Wine's kind-of-emulation layer, and then you've got DOSBox's emulation layer. You're not going to have a good time when you do things this way.

First and foremost. The reason that GOG lists some DOS based games as being Windows-only is simply due to licensing. GOG has contacted the companies that hold the IP to these good, old games and asked for permission to re-package them with a DOSBox executable for Linux, thus making them available for Linux. This has had a lot of success, but there are still a lot of old DOS games that are listed as Windows only.

The example we will use here is X-Com Terror From The Deep. With Steam tracking how many hours I spend in games, a lot of my friends see that I've spent a couple hundred hours in a game and go, "Woah! You spent a lot of time on that game." Naw man. You don't even know the addictions that were X-Com Terror From The Deep, and Ultima VI The False Prophet (Ultima Dragons, sound off!). But I digress.

Configuration!

Applications that you will need in Linux:
Wine
DOSBox

If your liver is already itching at the mere mention of Wine, don't worry, we're not going to use it for much. Once you have these installed, hop into the terminal and run the following commands.

mkdir ~/DOSGames

winecfg

The first command, the mkdir command, will create a new directory in your home directory called DOSGames. If you're not familiar, in the terminal ~ tells the command interpreter that you're talking about your home directory. This way you don't have to type out /home/myusername/DOSGames. We'll use the DOSGames directory with the next command.

The second command will pop up a new window for configuring Wine. This gives us our initial Wine configuration, and also while we're here we will hit up the Drives tab. What we want to do here is add a new drive, D:, and point it to ~/DOSGames.

What this will do is allow any DOS based game that we install via Wine to be installed directly to ~/DOSGames. Here's about what it should look like.


Go ahead and click OK at the botton. 

Installation!

Now we will use Wine to install X-Com. Now, often when you install Wine, you get a context menu option so you can just right click on the installer you downloaded from GOG, and select Run With Wine. If you have this option, awesome! If you don't, you should be able to open up a terminal and navigate to the directory with the installer and run Wine manually.

cd ~/Downloads
wine ./setup_xcom_terror_from_the_deep_2.0.0.4.exe

And at this point you should be looking at an installer for X-Com! Woooo! A couple of things to point out, however. You'll want to hit the Options button so that we can tell the installer where to put X-Com.


I've missed it on this particular install of the game, you can see I'm still installing it to the C: drive. You'll want to install it to the D: drive. I would highly recommend a path like this.

D:\XCOM2

This will make more sense once we actually get into DOSBox. Once you've told the installer what path to install to, and clicked the EULA check box, go ahead and click install and wait for the file copy to finish. You will likely get a bunch of error messages at the tail end of this process. Don't worry about them, just click through. You probably do not want any desktop icons for this, as those icons would launch the game via DOSBox via Wine, and then you will be sad. If you did have it create desktop icons, you can just delete them.

DOSBox Configuration

First, I want you to launch DOSbox. There should be an icon for it in your GUI. If you can't find it, you can launch a terminal and run the command,

dosbox

Pretty easy. But we're just launch it so that it will create a configuration file. When you get the DOSBox window, go a head and type exit to close the window. Now open up your file explorer and hit CTRL+L to open a specific location. This will give you a bar across the top with your location in the directory structure. Like you are at /home/yourusername. Just tack on /.dosbox/ at the end so it looks something like this.

/home/yourusername/.dosbox/

And hit enter. You should be looking at a directory with a file named dosbox-0.74.conf. Go ahead and double click that file, it should open with a basic text editor like gedit. Scroll all the way down to the bottom. There should be a section called [autoexec]. Under that section you want to put the following.

mount c: ~/DOSGames/
c:

Now every time you launch DOSBox, it will automatically make that DOSGames directory your C: drive, and change to that drive. Let's launch DOSBox again.


In my example I used X-COM-TFTD as the directory that I wanted to use. If you're not familiar, DOS used an 8dot3 file naming format. 8 characters for the actual name of the file, and 3 characters for the extension. When a name goes beyond 8 characters, it presents the user with the first 6 characters, and then ~1. If I had a similarly named directory, it would increment to ~2.

From here you can use the cd command to change directory to X-COM-~1, and then run terrorcd.bat to run the game. Or you may have to run setup.exe first to setup your audio hardware and all that good jazz. But that gets beyond the scope of this.

I just wanted to show people that there is a way to get "Windows-only" DOS based games running in Linux, and that you can also put them all in a convenient directory. For every new "Windows-only" DOS based game that you want to install, tell it to install to your D: drive, and you will see it when you fire up DOSbox.

If I can muster up the willpower, I will create a post on how to create a convenient menu in DOSBox for launching these games.

No comments:

Post a Comment