Friday, December 9, 2011

WINEing and DOSing on Linux

I recently picked up some old (but still very enjoyable games even though their graphics mightn't be up to todays standards). These games included RAC Rally Championship (DOS), Theme Hospital (Windows 95), and Rise of Nations (Windows XP). This post will go through the steps required to get them working under Linux. Note, that I'm assuming that you have installation discs for all relevant programs.

FIrst game I tried was  RAC Rally Championship. I consider it to be one of the better rally arcade/simulator games prior to Colin McCrae's Rally and DIRT. To get it running first install, 'Dosbox' (its a DOS-emulator for various different platforms). Startup the 'dosbox' environment from the Linux CLI or via the relevant GUI menu option. Run the following commands. Then run the following series of commands.


- mount c /media/disk -t cdrom (mount your installation disc to C:)
- mount d ~/rally (mount a folder from your Linux home folder called rally to D: to give the installer a place to place its files. Assumes you have already created the folder of course)

- C: (go to root directory C:)
- install.exe (run the installer file. When prompted install it to D:\)
- cd d:\rally (when installation has completed change to the installation directory)
- ral.exe (run the game)

One thing you'll definitely notice is that while the games are still quite enjoyable they'll often feel quite 'eerie'. Imagine existing in the world of 'True Colour' (32-bit and millions of colours) and then suddenly finding yourself being transported to a world where only 256 colours exist.

 
The next game we'll attempt to setup/run is, 'Theme Hospital'. Similar in concept to 'Zoo Tycoon' it has you running running a Hospital, attempting to find a happy medium between healing patients and fulfilling more tangible/financial goals. I discovered that while installation was quite easy (insert the disc, mount it, then run the setup/installation file via 'wine'), getting everything running perfectly wasn't.



First I needed to get DirectX installed. Instructions are available online for this which involves downloading a redistributable installation file from the Microsoft Download Centre. I opted to use the my Tiger Woods 08 DVD to get DirectX the installation file. While the game worked, sound was not functional. Using 'winecfg' indicated that I was getting 'write' errors to the sound device file and testing obviously produced no sound.



I read up online that a lot of others were having issues with the 'PulseAudio' sound daemon. I also read that removing the package/s could result in 'odd' issues with their desktop installation. Like others, I discovered that killing the pulseaudio damon doesn't actually stop it because it respawns by default. Altering the relevant pulse/client.conf file should changed this behaviour whether done to the core configuration in /etc or via a users' local .pulse setup but didn't which indicated there must be another point of configuration as well. I disabled it through the 'Gnome Startup Preferences' menu option/s. At that point, the error/s disappeared but switching between the different sound daemons still didn't produce success (ESound, Pulse, OSS, ALSA) even though I had installed all relevant 'wine to sound daemon' plugins. Finally, I shutdown everything (sound related) except the core 'PulseAudio' daemon and finally the test/game sound seemed to work even though others have indicated that using ALSA seems to be the best/easiest solution.


While the installer for 'Rise of Nations' went well I've experienced many 'known issues'. Among these, having to use both mouse buttons to navigate through the menu system (though the left mouse button seems to work perfectly fine in the actual game itself), having some regular graphical anomalies (this only occurred with Rise of Nations but not when its Rise of Nations - Thrones and Patriots), a temporary black screen or stall on startup (not a real stall. Use the space bar to reach the main menu), and having no sound. Attempted to switch Direct X libraries between builtin/native as directed elsewhere online to get around these issues but switching to native actually caused an exception to occur on startup of the game so I have since gone back to the program defaults. I also believe that some of these problems may also be version related so I'll update at a later time.



As an inside, I recently scratched one of my game software discs (the game would only run through the install process part of the way before succuming to read errors) but had run out of disc repair solution. I've since discovered that 'toothpaste' actually works quite well as a repair agent since its a light/mild abrasive. It tends to blends the scratch in with its surrounding rather than polishing the disc though.



I recalled the early days of optical drive technology. There were often (and there still are though less drastic) differences in  error detection/correction quality on different drives (I remember a disc that was completely undearable in one drive but perfectly readable in another). I switched from an onboard OptiArc drive to an external Plextor drive and disc reading seemed to be perfect.

I decided it was time for me to make an ISO backup of the disc (allowed under existing law). While the backup disc can be used to install the program, there are mechanisms which prevent it from being used as a startup/game disc (even via emulation software using just the ISO file). There are obviously ways around this type of detection but its always a game of cat and mouse between those who create copyright protection mechanisms and those who attempt to defeat them.