Skip navigation.

Posts tagged with "dosbox"

Most Useful Options in DOSBox.conf

, ,

[sdl]
fullscreen

If set to "true", DOSBox starts in fullscreen by default; if set to "false", windowed. Duh. (There are many other options whose possible values are "true" or "false", it's like on/off.)
__________________

[sdl]
fullresolution

The resolution which DOSBox will try to set your screen to when working fullscreen. Its values can be "original"--the game's own resolution--or any particular setting like for example "800x600", "640x480", etcetera.

You must take into account that modern graphic hardware won't likely support every old resolution from DOS days, so if we leave "original" as default and try to play fullscreen, DOSBox may try to use a resolution either the card or the screen don't support, they won't be able to comply and will choose another resolution, and we may end up with a small game image surrounded by a big black frame.

DOS games usually had 320x200 or 640x400 or 640x480 pixels resolutions. I recommend changing the default value to "640x480", because it's the one of the three that's likely to be supported by modern graphic hardware: the games whose original resolution is 640x480 will display perfectly, the 640x400 ones will fill the whole width and two black strips will appear at the top and bottom, like a Cinemascope movie on TV. Besides (if we leave the "scaler" option as default), the image from games whose original resolution is 320x200 will be enlarged into 640x400, and it will be displayed just as well filling the whole width, without losing a bit of definition.
__________________

[sdl]
windowresolution

The size of the window that DOSBox will be running in when not in fullscreen. It can also be set to "original" or a fixed resolution, and if it's larger than the game's original one we can make DOSBox scale the image bigger--because 320x200 pixels look very very small in modern resolutions.
__________________

[sdl]
sensitivity

The higher this value, the faster the mouse pointer will move inside DOSBox, and the lower the slower. Thus we can adjust the exact desired speed for each game.
__________________

[dosbox]
captures

Folder where our screenshots and clips will be stored when captured.
__________________

[dosbox]
memsize

Size of RAM memory emulated. The default size is 16 MB which is more than enough for most DOS games. You're not recommended to change this unless necessary because many old games may crash if they find more than 16 MB.
__________________

[render]
frameskip

If our processor isn't fast enough for a game, and we tried everything else (the options in [cpu] above all), we can set this higher than "0" to relieve it of some work and get hopefully better performance but with choppier animations. (The value is the number of frames that DOSBox skips before drawing the next one: if it's "1" only half of the frames will be drawn, if "2" a third, if "3" a quarter, etcetera.)
__________________

[render]
aspect

Enable ("true") or disable ("false") aspect correction. So if we enable it, the image will fit our screen whatever the resolutions of the game and screen are. Sounds good at first, but I recommend to leave it disabled (if your graphic card supports at least 640x480 as explained under "fullresolution") as default for two reasons: first and foremost, image definition is lost in the process; and second, aspect correction can be a costly process and may impact performance.
__________________

[cpu]
core

Mode of virtual processor emulation. The "dynamic" mode has the advantage of making the most out of our computer's power, so we can reach around twice as high cycle counts as in other modes. We'll have to use this dynamic mode for the latest DOS games that need a powerful processor.

The disadvantage is that some games may crash in this mode, but work fine in "normal" CPU mode; the good news is that most of these are old and don't need high cycles anyway.

We can leave it as default in "auto", that makes DOSBox use the normal mode for old real-mode games and the dynamic one for protected-mode games, that usually need much higher cycles. (Don't worry if you don't know what the real and protected modes of x86 processors are--neither do I.)
__________________

[cpu]
cycles

Very important, this value's the speed of the virtual processor emulated by DOSBox for our DOS programs. As we said it's related to "core", since our computer will be able to emulate higher cycles in "core=dynamic" than in "core=normal". Increasing the cycles above this limit, which for each mode depends on the power of our real processor, won't achieve anything good.

This option can be set to a numerical value, or "auto". The "auto" setting tells DOSBox to use 3000 cycles for old real mode games, and to emulate the fastest processor possible for protected mode games.

(Maybe you find it strange that a DOS game that worked fine in an old 486 CPU now may run too slow with DOSBox in a much more powerful machine; but it's easy to understand if you consider that DOSBox's compatibility's so good because it emulates hardware--that is hardwired electronic circuits--through software--a program.)
__________________

[cpu]
cycleup

Amount that cycles go up every time Ctrl+F12 is pressed while DOSBox is running. A value below 100 is understood as a percentage of the previous cycle count; a good setting is 10 or 20 (per cent).
__________________

[cpu]
cycledown

Amount that cycles go down every time Ctrl+F11 is pressed while DOSBox is running. The same about values below 100 applies here.
__________________

[sblaster]

Under this heading, the settings for the virtual Sound Blaster sound card are found. It's best not to change them but leave as default, and remember the values when the games or their setup programs ask about them, as the basic tutorial explains: Sound Blaster 16 card, port/address 220, IRQ 7, and DMA 1.
__________________

[dos]
ems

Enable ("true") or disable ("false") expanded memory (something used formerly in x86 processor's real mode). Some games need it, whereas other few won't work if this option is enabled; so we can leave it enabled as default and disable it for the necessary games.
__________________

[dos]
keyboardlayout

Keyboard layout, duh. This setting's a feature of the latest DOSBox versions, the old ones had the USA keyboard only. We can change the default value to the national code we prefer, for example "sp" for Spanish keyboard layout. This makes typing easier for non-americans, but be warned that some games (I'm thinking of X-Wing for example) are designed to be played with an american keyboard, and if we change the layout we'll find the controlling keys (which can't often be customized) out of reach--and so to play these games it's better to leave the "us" option even if that's not our usual preference.
__________________

[autoexec]

Under this heading there are no specific options, but every line put here will be run as a command when starting DOSBox. It's the place to insert instructions for virtual drive mounting, among other things.

Advanced DOSBox Tutorial

, ,

This tutorial explains how to use DOSBox in all its might and with no need of third-party programs (frontends). It's certainly more difficult than the basic tutorial (recommended for beginners), but the main reason why this is going to be so long, is that every single step is explained with detail so that it's impossible to get lost.

We'll see how it's not so difficult to create shortcuts that directly run in DOSBox each game with their appropriate configuration:


First let's take a look at the file where DOSBox stores its default configuration. It's a text file we can modify with the Windows Notepad or any other editor; it may look rough to the average user, but in the end changing options here is the same as changing them using a frontend like DBGL. To access this file we can go to "Start > Programs > DOSBox-X.XX > DOSBox.conf".



(We briefly came across this file already at the end of the basic tutorial.) The lines starting with "#" are comments with no effect, and explain the meaning of the configuration options, that is the rest of the lines in the form "(option)=(value)". As you can see the options are grouped in 14 headings whose names are inside square brackets ([sdl], [dosbox], [render], [cpu], [mixer], [midi], [sblaster], [gus], [speaker], [joystick], [serial], [dos], [ipx] and [autoexec]).

The most important options are reviewed here, but I don't recommend reading them all now. Rather go on with this tutorial, and afterwards you'll look up the options as soon as you need them.

Some people may be thinking by now that it would be impractical to edit dosbox.conf every time we need to change any setting for this or that game, and it's better to make different profiles with a frontend. But the point is that we can do the very same without need for a third-party program: on the one hand we can create as many configuration files as we want, and we can easily tell DOSBox to use a particular one for each game; and on the other hand we can load more than one config file in the same DOSBox session. (The second feature is new in DOSBox versions 0.70 and higher, old versions can use a different file each time, but only one at a time.) Let's clarify this.

Before we continue let's get a little organized. We'll create a folder wherein to put all the shortcuts we'll be creating (maybe someone will prefer to have them scattered over the Desktop or wherever). To create it right-click on a blank space where you want the folder (for example the Desktop) and select "New > Folder", and name it--for example--"DOSBox".


Now the first shortcut we're creating is the very folder where DOSBox is installed; this way we'll be able to readily access the config files. So we double-click on the new folder we just created to open it, and then we right-click again on a blank space, this time inside the folder, and select "New > Shortcut":


One the ensuing dialog box, we must click on "Browse..." and find the existing folder where DOSBox is installed:


As I said in the basic tutorial, I recommend installing DOSBox someplace where elevated rights aren't needed to write, preferably within the Shared Documents; and the same goes for the games themselves. Otherwise you will experience problems in Vista, or in previous Windows versions if using a limited account.

After selecting the folder, clik on "OK", then "Next >", and "Finish". Finally, use the shortcut you just created (double-click) to access the DOSBox program folder. Once inside you can open and edit dosbox.conf (if Windows doesn't know what program to use when you double-click on dosbox.conf, chose "Select the program from a list" and associate .conf files with the Notepad). But what's more interesting, you can create new config files and assign them to particular games as profiles.



The easiest way of creating a new config file is copying dosbox.conf and editing only the options we need to change for a certain game or set of games. This works for old DOSBox versions, but new ones also allow us to load several config files in the same session: DOSBox would load the first configuration, and when loading the next one the new options would have preference, but the config options not specified in the second config file remain as the first one set them.

The idea is always loading a default configuration in dosbox.conf, while the other config files for particular games will only include the options that we want different from the default. Whenever we want to change the default configuration we won't need to edit every single config file, just dosbox.conf that contains the default config--the options common to every session unless another config file says otherwise. (Again, this is a feature of DOSBox versions 0.70 and higher.) If you haven't grasped it, don't worry because we'll be seeing an example shortly.

As we said, we can start from a copy of dosbox.conf, edit the necessary lines, and then we'd delete the rest of the lines we didn't change, since they're already in dosbox.conf, which will always be loaded before any other config file. When deleting the unchanged options, be careful to keep the headings--the lines with words between square brackets ("[]").

So first we make a copy of dosbox.conf. We were inside the DOSBox program folder, here we drag with the right mouse button the dosbox.conf file to a blank space in the same folder, and select "Copy Here":


While the newly created file's selected, press F2 to change its name (to something related to the config it will store, typically the game it will be associated with). Then edit the necessary lines and delete the rest, keeping the headings. (Remember that here's an explanation of the most important options in DOSBox config files.) For example, this is my config file to run UFO - Enemy Unknown:


The rest of the options will remain as default in dosbox.conf. Don't worry about the lines under "[autoexec]", we'll explain that part last. If a game works fine with DOSBox's default config (what will happen a lot) there's no big need to change any setting, and so you can leave this file blank except for the [autoexec] section; later we'll see what lines you need to write here.



Anyway, once you have the config file we want, save it. Now we want to create a shortcut which will run DOSBox with that configuration, and every time we wish to use that config (like running a particular game) we'll just double-click the shortcut. So we go back to the folder we created that so far contains only a shortcut to the DOSBox program folder, and create another shortcut just like before (right-click, "New > Shortcut"). However this time the shortcut won't point to a folder but to DOSBox itself, so we click "Browse..." and select the dosbox program:


After selecting we click "OK", but before clicking on "Next >" we'll add the parameters which tell DOSBox what configuration to load. You have all the DOSBox parameters in the README.txt, but the one we'll use here is "-conf (filename)", that makes DOSBox load a config file, and as we said can be used more than once.

We want DOSBox to load first the default configuration in dosbox.conf, and then the specific options in a second file, in this example "ufo.conf". So in the "Type the location of the item" field, following what's already written without deleting anything of it, and after the quotation marks (if there are any), we write:

 -conf dosbox.conf -conf (filename)

In our example it would be like this:


(You may not see the ".conf" extension in configuration files, but if you've followed this tutorial and you have associated them with the Notepad as we said, and you can open them double-clicking on them, you must write the .conf extension here even if you don't see it. Anyway you could try with or without it until it works.)

We just did what we said we wanted: tell DOSBox that we want it to load the default configuration first, and then the specific one for a game or whatever. The latter overrides the former, but the options not specified in the second file will be left as the first one set them. We can create more "profiles" for more games in the same way, creating more config files (with a different name) and other corresponding shortcuts with the parameters "-conf dosbox.conf -conf (filename)".

By the way, at any moment we can correct the parameters right-clicking on the shortcut and selecting "Properties":




We've learned how to create config files and shortcuts that load those configurations. Then a simple double-click on the shortcut will start the desired game, and we won't need any other manipulation until we want to add a new game. (As you can see below, besides the shortcut to DOSBox's installation folder and another shortcut for each game, I also like to make shortcuts to DOSBox with the default configuration and no game--command line--, to the folder where DOSBox stores captured images and clips, and the one mounted by default as virtual drive C:


However I'm afraid many of you'll have been unable to make it work, and be at loss about what "mounting" and "virtual drive" mean. :bomb: Worry not, you may remember that I postponed the explanation of the "[autoexec]" heading of config files; sorry but an order was necessary, and now's the moment to go back to that--we'll be finished after this, promised. :wait:

DOSBox emulates (along with a full x86 machine) the old MS-DOS operating system that these old games were designed for, and DOS's interface was a command line--where instructions were typed and then entered with the Enter key--; so DOSBox's interface is a command line too (even Windows has a command line interface, even if most of you never need it). In this tutorial we'll write every command we need in the config files, so they'll be entered automatically every time we use the shortcuts.



The most important DOSBox command is "mount". It's difficult to understand at first, but DOSBox doesn't access our drives (discs) directly. Instead we must "mount" folders (or image files) as "virtual" drives of the DOSBox session. Our real drives' letters and the virtual ones' are unrelated, no matter if they coincide or not; for example we can mount the root folder of our (real) C drive as virtual C drive in DOSBox, but we can also mount any other folder of any other real drive as virtual C drive, or as any other virtual drive.

You'll find all the details of the mount command in DOSBox's README.txt, but using DOSBox for Windows, in order to mount a folder as virtual hard drive, the necessary command is simply

mount  (virtual drive letter)  "(real folder)"

for example

mount c "d:\oldgames"

Be warned that DOS won't support long filenames (with more that 8.3 characters or spaces or addition dots), and so DOSBox won't either inside its virtual drives (DOSBox won't crash but will shorten the filenames); however you may mount as virtual drive a folder whose name or path are long or includes spaces (but in this case you must include quotation marks as seen above), as long as its child folders (which will be seen as folders inside DOSBox's virtual drive) don't have long filenames.

In order to mount virtual floppy diskettes or CD-ROMs, we'll add to the mount command the-t parameter, followed by floppy or cdrom in either case. For example, the following instructions would mount a folder as virtual A: floppy drive, and our real E: CD drive as virtual D: CD drive:

mount a "d:\oldgames\game\disc1" -t floppy
mount d "e:\" -t cdrom

You can also mount image files instead of folders with the imgmount command instead of mount. (Actually if some copy-protected CDs don't work in DOSBox, their images may work.) Again you have all the options documented in the README.txt, for example in order to mount a certain image file as virtual D: CD drive it could be like this:

imgmount d "d:\oldgames\game\cd.cue" -t iso

To "unmount" a virtual drive (and be able to reassign another folder or image to the same virtual drive letter), the instruction is

mount  -u  (virtual drive letter)



We've learned to mount drives in DOSBox. The rest of commands we'll need are basically the names of the programs that start the games, and cd to change the active folder within virtual drives. When writing folder paths, the "\" symbol separates a parent folder (left of the symbol) from its child one (right), and when there's nothing left of "\" it represents the root folder. For example, the three following instructions

cd \
cd one
cd two

are totally equivalent to the single instruction

cd \one\two

(Just like "\" means the root folder, two suspension points ".." mean the current folder's parent one.)

The cd command switches active folders, but not drives. To change the active virtual folder, simply type its letter followed by two points ":", for example

c:
d:
a:



At last we know everything necessary for out shortcuts to start the games directly! :yes: (And in the meantime we've also learned how to handle DOSBox by hand from its command line.) To start a game we have to: mount--at least--a virtual drive where the game is, define it as the currently active one, then define the exact folder as the current one, and lastly we must call the program that starts the game.

We could mount always the same virtual hard drive by default--where all our games will be accessible in individual folders--in our dosbox.conf, and leave the rest of the commands for the config files particular to each game or profile; or we could place all the commands in the latter; or however we please. I'll illustrate an example of the first approach, which is the one I personally recommend.

So ideally all our DOS games will be in separate subfolders inside a folder which is in turn in the Shared Documents (or maybe a subfolder thereof according to your chosen organization). We'll mount this folder as the virtual C drive, so we need its full pathname. Don't worry if you're not sure about it, simply check the address bar, or the properties of any individual game's folder (be sure to get the full pathname and not only the portion that fits the width of the address bar or the properties window):


A possible example would be:

[autoexec]
mount c "c:\users\all users\documents\oldgames"
mount d "d:\" -t cdrom
c:

The first line (instruction) creates ("mounts") the C: virtual hard drive where all our DOS games will be found. It's just an example, replace the pathname between quotation marks with the one your games are in. (Notice that a folder with the same purpose is called "Users" in Windows Vista and "Documents and Settings" in XP.) However C is the recommended letter for the virtual hard drive since it's what many DOS games expect.

The second line mounts our D: real CD-ROM drive (if yours has a different letter replace the "d:\") as D: virtual CD-ROM drive so DOSBox can access it, and the last one places us in (sets as active) the recently mounted C: virtual drive where the games are.

If we ran DOSBox without parameters--for example from the Start menu or from any other shortcut that we haven't added the "-conf" parameters to, DOSBox would start the command line only and no game; but the C: and D: virtual hard and CD-ROM drives would be already mounted, and the first one would already be active (instead of Z:).

But what we want is the created shortcuts to automatically start their respective games, not just to load the particular configuration appropriate for them. For this purpose we only have to write the instructions that start each game in the [autoexec] section of each config file, so we don't have to enter them by hand into the command line every time.

Remember that the shortcut we created will load the default configuration in dosbox.conf as well as (and before) the specialized lines in the other one (ufo.conf in our example), and that includes the [autoexec] sections of both files. The instructions in both [autoexec] sections will be run (in the order specified in the shortcut parameters)--whereas the lines under the rest of the configuration headings ([sdl], [dosbox]...) are overridden every time an additional config file is specified. So, since the default dosbox.conf already has the lines above, that mount the necessary drives and set the hard one with the games as active, the only remaining instructions would be switching to the precise folder where the particular game is, and calling the program (executable) that starts the game. Going back to the previous example, the [autoexec] section of ufo.conf would be

[autoexec]
cd \xcom
call ufocd
exit

supposing that the game was for example installed in the real folder "C:\Users\All Users\Documents\oldgames\xcom"--that is the virtual folder "C:\xcom" according to the example mounting we did--, and that the executable to start the game is called "ufocd". The last command, "exit", would quit DOSBox once we end the game, so we don't have to do it by hand every time.



We've reached the end of the tutorial, :faint: but here you are some other commands you may find useful (again they're explained in detail along with others in DOSBox's README.txt):

loadfix takes up an amount of conventional memory, since some old games may crash if they find an unusually high value. It isn't usually necessary to specify parameters, just enter this command and then call the game.

keyb changes the keyboard layout--like the "keyboardlayout" option in the config files but within a single session. For example, the instruction "keyb sp" switches to Spanish keyboard, and "keyb us" to American keyboard.

boot boots floppy disc image files.

:hat: