DosBox 0.74 + DBGL: The DosBox Revolution

heartofchina

With the recent recompilation of DosBox 0.74, bundled with the DBGL GUI interface, PtitSeb has provided better support than ever for DOS games on the Pandora. There’s a bunch of stuff that simply was not running too well before to be playable, that it’s really worth coming back again on what this new release can do and what this changes for the Pandora.

So what did PtitSeb do this time ? Well, he produced a new port of DosBox using the most recent sources (0.74 from May 2010, yeah well DosBox does not get many new stable versions these days) with his most updated compilation chain (as optimized as can be for Pandora, with the latest GCC). He bundled it together with a nice little launcher called DBGL (using java, though…), that makes it super easy to tweak several options for each game one-by-one. As a launcher, DBGL is pretty nice and effective. Its interface may be a little crowded but it works just nicely on the Pandora screen. Note that all screenshots following are coming from my Pandora.

dbgl

DBGL is nicer than your usual DosBox launchers as it takes care of DOS games with CD-installation as well, by auto-mounting images and creating the right folders and stuff like that. Until now it was far from being straightforward to install and play CD games on DOSBox and DBGL removes most of the pain.

Adding a game is simple enough. You click on the “Add Game Wizard” button and it will first ask you for the name of the game, and whether it requires any installation or not. The name field is used to download information about the game in case you are online at the time. The other selection will define how complex the process will be. If it requires no installation, you will simply have to provide the path to the executable file and the setup file, and that’s it. If installation is required, you’ll need to select or mount the install medium/directory and let it go through the installation process – DBGL should automatically detect in the end that the installation is over and let you go on to complete the addition of your game.

But that’s not all. PtitSeb included support for 3dfx (the first Voodoo 3D graphics card available on PC) and their glide API, using OpenGlide (and glshim). This effectively brings 3D acceleration to the DOS games that did support it at the time (they are only a few of them, but as we will see below, it can make a huge difference).

To make OpenGlide work with glshim, PtitSeb had to modify glshim. The problem lied with the internal coordinates support in glshim. Up until now, glshim was using texture coordinates in 2 dimensions, which is enough in most cases, while the geometry in itself is stored in 3 dimensions as you would expect. But OpenGL and OpenGLES actually can use up to 4 dimensions (if you are interested to learn more about why it is so, I believe this post on gamedev clarifies the situation). Once PtitSeb added the appropriate support in glshim, textures started to display correctly with OpenGlide.

Finally, the latest improvement PtitSeb brought is the support for MT32 sound support. I have to admit I did not know what to expect. I had always been used to the way Soundblaster sounded like, and to me at the time it was clearly an inferior solution to the Amiga sound capabilities. But with MT32 sound… well the difference is not so clear anymore. It does sound MUCH better than you typical Soundblaster audio card MIDI. While the MT32 standard progressively disappeared with the introduction of CD audio and General MIDI, it was widely supported in the 90s by numerous DOS games.  Note that turning on the MT32 emulation will hit your CPU hard, so it’s not recommended to use it on games that are already not running too well with DosBox. But adventure games, for example, will benefit from it and it should show not too much of a gap in performance. As a good indicator, if your game runs fine with 3000 (emulated) cycles in DosBox, there’s a good chance turning on MT32 will not make it much worse. If you want to try MT32, you will need to do the following:

  • Find the MT32 roms somewhere, and don’t expect me to provide me a link…
  • Rename them as CM32L_CONTROL.ROM and CM32L_PCM.ROM, or MT32_CONTROL.ROM et MT32_PCM.ROM depending on the rom set you were able to find.
  • Go in appdata/dbgl/.dosbox, find the dosbox.conf file and edit it to ensure that it reflects the mt32 settings such as :
mpu401=intelligent
mididevice=mt32
mt32.romdir=/media/yoursdcardname/path/to/your/mt32roms/
midiconfig=

You can then enjoy MT32 sound by default. Note that it does not mean that it will be used by all games without doing anything. For most titles you need to run the setup file and again and ensure that you select “Roland MT32” or a similar annotation during the install/setup process so that the game will try to support it when starting up.

Here's an example of a setup where you have to indicate whether you want to use a Roland Card or not.

Here’s an example of a setup where you have to indicate whether you want to use a Roland Card or not.

If you do that, you should be on your way to enjoy MT32 sounds! Here is below the famous adventure game Rise of the Dragon and its intro with glorious MT32 emulation. It’s almost as good as the Amiga version, yet the adapted Amiga soundtrack is even better, using samples instead of MIDI sounds. Still, there’s no denying the MT32 version beats the Sound Blaster one hands down.

But let’s leave MT32 aside for now.

If you were only playing relatively older DOS releases (let’s say, anything until the early 1990s), then this release is not going to change significantly what you can do with this release. Where this new DOSBox shines is for more recent, last generation DOS games support, just before Windows 95 took over and started the WIndows-driven generation of games. At the same time, it’s fair to say that there’s a bunch of games from the 80s and 90s that have not aged very well. And I’m not just talking about graphics or sound, because those aspects are obviously improving over time. GUI problems were numerous back in the days, and the structure of the gameplay sometimes got in the way of what you really wanted to to do.

But you don’t want me to stay in theoretical terms right ? What games actually run well with this release ?

Wing Commander III: this is, somehow, mindblowing that such a massive game can run so well on the Pandora. I remember very well the first time I played Wing Commander III, sometimes in 1994, and the massive configuration it required at the time to run properly. On the Pandora you need to tweak the settings a little, whether you are viewing videos/cinematics or in the game. The cinematics tend to have stuttering sound if you set up DosBox with too many cycles of emulation, but somewhere between 10 000 and 12 000 is just right. In-game, unfortunately, that setting is too slow, so you need to make it run at 16 000 cycles or so to get a good enough performance, at least in the first missions.

Needless to say, when you approach big ships with higher poly count, frame rates will drop significantly, so I’d rather say it’s borderline playable. But it’s still amazing nonetheless, and I can only imagine how well it will/should run on the Pyra.

Sim City 2000: it works perfectly, and that’s a hell of a good city builder if you like the genre. Obviously it cannot touch anything like Cities:Skyline in terms of flexibility and depth of simulation, but on the Pandora that’s probably the best city builder you can get these days. It runs in SVGA so you do not need to use a scaler to have it full the screen, as it takes 640*480 by default.

simcity2000

Caesar II: it was certainly working on previous DosBox versions, but there was a noticeable lag between what you were doing on screen and what changed based on your action. This version of DosBox makes it way more playable and enjoyable. Here again it uses SVGA so there is no need to use a scaler to make it fill the screen – so you can get some extra speed this way.

Command & Conquer (CD version): Just WOW! Running C&C on Pandora is really a blast. Everything works as expected: the video movies, the CD music (nothing like the crappy/generic music we get nowadays in most games), and of course the gameplay. It feels at home on the Pandora screen since everything is properly sized and usable back in the VGA days. Ideally I would like to use the stylus, to play such a game, but it’s still very much playable with the nubs. Sometimes it slows down a little and shows some stuttering – adding some frameskip (2-3) helps making it feel more fluid.

CandC

Tomb Raider: in software mode, it does not run great. It’s pretty much a slideshow until you use something like frameskip 2 or 3 in order to speed things up and make it playable, But… switch to the 3dfx Glide mode, and this is night and day! With 3D acceleration the framerate jumps to the 10s of FPS, and the game looks GOOD and plays great on Pandora. Of course you can play the PS1 version with the resolution enhancer from Notaz, but that won’t beat the smoother textures of the 3Dfx Glide version.

Note that at that time (since I clearly remember it), Tomb Raider was used prominently to promote 3dfx’s technology – and it was clearly surpassing the PS1 version in about every single way. This opened the age of GPU cards that we are in today. PtitSeb had two issues to get Tomb Raider working – first he had to fix a crash that prevented the game to launch with OpenGlide, and then the CD music (or .mp3) support was broken – with the latest DBGL it should now work just as expected, CD music included. If you have Tomb Raider from Steam or GOG, you can simply copy all your files into a folder on your Pandora. Then…

  • Go into “Edit Profile”
  • Select the Mounting tab.
  • Make sure the Main field points to the tomb.exe in the TOMBRAID folder.
  • In “Mounting Overview”, ensure that you mount C as the root Tomb Raider folder (the one that contains all your files and folders from your Steam or GOG install)
  • In “Mounting Overview” click “Add”, then in the new windows select “Mount Image(s)” and Browse to find the file GAME.DAT and mount it as an .iso file. Note that the file may not appear in the browsing dialog because it is looking for .iso/.cue file so you need to change that filter to show all files.
  • Go in the Display tab.
  • Select the Experimental options sub-tab.
  • Ensure Glide appears as “true”.
  • Accept all changes, and you are now done!

Note that if you are using the original Tomb Raider files from the old days, 3Dfx support may not be baked in, so you would need a patch probably. But Steam or GOG make it much easier in that sense, since the 3Dfx support is already included by default.

Heart of China: an unusual adventure game taking place in China back when China was not known as a developed country. At the time the game was admired for the quality of its digitized graphics. It runs flawlessly on Pandora, once again, even with the MT32 sounds (which are highly recommended, the Sound Blaster is kind of horrible).

heartofchina

Destruction Derby: it was one of the first few textured 3D racing games that did not suck. An early game very much like the later Flatout series. It runs suprisingly well in DOSbox, and adding a little frameskip (1) makes it run pretty smoothly. Now, this game has aged, so there’s probably better racers to have out there via PS1 emulation for example, but it’s a great showcase on how well 3D games can run via DOSbox.

Willy Beamish was another adventure game from Dynamix, using a cartoon style of graphics. I haven’t played the game enough to judge how good it is, but it runs just fine once again in DOSBox and that’s one of the many non-SCUMMVM games you can only enjoy with DOSBox at this stage.

willy

Elite II: Frontier: The sequel of Elite is a little bit slow on Pandora, but then it was a little bit slow on PC even at the time unless you had one of the most powerful machines. It’s still playable and I still find it cool that it was a 600k game with real 3D and textures,  where you could land on planets and explore so many stellar systems. A classic.

Earthworm Jim: works perfectly, and looks very smooth. The PC had a pretty bad reputation for the quality of its scrolling in 2D, but by the time of EJ1 several platformers had learnt how to deal with the hardware to create a console-like experience.

Tempest2000: it is said that the best version of that game is probably on the Jaguar. I can’t really say, but the PC version runs just fine on DOSbox as well. Yet the game is pretty hard.

tempest2000

Balance of Power (1990 Edition): the original Balance of Power by Chris Crawford was a legendary game on its own, the sequel is a refreshed version with a newer setting, later in the Cold War. If you are unfamiliar with the game, it’s basically a diplomatic challenge, where you play either the USSR or the USA, and you try to increase your global “prestige” (i.e. marking diplomatic victories against your rival) while avoiding a nuclear conflict (leading to game over). There’s very little graphics on this game except a global map, everything else is available through texts and some graphics.

bop-iraq

The 1990 edition only runs on Windows 3.1 (not just DOS), but DOSBox can handle Windows 3.1 with no issue either. Once you put the Balance of Power executable within your Windows 3.1 files, it appears as another shortcut that you can create and you can play this game flawlessly in DOSbox too.

bop-syria

GTA (the first one). It’s one of the few games that can use OpenGlide, and apparently based on PtitSeb’s tests is runs very well with the 3D acceleration. I could not try it at the time of this article but will definitely try to give it a go soon.

In general, in case a game does not work as fast as you’d like, you could follow some of the following tips:

  • Change the sound settings from MT32 to Sound Blaster. There, much better. But your ears will suffer.
  • Select a game, “Edit profile”, go in the Machine tab, and change the “Core” from “auto” to “dynamic”, and you can also tweak the cycles to a specific value instead of letting it be “auto”. Note that anything above 10 000 cycles is going to be pretty tough on the Pandora CPU, so you should know the boundaries there.
  • If your game runs in SVGA: go in the game profile, go in the Display tab, and remove the scaler if there’s any selected. A scaler is useless in the case of SVGA game, since it runs natively at 640*480.

Of course there are still some games that do not run exactly as you would expect, or some additional issues I encountered.

  • Star Wars Dark Forces is playable, but it feels a little bit too slow even with frameskip.
  • NASCAR Racing (the successor of Indy 500, from the excellent Papyrus Design) works great when you try it at first, but somehow this game includes an algorithm to auto-adjust its graphics quality based on your processor speed and quickly removes all textures as you race to keep the framerate steady. Smart, but inconvenient so you cannot choose by yourself how much trade-off you make between FPS and visual quality.
  • Rayman seems to work fine, except that it remains silent. In the beginning I could not get any sound at all, but once you mount the CD image of the game, sound effects at least start working. CD Music is still missing somehow… Note that this is not apparently a Pandora specific issue, many have reported this with DOSBox as well on other platforms.
  • Carmageddon: while it can use the 3D acceleration, it’s a little too slow anyway on the Pandora to be playable. We will have to wait for the Pyra for such things.
  • Remapping keys: DOSBox includes a built-in wrapper if you hit CTRL+F1 anytime while emulation is ongoing, but it’s not great. It feels a little clunky, its interface is messy and unintuitive, and somehow I got strange results with it… some games allow for the mapping of keys to be redefined in-game, and that is really for the best. If not, you could try your luck by creating/editing the mapper.conf file by hand, provided you know the corresponding key codes to use.
  • No Thumbnails: DBGL is supposed to be able to fetch thumbnails for each game in your library, but somehow this feature does not work in our port. It’s definitely not a deal-breaker, but if you wonder why it’s not working, well, we don’t know why.

DBGL has a baked in support for installing stuff from ISO images. It makes it very practical to install software like Wing Commander III. I went much more smoothly than I expected.

Apart from the above titles I mentioned, my main reason for using DosBox is that it’s the only way to play Colonization on the go. I have been a fan of that game since the time it came out – it feels much more coherent to me than Civilization ever was, and I love how each game turns out pretty differently depending on where you land in the New World, what nation you play, how you interact with the indians… it’s just fun and it has not aged at all. It’s still challenging to develop your own colony and ensure you declare independence before the other European powers in the area.

So, to make a long story short, this new PND by PtitSeb brings slightly more speed for regular DOSbox use, a better launcher, and implements MT32 and OpenGlide on top of that. Simply, a must-have.

3 thoughts on “DosBox 0.74 + DBGL: The DosBox Revolution

  1. Steven Craft

    Good article, I must admit to not really paying much attention to DosBox, I mean I typically read posts about it just out of curiosity, but I tend to overlook actually playing around with it based on the amount of other things to check out. The information amount the MT32 has made me curious though; I have seen the Roland sound stuff ‘back in the day’ and was just aware that choosing that option didn’t work for my configuration. I assumed SoundBlaster was the biggest and best, but I want to revisit now!

    The rest of this post should be in a spoiler tag! Just including for those that are interested (possibly no one!). For what it is worth, the article linked to about 4 dimensional coordinates is specifically about positions rather than UVs and really just focusing on the ‘niceness’ about being able to rotate, scale and translate a point in one ‘operation’ by using 4 dimensions coordinates. But there is more to it, when you move from 2D games to 3D games, one major change is from a 2D orthographic camera to a 3D perspective camera (the 3D camera is like the real world, the further in front of you that you look, the more stuff you see, or a car that is 1m in front of you takes up all of your visions, where as one which is 100m away is just a small part of your vision). So we have a relationship where the distance away from you, depth (which is the Z coordinate in terms of XYZ), determines how big/small something is.

    Based on the above, it is clear why you’d need 3 dimensions (XYZ) per coordinates, by perhaps not 4. Well part of it is when you render each object of a scene, you store information in each pixel about the colour you wish to draw, but in order for objects close to draw ‘in front’ of items behind, we also write a ‘depth’ value into the depth buffer, so we know how far away each pixel is. That way when we draw something we can check whether the thing we are drawing is closer than the previous thing we drew and based on that decide whether to draw/skip the current pixel/draw. So we need to calculate a depth value based on the coordinates the user provides, we can’t use the users Z value directly as we wish to be able to specify the depth range for the scene being drawn (map the provided Z onto a range that suits our needs). Instead, we can set up a projection matrix which means that when we take our source coordinate (XYZW), multiply it by our projection matrix, we end up with a new coordinate which has the property that the ‘final’ value we send to the hardware is equal to:

    X = X/W
    Y = Y/W
    Z = Z/W
    W = 1

    This might seem a little inconvenient, but multiplying a coordinate by a matrix can do a lot of things, but perform this sort of divide isn’t one of them! For reference it is called a homogeneous divide. In some respects the W can be hidden, as the user specifies it as 1 and it isn’t used until later in the pipeline. But it is used for other things to, like texture mapping, if you want the textures to be ‘perspective correct’ see this image for move information:

    http://img.my.csdn.net/uploads/201204/10/1334059961_2444.png

    Then you need to divide the provided UV values by W.

    So that is some extra explanation about why a position might need four coordinates XYZW, but doesn’t touch on the original question about why a texture coordinate might need more than 2 dimensions. So a texture coordinate is a pair of values that references a point in a texture, it allows a texture to be mapped over a polygon. You tell the hardware where about on the texture each vertex references and the hardware takes care of applying the texture over the entire polygon. But sometimes you want to be able to tell the hardware more information about how to perform this process of mapping the texture over the polygon, for example you might want to perform some sort of perspective texturing, which is talked about already above. But you can actually apply the same principle to something in 2D, this actually describes it very well:

    http://www.reedbeta.com/blog/2012/05/26/quadrilateral-interpolation-part-1/

    But the bottom line is you need to provide three UV coordinates, not just two.

    So the bottom line is, the graphics API needs to be able to deal with at least 4 values for a position and 3 values for a texture coordinate. In the traditional rendering pipeline I’m not aware off the top of my head why you’d ever need a 4 dimension texture coordinate, but maybe there is a reason…! Certainly with ‘modern’, shader driven, hardware, this stuff begins to become quite a big grey area, as you can send up pretty much whatever data you like, and write shaders to access this data and do all sorts of things.

    The above can be nicely understood by reading a few chapters of some graphics books, so do not be alarmed if my rambling and mostly incoherent! It is hard to provide enough information without writing pages and pages to cover all the background knowledge behind each concept.

    Reply
  2. Sepulep

    I think you can play C&C (and others) using the touchscreen with the new touchscreen option (in profile->display)

    Reply
    1. ekianjo Post author

      Really ? I think that in my case i had an offset on my screen – did you have better success with yours?

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *