Dosbox - room for optimization?


ozzyfreakdude

Still Fresh
Joined
Feb 14, 2011
Messages
92
As I understand embedded emulators (for the most part), they work as follows:


Somebody takes an existing working open-source emulator for another system (usually PC), and they gather libraries, cross compile, go through a lot of tedious and oftentimes under-appreciated work, etc, in order to simply get it running on an embedded system, such as the Pandora, PSP, GP2X, Wii, etc. As such, the first step is to get an unoptimized version running.


Then you figure out ways to optimize it to better run on the particular platform it's running on, IE finding performance bottlenecks and fixing them, either based on pure logic and algorithms, or on the particular hardware features of the system you're porting it to. This is where I understand performance increases to come from. When an updated version of an emulator has performance increases (ex - a new build of mupen64plus has a 10% performance speedup), this is where I understand it to come from.


Now I'm trying to apply that idea to DOSBox (and qemu, should it ever become more than something to tinker with on the pandora). I think that DOSbox has the potential to become one of the single most important applications on the Pandora, due to its potential ability to eventually run programs compiled for x86 architecture in a playable state (windows 95 programs, advanced dos games, etc)


From what I've seen, DOSBox for Pandora was released a while ago, and with the exception of some modifications to improve windows 3.1 (winbox), it's stayed relatively untouched as far as I'm aware of. Isn't the current build of DOSBox an unoptimized port? Couldn't it be optimized for better performance, similar to the way Mupen and PCSX-Rearmed are constantly being optimized?


Is it just that nobody has given any serious thought to optimizing it? Is there much/any room for optimization on the Pandora, or is it different from console emulators, in that it can't be optimized for some reason? The current build only really performs on the level of a 386, from my experience.


That leaves a LOT of software which would be playable if it was optimized to perform better. Simcity 2000 calls for a 486 25mhz, and it's playable, although it responds somewhat sluggishly. Simtower (in Windows 3.1) calls for a 386, but I find it unplayably slow, both in DOSBox and in Winbox. Warcraft II has minimum requirements of a 486sx 33Mhz, and although I haven't tried it myself, I'm told that it's only partially playable. Realms of the Haunting requires a 486DX/66Mhz, and it runs at about 1-2FPS on the outside levels.


I'm just entertaining a thought, any input would be interesting
 
Its been discussed before and the most effective way would be to write a new dynamic recompiler for ARM and X86 for a new emulator, as the current dosbox design would not make adding this trivial.
 
Ah, so you're saying that the innards of DOSBox are so convoluted that the only practical way to do it would be to completely rewrite a new emulator from scratch in order to accommodate an optimized dynamic ARM-x86 dynamic recompiler?


Is that conceivably anywhere on the horizon, or is it about as conceivable as a playable Sega Saturn emulator?
 
Realms of the Haunting requires a 486DX/66Mhz, and it runs at about 1-2FPS on the outside levels.

So there are people out there who actually liked this great and underrated game maybe as much as myself? Although I never expected it to work smooth on the pandora I had my hopes...well, I've learned my lesson in early january when I received my Pandora, too bad. I never tried this qemu thing though, is there a guide or something to begin with?
 
I think the fact is most games are available in another format (Amiga, PSX, SNES) which will run well on the Pandora so there isn't a lot of incentive to improve it.
 
I haven't looked at the DOSBOX source personally, but the x86 is difficult to emulate. The big thing is probably the status register. You have 16 flags or more that have to be up-to-date pretty much every instruction.


I've looked around, and I can't seem to readily find the source code currently being used; where should I be looking?
 
So there are people out there who actually liked this great and underrated game maybe as much as myself?
Indeed! My dad had a demo disc with the game on it lying around in the 90s, so I played the demo as a kid - and therefore like it in the same way that you hold a soft spot for the games you played when you were little. Never got the full game until a few years ago.

I never tried this qemu thing though, is there a guide or something to begin with?
Yes, of sorts: http://freescifistories.wordpress.com/2011/01/03/qemu-win-3-1-pandora-civ-2/


I think they claim that it runs faster than dosbox, but that's not my experience, although the only thing I tried was Realms of the Haunting (both in freedos and MS-DOS 6.22 - with and without the DOS/32A Extender). It runs even slower in qemu running DOS than it does in DOSBox, in my experience.

I think the fact is most games are available in another format (Amiga, PSX, SNES) which will run well on the Pandora so there isn't a lot of incentive to improve it.
:-(

I've looked around, and I can't seem to readily find the source code currently being used; where should I be looking?
I've no idea, sorry. It was Pickle who ported it - you could ask him for it.
 
I think the fact is most games are available in another format (Amiga, PSX, SNES) which will run well on the Pandora so there isn't a lot of incentive to improve it.

I disagree - I'm a bid SSI fan, and a lot of their games were DOS only
 
I think the fact is most games are available in another format (Amiga, PSX, SNES) which will run well on the Pandora so there isn't a lot of incentive to improve it.

I disagree - I'm a bid SSI fan, and a lot of their games were DOS only

True, but a lot of those SSI games already run well without optimizations. Enough to hopefully hold you over for Pandora 2.0.
 
I think the fact is most games are available in another format (Amiga, PSX, SNES) which will run well on the Pandora so there isn't a lot of incentive to improve it.

I disagree - I'm a bid SSI fan, and a lot of their games were DOS only

There are a lot of games which are dos only - in addition to the slew of early windows games that are windows only


There are also entire genres which are all but exclusive on anything other than PC, such as flight simulators.


There's also the fact that the PC versions of games ported to consoles are generally better.
 
I think the fact is most games are available in another format (Amiga, PSX, SNES) which will run well on the Pandora so there isn't a lot of incentive to improve it.
Most of the best games were never made available on other systems, with the exception of the adventure games which work through ScummVM now.


i.e. the 2D platformer games by Apogee, id Software & Epic MegaGames. Also, there are still new games being made... witness http://www.youtube.com/watch?v=a2lF8Y-POjI, for example.


That said, apparently even the current version of DOSBox emulates more stuff than it needs to, and you can make individual games play smoother by modifying the .conf files.
 
Last edited by a moderator:
That said, apparently even the current version of DOSBox emulates more stuff than it needs to, and you can make individual games play smoother by modifying the .conf files.

More than it needs to? Is there really a limit to how many things anything should emulate?
It's emulating by default a whole bunch of stuff that most games never use, so it is slower than it should be. You have to optimize settings for each individual game. I haven't quite figured everything out yet... you really need to be an expert.
 
Last edited by a moderator:
Oh, I thought you meant that it runs more games than are necessary, and there's no reason to be able to run anything more with it
 
I think there are two simple ways to make the existing DOSBox more playable without any major rewrites:


1) someone who's an expert in this could create a number of .conf files that turn off everything that's not necessary for certain types of games (i.e. EGA games). Then upload them somewhere for people to use. The DOSBox compatibility list has a "link to conf file" column, but nobody has come forward to fill it up, yet.


2. Add auto-frameskip to DOSBox. This by itself would make many games much more enjoyable, because a lost frame every now and then is much better than the game slowing down sometimes, as currently happens even on early 386 games.
 
Last edited by a moderator:
Is there a non-auto frameskip already? ie: Can you specify to skip 1 frame every Y frames or something?


If so, how much does that improve performance?


(on a EGA, VGA, SVGA game, try 'em and let me know)


This tells us how much worth pursuing an auto-frameskip would be.


jeff
 
Is there a non-auto frameskip already? ie: Can you specify to skip 1 frame every Y frames or something?


If so, how much does that improve performance?


(on a EGA, VGA, SVGA game, try 'em and let me know)


This tells us how much worth pursuing an auto-frameskip would be.


jeff
There is indeed a non-auto frameskip that you can set (in dboxfe, when you edit a profile - or directly in the .conf files in a text editor). I haven't used it much myself, because I don't like non-auto frameskip (if I'm using frameskip, I like to at least be sure that I'm not using it any more than I need to).


Are you saying that DOS games might run as poorly at FS5 as at FS0, that it might make no difference?


The main issue for me is that in games such as Commander Keen and Bio Menace, they run fullspeed most of the time at 850Mhz, but every so often they slow down, which is annoying as a player. Autoframeskip, unless I'm mistaken, would mean skipped frames instead of slowdowns, which is much more bearable.


DrMD on the GP32 felt fullspeed in Genesis emulation, even though it definitely wasn't, because it had good auto frameskip.
 
Last edited by a moderator:
The main issue for me is that in games such as Commander Keen and Bio Menace, they run fullspeed most of the time at 850Mhz, but every so often they slow down, which is annoying as a player.
I can play these at full-speed without even needing to change the clock-speed. :blink:


Should I upload the PND I'm using, or something?
 
The main issue for me is that in games such as Commander Keen and Bio Menace, they run fullspeed most of the time at 850Mhz, but every so often they slow down, which is annoying as a player.
I can play these at full-speed without even needing to change the clock-speed. :blink:


Should I upload the PND I'm using, or something?
Maybe upload your .conf file? Which Keens are you running? 1-3 work fine, 4-6 stutter and don't scroll very smoothly at 500-600Mhz. (it might also be that I'm more discerning)
 
Last edited by a moderator:
Good gracious... I must admit, I haven't had much time to put into Keens 4 to 6 since around Hotfix 3 and Hotfix 4 - what happened?! They used to run damn-near perfectly. :blink: Esn, I must confess, I am baffled - I don't know what changed.


If you're using Xfce, have you tried running Background Killer prior to trying to run those games? (If it's not still around, I kept a copy handy. Let me know if you want it.)
 
Last edited by a moderator:
Back
Top