Emulator:DOSBox

From Wah!ki
Jump to: navigation, search

The Right Way to Configure Wah!Cade for DOSBox

About

DOSBox emulates an Intel x86 PC, complete with sound, graphics, mouse, joystick, modem, etc., necessary for running many old MS-DOS games that simply cannot be run on modern PCs and operating systems, such as Microsoft Windows XP, Windows Vista, Linux and FreeBSD.

Configuration

Platform Version Device Exec Type commandline_format
Linux 0.74 Original executable file via batch file /usr/bin/dosbox D [rompath]/[name].[romext] -exit -conf [rompath]/conf/[name].conf

Getting Started

Prerequisites

This guide assumes that the following apply to all of your DOS games:

  • The game's files exist on your harddrive. They are either already unzipped from a ZIP archive or extracted via an executable self-installer program.
  • The game must be run from an executable file, as opposed to being self-booting.

This guide does not cover how to run games from changeable media like floppy disks or CD-ROMs.

Installing DOSBox

Visit DOSBox's download page for the most up-to-date versions of the software. Choose and download the package appropriate for your system.

On Debian-based systems like Ubuntu, simply open a Terminal and type:

sudo apt-get install dosbox

Similarly, on Fedora, type:

sudo yum install dosbox

Follow the prompts and DOSBox will be downloaded and installed automatically. Test the installation by typing dosbox at the prompt. Type exit in the DOSBox window that appears to close it.

DOS Game Folder Structure

Create a main folder where all your DOS games will be kept. The example used in this guide will be named ~/dosgames.

Create the following subfolders in ~/dosgames:

  • conf
  • keymaps
  • captures
  • snaps
  • movies

The purpose of each subfolder is explained later in this guide.

Each DOS game will be kept in its own subfolder. Examples are provided below:

  • KEEN1
  • RAPTOR
  • ROUND42
  • SCORCH
  • XCUTE

It is important to name the games' subfolders using only eight characters or less, because actual DOS does not support file and directory names longer than 8 characters. DOSBox behaves the same way. A good rule of thumb is to name it similar to the game's main executable file.

Note that in this guide the game subfolders are named using capital letters and the non-game subfolders are named in lowercase letters. This convention is handy for differentiating those that contain game files apart from those that do not.

Batch (.BAT) Files

In the ~/dosgames folder, create a new text file. Name it identically to a game's subfolder, and give it a .BAT file extension. This is a DOS batch file. The batch file will perform two basic tasks:

  • Change the current working directory to the game's subfolder.
  • Run the executable, which may be either an EXE file or, particularly with older games, a COM file.

This example batch file changes to the directory in which the game ROUND42 is located, and then runs it:

@echo off
cd round42
round42.com

The "@echo off" statement hides the batch commands from view as they are processed in the DOSBox window. It is optional, but recommended.

Save and close the batch file. Test it in a terminal:

dosbox ~/dosgames/ROUND42.BAT

If all went well, DOSBox should run the game. Exit the game, or force terminate using CTRL-F9 if necessary.

Repeat this batch file creation for all games.

DOSBox Configuration Per Game

Why Per Game?

It is important to maintain individual DOSBox configurations for each game due to the wide diversity of games on DOS, and the longevity of DOS as a gaming platform. While a given console emulator configuration works identically for all games on the system because the hardware remained unchanged from game to game, a DOS game from 1982 is going to require a vastly different DOSBox configuration than one from 1996 because computers evolved significantly in that 14-year span.

CONF File Creation

On DOSBox's first run, it creates a config file in ~/.dosbox named dosbox.conf. The filename may contain a version number on Linux. Copy this file to ~/dosgames/conf.

Make as many copies of this file as there are DOS games, naming each one identically to the game's subfolder name with a .conf extension (e.g.: ROUND42.conf).

Editing a CONF File

Open one a conf file in a text editor. The following are common things to change:

fullscreen=true
fulldouble=true
fullresolution=original
windowresolution=original
output=openglnb

There is an option called mapperfile. This should be set to a (currently) nonexistent file in the ~/dosgames/keymaps subfolder. Following the ROUND42 example:

mapperfile=~/dosgames/keymaps/mapper_ROUND42.txt 

Adjust settings in each games' conf file, making sure to set the mapperfile paths properly for each one. Also edit the captures option. Set it to ~/dosgames/captures. This is explained later on.

Some older games may require different machine types in order to work properly. For example, the machine option must be set to tandy for games that ran on the Tandy 1000 line of computers.

For older games that did not use sound cards, pcspeaker should be set to true in order to emulate PC "beep" sound effects through the system sound card.

There are also options for frameskipping, cpu type, and many others. Usually these can be left as they are. DOSBox's official documentation on these options is available at this link: Dosbox.conf.

Test a game using the appropriate conf file:

dosbox ~/dosgames/ROUND42.BAT -conf ~/dosgames/conf/ROUND42.conf

Again, the game will come up. This time, using the defined configuration. If fullscreen was set to true, the game will fill the entire window.

Run the Games' Setup Utilities

It is important to run the setup/install utilities for the games that have them. Display modes (CGA, EGA, VGA), sound settings (Sound Blaster, AdLib), and controls need to be configured just as if this were actual DOS.

Execute the setup utility with DOSBox. In a terminal window:

dosbox ~/dosgames/GAMENAME/SETUP.EXE

Usually, default Sound Blaster settings work just fine. If necessary, match the IRQ and DMA settings to those defined in the corresponding conf file.

Refer to the game's README files or help docs for more info.

Key Mapping

Creating a Custom Mapper File

While playing a game in DOSBox, press CTRL-F1 to activate the keymapper. Complete documentation on the keymapper can be found here: Mapper. Upon exiting the keymapper, a keymap file for the game is save in the ~/dosgames/keymaps subfolder. To reset a game's keymapping, simply delete this file. A new one will be generated the next time the keymapper is activated while playing the game.

Snaps / Movies

Creating Screenshots

While playing a game in DOSBox, press CTRL-F5 to take a PNG screenshot, and it will be saved to the captures subfolder specified in the game's conf file. It will be named the same as the game's name in lowercase letters with a numeric suffix.

Screenshots should be stored in ~/dosgames/snaps. As with all platforms in Wah!Cade, image filenames must exactly match the names of roms. The "roms" in this case are the batch files created.

Follow the same procedure to make screenshots of title screens, game-over messages, high score listings, etc.

Recording Movies

While playing a game in DOSBox, press CTRL-ALT-F5 to begin recording an AVI movie. Press CTRL-ALT-F5 again to stop recording, and the resulting movie will be saved in the captures subfolder specified in the game's conf file. It will be named the same as the game's name with a numeric suffix.

Movies should be stored in ~/dosgames/movies. As with snaps, the movie filenames must exactly match the names of the batch files.

Adding DOSBox To Wah!Cade

In Wah!Cade Setup Editor, under the Emulators tab, add DOSBox as a platform. Set the rom path to ~/dosgames, rom extension to BAT, commandline format to "[rompath]/[name].[romext]" -exit -conf "[rompath]/conf/[name].conf", and the artwork 1 path to the snaps folder.

Alternatively, edit the dosbox.ini file in ~/.wahcade/ini accordingly:

### dosbox.ini (wahcade v0.99) ###
### by codefenix ###

emulator_title                          DOSBox

### List Generation Settings ###
rom_path                                ~/dosgames
rom_extension                           BAT
dat_file                                
nms_file                                
catver_ini_file                         
list_generation_method                  rom_folder

### Execution Settings ###
emulator_executable                     /usr/bin/dosbox
commandline_format                      "[rompath]/[name].[romext]" -exit -conf "[rompath]/conf/[name].conf"
alt_commandline_format_1                
alt_commandline_format_2                
game_specific_config_path               
  
### Artwork Locations ###
artwork_1_image_path                    
artwork_2_image_path                    
artwork_3_image_path                    
artwork_4_image_path                    
artwork_5_image_path                    
artwork_6_image_path                    
artwork_7_image_path                    
artwork_8_image_path                    
artwork_9_image_path                    
artwork_10_image_path                   
movie_preview_path                      
movie_artwork_no                        1

### Screen-Saver Settings ###
enable_music_in_screensaver             0
saver_type                              slideshow
movie_path                              
movie_fullscreen                        1
quit_delay                              30
wrapper_executable                      
wrapper_commandline_format              [name]
scr_file                                

### External Application Settings ###
ipc_file_or_path                        
app_1_executable                        
app_1_commandline_format                
app_2_executable                        
app_2_commandline_format                
app_3_executable                        
app_3_commandline_format                
auto_launch_apps                        

### Additional Settings ###
music_path                              
lcd_display_file_path                   
lcd_fe_text                             

### Settings used by MAMEWAH ###
current_list                            0

Note that the -exit parameter is used in the commandline format. This tells DOSBox to close itself after the game terminates.

Launch Wah!Cade, select DOSBox as a platform, and browse the list of games. Select any game and start it, and DOSBox will use the appropriate config and keymap settings automatically. Control is returned back to Wah!Cade upon exiting the game.

Cabinet-Friendliness Tips

A game's ability to be 100% playable using MAME-like arcade controls is referred to as its cabinet-friendliness. Not all DOS games play very well using these controls, as many require full use of the keyboard. Sometimes a game's keys may be redefined to match those used in MAME. However, if a game does not support key redefinition, it then becomes necessary to make creative use of DOSBox's built-in keymapper (see above).

See: Cabinet-Friendly DOS Games

Exit on ESC

By default DOSBox can be force-terminated by pressing CTRL+F9. This is called "shutdown". Using the keymapper, remap shutdown to the ESC key for games that do not already have a simple method of quitting.

External Links