Jump to content


Photo

Dosbox - room for optimization?


  • Please log in to reply
26 replies to this topic

#1 OFFLINE   ozzyfreakdude

ozzyfreakdude

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • Local time: 04:46 PM

Posted 14 March 2011 - 04:31 PM

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

#2 OFFLINE   Pickle

Pickle

    Advanced Member

  • Members
  • PipPipPip
  • 1131 posts
  • Local time: 04:46 PM

Posted 14 March 2011 - 05:07 PM

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.

#3 OFFLINE   ozzyfreakdude

ozzyfreakdude

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • Local time: 04:46 PM

Posted 14 March 2011 - 05:21 PM

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?

#4 OFFLINE   Abaddon

Abaddon

    Advanced Member

  • Members
  • PipPipPip
  • 66 posts
  • Local time: 10:46 PM

Posted 14 March 2011 - 08:29 PM

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?

#5 OFFLINE   Craigix

Craigix

    Advanced Member

  • Official OpenPandora Team
  • PipPipPip
  • 4566 posts
  • Local time: 10:46 PM

Posted 14 March 2011 - 08:33 PM

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.

#6 OFFLINE   QBCS

QBCS

    Member

  • Members
  • PipPip
  • 25 posts
  • Local time: 03:46 PM

Posted 14 March 2011 - 09:39 PM

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?

#7 OFFLINE   ozzyfreakdude

ozzyfreakdude

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • Local time: 04:46 PM

Posted 14 March 2011 - 10:04 PM

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://freescifistor...-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.

#8 OFFLINE   kaiserpc

kaiserpc

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts
  • Local time: 09:46 PM
  • LocationScotland

Posted 14 March 2011 - 11:06 PM

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

#9 OFFLINE   NearTao

NearTao

    Advanced Member

  • Members
  • PipPipPip
  • 324 posts
  • Local time: 04:46 PM
  • LocationNew Hampshire

Posted 14 March 2011 - 11:33 PM


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.

#10 OFFLINE   ozzyfreakdude

ozzyfreakdude

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • Local time: 04:46 PM

Posted 14 March 2011 - 11:49 PM


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.

#11 OFFLINE   Esn

Esn

    Advanced Member

  • Members
  • PipPipPip
  • 427 posts
  • Local time: 04:46 PM

Posted 15 March 2011 - 12:12 AM

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 multiplayer Commander Keen, 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.
The Pandorawiki has lists of emulators, games and other software that I help maintain. Those three lists are also the only ones to list all of the Pandora programs that aren't uploaded either to the File Archive or to the Appstore, of which there are quite a few.

I am more active on the GP32X forums than here.

#12 OFFLINE   ozzyfreakdude

ozzyfreakdude

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • Local time: 04:46 PM

Posted 15 March 2011 - 12:21 AM

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?

#13 OFFLINE   Esn

Esn

    Advanced Member

  • Members
  • PipPipPip
  • 427 posts
  • Local time: 04:46 PM

Posted 15 March 2011 - 12:37 AM


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.
The Pandorawiki has lists of emulators, games and other software that I help maintain. Those three lists are also the only ones to list all of the Pandora programs that aren't uploaded either to the File Archive or to the Appstore, of which there are quite a few.

I am more active on the GP32X forums than here.

#14 OFFLINE   ozzyfreakdude

ozzyfreakdude

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • Local time: 04:46 PM

Posted 15 March 2011 - 12:39 AM

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

#15 OFFLINE   Esn

Esn

    Advanced Member

  • Members
  • PipPipPip
  • 427 posts
  • Local time: 04:46 PM

Posted 15 March 2011 - 12:55 AM

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.
The Pandorawiki has lists of emulators, games and other software that I help maintain. Those three lists are also the only ones to list all of the Pandora programs that aren't uploaded either to the File Archive or to the Appstore, of which there are quite a few.

I am more active on the GP32X forums than here.

#16 OFFLINE   skeezix

skeezix

    Advanced Member

  • Official OpenPandora Team
  • PipPipPip
  • 2716 posts
  • Local time: 04:46 PM

Posted 15 March 2011 - 02:23 AM

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

#17 OFFLINE   Esn

Esn

    Advanced Member

  • Members
  • PipPipPip
  • 427 posts
  • Local time: 04:46 PM

Posted 15 March 2011 - 03:34 AM

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.
The Pandorawiki has lists of emulators, games and other software that I help maintain. Those three lists are also the only ones to list all of the Pandora programs that aren't uploaded either to the File Archive or to the Appstore, of which there are quite a few.

I am more active on the GP32X forums than here.

#18 OFFLINE   Prometheus

Prometheus

    Advanced Member

  • Members
  • PipPipPip
  • 5661 posts
  • Local time: 10:46 PM

Posted 15 March 2011 - 12:47 PM

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?

#19 OFFLINE   Esn

Esn

    Advanced Member

  • Members
  • PipPipPip
  • 427 posts
  • Local time: 04:46 PM

Posted 15 March 2011 - 05:55 PM


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)
The Pandorawiki has lists of emulators, games and other software that I help maintain. Those three lists are also the only ones to list all of the Pandora programs that aren't uploaded either to the File Archive or to the Appstore, of which there are quite a few.

I am more active on the GP32X forums than here.

#20 OFFLINE   Prometheus

Prometheus

    Advanced Member

  • Members
  • PipPipPip
  • 5661 posts
  • Local time: 10:46 PM

Posted 15 March 2011 - 11:05 PM

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.)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users