Hack69.Run DOS Games

Hack 69. Run DOS Games

Get DOS games running correctly under your current operating system .

With the widespread acceptance of DirectX, running games on a Windows machine has become very easy and straightforward. Generally , you need only run a setup program and double-click on the resulting icon to start the game. However, running games on a PC has not always been so simple an affair. Conventional memory, extended memory, expanded memory, sound card IRQs and DMAs, mouse drivers, file buffers, boot disks and myriad other configuration details conspired to thwart a DOS gamer's best efforts. Sometimes, getting a DOS game to run was a game in and of itself.

While Windows has freed users from the hassle of having to remember specific hardware settings when running games, it has done nothing to ease the task of running old DOS games. In fact, Windows NT/2000/XP have eschewed the DOS-based nature of their predecessors in favor of a pure Windows-only OS which only makes running already finicky DOS games even more difficult. Thankfully, there are ways to circumvent these issues and bring your favorite DOS games back into service.

7.3.1. When DOS Roamed the Earth

Sometimes, running a DOS program is as easy as simply running an executable. More often than not, the process is a bit more involved. As developers sought to offer games with more graphics, sounds, and features, the number and complexity of settings users had to adjust to support these features increased. This complexity showed up particularly in the realm of sound card configuration and memory management.

In the pre-Windows 95 world, installing a sound card often involved running a DOS utility that would have you configure various hardware settings for the sound card, usually its port address, IRQ, and DMA. Later, when installing a DOS game, you would have to remember these settings as well as your sound card model. If you happened to have a non-standard sound card installed, you would have to know which major soundcard's interface and settings it emulated for the purpose of DOS gaming.

Memory management under DOS can also be a complicated affair. DOS has four major types of memory: conventional memory, upper memory, expanded memory, and extended memory.



Conventional Memory

The first 640K of memory. This memory is primarily used for loading programs. It is also known as base memory.



Upper Memory Blocks

The 384K of memory immediately following the 640k of conventional memory. It is generally used for storing the BIOS and video RAM. This and conventional memory make up the 1MB of RAM, which early PCs designers reasoned, for the foreseeable future, would be more than enough for most peoples' purposes.



Expanded Memory

A method for addressing memory above the DOS1MB limit that temporarily writes the contents of memory higher than 1MB to a portion of upper memory that can be accessed and manipulated by DOS programs.



Extended Memory

A later and more natural method for accessing memory above 1MB that involves more direct access than expanded memory. However, many DOS programs require expanded memory so memory managers, like emm386.exe , often emulate expanded memory when needed.

Many later DOS games have particular requirements about how much conventional memory is available (some as much as 600K of the total 640K) and how extended or expanded memory are made available. To free up conventional memory MS-DOS 6 included memmaker.exe , a program that attempts to push device drivers and other memory-resident programs out of conventional memory and into upper memory. Several DOS games use their own extended memory managers and require that MS-DOS's default extended memory manager, emm386.exe , have certain options disabled or not be loaded at all.

Sometimes all the memory and driver tweaking required to get certain DOS games running would leave you with a system unsuitable for running other software. At times like these people would create boot disks . Boot disks are system disks with all the tweaks and settings necessary to get a DOS game running and can be used to start the computer in a condition ready to run particular DOS games. Some game installers even offered the option to automatically generate a boot disk for the user . However, sometimes additional tweaking was needed.

Even with a DOS game successfully running, later computer users, especially those with Pentiums and higher, would find that their games simply ran too fast. The solution to this problem generally involved using a CPU slowdown utility like Mo'Slo (http://www.hpaa.com/moslo/).

Many of these issues apply to PCs running Windows 98 and earlier because one always had the option of rebooting to directly to DOS if a program wouldn't run in Windows. Since Windows XP is not built on DOS, it's not possible to reboot the machine directly to DOS. In fact, the Windows XP command prompt is also an MS-DOS emulator. Unfortunately, this DOS emulator is limited in terms of features useful for getting old DOS games running properly. The solution is to use a DOS emulator more suited to the task.

7.3.2. Running DOS Games Using DOSBox

While it is possible to run many DOS games in Windows XP's native DOS emulator, you may never be able get them to run at a reasonable speed, even using slowdown utilities like Mo'Slo. A better solution is to use a DOS emulator designed for running DOS games.

DOSBox is a DOS emulator that is available on multiple platforms, including Windows, Mac, and Linux. It emulates various hardware, memory and graphics settings and helps circumvent a lot of the messy details involved in running a DOS game on Windows. It also allows the user to control its emulation speed and to tune the performance of the DOS game it is running.

The installer for DOSBox can be acquired from the Downloads section of the DOSBox web site (http://dosbox. sourceforge .net). As this writing, the latest Windows version of DOSBox is Version 0.63. Once downloaded, the installer can be used to install DOSBox on your system.

As an example, let's walk through the steps necessary to get Champions of Krynn, a 1990 title from SSI's "Gold Box" series of Advanced Dungeons & Dragons simulators, running under Windows XP. We'll be installing Champions of Krynn from the Advanced Dungeons & Dragons Gold Collectors CD which contains unmodified "Gold Box" titles.

Using the install program included on the Gold Collectors CD, install Champions of Krynn (under Windows XP, not DOSBox) to the default directory on the hard drive ( C:\WIZWORX\COK ).

You are now ready to run Champions of Krynn. Technically, you can run it with WinXP's native DOS emulator but it will run very fast and music will probably not work. DOSBox will provide a much more satisfying experience. You can start DOSBox by selecting the DOSBox icon from the Start Menu. Once DOSBox has started you will see the screen shown in Figure 7-2.

Figure 7-2. Starting up DOSBox

In order to access directories on your hard drive, they must be made visible to DOSBox by using the mount command. The mount command maps a directory on your real hard drive to a drive letter in DOSBox. Type the following command:

 mount c C:\WIZWORX\COK 

This command mounts the Champions of Krynn directory ( C:\WIZWORX\COK ) to the C: drive in DOSBox. You can then change to that drive and get a directory listing with the following commands:

 c: dir 

You should receive output similar to what you see in Figure 7-3.

From here, run START.EXE to start Champions of Krynn. Upon startup the game, it queries for information regarding graphics and sound. Tell it to use EGA graphics (the best available) and an Adlib sound card (one of the cards emulated by DOSBox.) The next settings are for mouse/joystick use and the location of the save directory. These are up to the user. Enter your choices and you'll see a splash screen like the one in Figure 7-4.

Champions of Krynn is running, at a decent speed no less. This is all well and good, but there are a few tweaks we can do to make the experience a little more pleasant.

Figure 7-3. Partial dir listing for Champions of Krynn

Figure 7-4. Champions of Krynn, back from the dead

7.3.3. Tweaking DOSBox for Speed and Convenience

Right now, you need to go through several steps to start a DOS game using DOSBox. Also, the game is confined to a relatively small window. It would be nice to be able to start a game in DOSBox with custom settings merely by double-clicking on a single icon. With Windows batch files and some simple command-line parameters, you can.

First create a new text document on your desktop and rename it run_cok.bat . Right-click on this file and select Edit. In the window that opens enter the following, then save the file:

 cd C:\Program Files\DOSBox-0.63 dosbox C:\WIZWORX\COK\START.EXE -fullscreen -exit 

Now, when you double-click on run_cok.bat , it will change to the DOSBox install directory ( C:\Program Files\DOSBox-0.63 ) and run DOSBox with the given settings. The first parameter tells DOSBox to automatically mount and start the Champions of Krynn executable. The optional -fullscreen and -exit parameters tell DOSBox to run in fullscreen mode and to automatically exit once Champions of Krynn is done running.

Now you're ready to enjoy Champions of Krynn as it was meant to be enjoyed. Possibly even better. Note that, should a DOS game be running too slowly or quickly, you can decrease DOSBox's emulation speed by pressing Ctrl-F11 or speed it up by pressing Ctrl-F12.

Even with all this tweaking, there is one inconvenience you can not avoid: manual-based copyright protection. Many DOS games enforce copyright protection by referencing content in their printed materials, usually in the form of a question whose answer is contained somewhere in the game's instruction manual. If you don't happen to have a particular DOS game's manual, you may be able to find a digital copy on its install disk or on the Web.


7.3.4. Running Games with Proprietary Memory Managers

While the preceding steps should cover most older DOS games, DOS programs that use large amounts of RAM may require a few extra steps to run under DOSBox. Let's take a look at an example involving Ultima 7: The Black Gate, a game known for both quality gameplay and a frustrating startup process (due in no small part to its custom memory manager, Voodoo).

The Ultima 7's installation progresses mostly without incident from the Complete Ultima 7 CD and you should be able to run the installer directly from the CD in WinXP. The installation program queries for sound card brand and settings. By default, DOSBox emulates a SoundBlaster 16 at port 220 with IRQ 7 and DMA 1. The closest match in the install program is a Sound Blaster Pro with the same settings. The installer will then complain about your PC being in protected mode and offer to make a boot disk. We will ignore the warning and the offer and solve the problem in a much cleaner way.

First, let's try running Ultima 7 using the same method we used for Champions of Krynn. Start up DOSBox from the Start menu and mount the Ultima 7 directory ( C:\ULTIMA7 ). Next, try starting Ultima 7 by typing ultima7 at the C: prompt. The message shown in Figure 7-5 appears.

Figure 7-5. Ultima 7 can't run with other EMS managers

It seems that Ultima 7 can't run in DOSBox because of the way it is handling expanded memory. Luckily, DOSBox's memory handling can be changed by editing its configuration file. The default configuration file, dosbox.conf , can be found in the DOSBox directory ( C:\Program Files\DOSBox-0.63 for Version 0.63 of DOSBox). Since we don't want to change the DOSBox configuration for all the programs it runs, we'll make a copy of the configuration file and call it dosbox_u7.conf . Now, open the new configuration file and locate the following section:

 [dos] # xms -- Enable XMS support. # ems -- Enable EMS support. xms=true ems=true 

Disable EMS support like so:

 [dos] # xms -- Enable XMS support. # ems -- Enable EMS support. xms=true ems=false 

Disabling EMS support is essentially the same as running emm386.exe without EMS support and allows Ultima 7's Voodoo memory manager full reign of memory handling.

7.3.5. Tweaking Speed

You can also set DOSBox's initial emulation speed and frame skipping to values that work best for your computer by changing the settings in the following sections of the configuration file:

 [render] # frameskip -- How many frames dosbox skips before drawing one. # aspect -- Do aspect correction. # scaler -- Scaler used to enlarge/enhance low resolution modes. # Supported are # none,normal2x,advmame2x,advmame3x,advinterp2x,interp2x,tv2x. frameskip=0 aspect=false scaler=normal2x [cpu] # core -- CPU Core used in emulation: simple,normal,full,dynamic. # cycles -- Amount of instructions dosbox tries to emulate each millisecond. # Setting this higher than your machine can handle is bad! # cycleup -- Amount of cycles to increase/decrease with keycombo . # cycledown Setting it lower than 100 will be a percentage. core =normal cycles=3000 cycleup=500 cycledown=20 

Now that the new configuration file is ready, you can pass in the name of the file as a runtime parameter. As with Champions of Krynn, you must define a batch file to run Ultima 7 using custom DOSBox settings. Create a file called run_u7.bat , open it for editing, and add the following:

 cd C:\Program Files\DOSBox-0.63 dosbox C:\ULTIMA7\ULTIMA7.COM -exit -fullscreen -conf dosbox_u7.conf 

The -conf parameter allows you to specify a configuration file to use instead of the default dosbox.conf . In this case, we use dosbox_u7.conf . Now that the batch file is ready, you can double-click on run_u7.bat and see what happens (see Figure 7-6). Now that's a sight for sore eyes.

7.3.6. Running Games that Require CDs

Instead of having the player keep hard copy manuals on hand for reference, some later DOS games implemented copyright protection by requiring that a game CD be inserted in order to be played . Playing a CD-based game in DOSBox requires a few extra steps to have DOSBox recognize a CD-ROM drive. Let's take a look at one such game and see how we can get it running.

Figure 7-6. Ultima 7, up and running

Privateer, a 1993 space-flight sim from Origin Systems, was released along with Strike Commander on a single CD. In order to play the game, users must install it and, as most of the game's data files stay on the CD, have the CD in their computer.

As before, begin the process by running the install program from the Privateer/Strike Commander CD. Set the music and sound card values, remembering that DOSBox emulates a Sound Blaster 16 at port 220 with IRQ 7 and DMA 1. Once installation is complete, you must continue on to the process of getting DOSBox ready to run Privateer.

Like Ultima 7, Privateer uses its own proprietary memory manager, called JEMM. Also like Ultima 7, Privateer requires that you disable DOSBox's EMS emulation by changing the line ems=true to ems=false . Once you make the change to the configuration file, save it as dosbox_priv.conf .

To get DOSBox to run Privateer with these new settings, create a batch file called run_priv.bat containing the following:

 cd C:\Program Files\DOSBox-0.63 dosbox C:\PRIVATER\PRIV.EXE -exit -fullscreen -conf dosbox_priv.conf 

The batch file automatically starts Privateer using DOSBox. However, when you try it, you'll notice that something is wrong, as shown in Figure 7-7.

Figure 7-7. Privateer can't run if DOSBox can't see the CD

DOSBox is unable to locate the Privateer CD because it has not been told to mount the CD-ROM drive. To mount a CD-ROM drive in DOSBox, you use the mount command as in the following example:

 mount d d:\ -t cdrom 

As with mounting hard drive directories, this mounts the CD directory in the second parameter as the drive letter identified by the first parameter. Many DOS games assume that D: is the CD-ROM drive, so you should mount the CD-ROM drive as the D: drive in DOSBox. The -t cdrom parameter flags the mounted directory as a CD-ROM drive ( otherwise , DOSBox would treat it as a hard drive).

It would be nice to not have to explicitly mount the CD-ROM drive each time you run Privateer. Fortunately, you can modify run_priv.bat to have DOSBox run the mount command before attempting to run Privateer as seen here:

 cd C:\Program Files\DOSBox-0.63 dosbox C:\PRIVATER\PRIV.EXE -exit -fullscreen -conf dosbox_priv.conf 
 -c "mount d d:\ -t cdrom" 

The -c "mount d d:\ -t cdrom" parameter that we have added tells DOSBox to execute the command mount d d:\ -t cdrom before running PRIV.EXE . Additional commands can be specified using the additional instances of the -c parameter. Now that you've made the change, save the file, doubleclick run_priv.bat , and you should see the screen shown in Figure 7-8.

Figure 7-8. Privateer, ready for action

You're now ready to re-live the 90s and enjoy Privateer in its full glory . There is, however, one more step you can take to further streamline your experience. You can try hacking Privateer so that you don't have to have the CD inserted to play.

7.3.7. Hacking the Hack

The process for executing a no-CD hack on a game varies wildly depending on how CD dependence is implemented. Some games contain a reference to the CD in a configuration file. In the case of Privateer, this data can be found in PRIV.CFG . Opening up PRIV.CFG with Notepad reveals the following:

 =D:priv.tre 

It usually takes a bit of guesswork to figure out what data in a configuration file means. In this case, it's fairly obvious that it's referring to a file on the D: drive called priv.tre , which happens to be Privateer's primary data file. This suggests a certain course of action. First, copy priv.tre into the Privateer directory ( C:\PRIVATER ). Next, modify PRIV.CFG like so:

 =C:priv.tre 

Finally, you should no longer need the -c "mount d d:\ -t cdrom" when running DOSBox, so remove it from run_priv.bat . Now, when you run the game, Privateer will check the C: drive for priv.tre and you should no longer need a CD to play.

With DOSBox and some creative configuration, you can get most DOS games to run as conveniently as games designed for Windows. Remember, if you have trouble getting a DOS game to run or to stop requiring a CD, do a Google search for advice, maybe entering " name of game dosbox help." Chances are someone else has been working on the same problem.

Robert Ota Dieterich



Retro Gaming Hacks
Retro Gaming Hacks: Tips & Tools for Playing the Classics
ISBN: 0596009178
EAN: 2147483647
Year: 2003
Pages: 150
Authors: Chris Kohler

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net