1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice

Dosbox - room for optimization?

Discussion in 'General Discussions' started by ozzyfreakdude, Mar 14, 2011.

  1. ozzyfreakdude

    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
     
  2. Pickle

    Pickle Mega GP Mania

    Joined:
    May 30, 2006
    Messages:
    5,347
    Location:
    Detroit, Michigan
    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. ozzyfreakdude

    ozzyfreakdude Still Fresh

    Joined:
    Feb 14, 2011
    Messages:
    92
    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. Abaddon666

    Abaddon666 Still Fresh

    Joined:
    Sep 28, 2007
    Messages:
    78
    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. craigix

    craigix Mega GP Mania

    Joined:
    Feb 3, 2003
    Messages:
    11,010
    Location:
    England
    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. QBCS

    QBCS Still Fresh

    Joined:
    Aug 15, 2010
    Messages:
    29
    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. ozzyfreakdude

    ozzyfreakdude Still Fresh

    Joined:
    Feb 14, 2011
    Messages:
    92
    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.

    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've no idea, sorry. It was Pickle who ported it - you could ask him for it.
     
  8. kaiserpc

    kaiserpc Still Fresh

    Joined:
    Jan 12, 2011
    Messages:
    63
    Location:
    Scotland
    I disagree - I'm a bid SSI fan, and a lot of their games were DOS only
     
  9. NearTao

    NearTao Member

    Joined:
    Sep 13, 2008
    Messages:
    370
    True, but a lot of those SSI games already run well without optimizations. Enough to hopefully hold you over for Pandora 2.0.
     
  10. ozzyfreakdude

    ozzyfreakdude Still Fresh

    Joined:
    Feb 14, 2011
    Messages:
    92
    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. Esn

    Esn (:";

    Joined:
    Mar 5, 2003
    Messages:
    3,236
    Location:
    Toronto, Canada
    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: Jan 2, 2016
  12. ozzyfreakdude

    ozzyfreakdude Still Fresh

    Joined:
    Feb 14, 2011
    Messages:
    92
    More than it needs to? Is there really a limit to how many things anything should emulate?
     
    Last edited by a moderator: Jan 2, 2016
  13. Esn

    Esn (:";

    Joined:
    Mar 5, 2003
    Messages:
    3,236
    Location:
    Toronto, Canada
    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: Jan 2, 2016
  14. ozzyfreakdude

    ozzyfreakdude Still Fresh

    Joined:
    Feb 14, 2011
    Messages:
    92
    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. Esn

    Esn (:";

    Joined:
    Mar 5, 2003
    Messages:
    3,236
    Location:
    Toronto, Canada
    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: Mar 15, 2011
  16. skeezix

    skeezix Certified Guru

    Joined:
    Mar 11, 2003
    Messages:
    8,035
    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. Esn

    Esn (:";

    Joined:
    Mar 5, 2003
    Messages:
    3,236
    Location:
    Toronto, Canada
    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: Mar 15, 2011
  18. Prometheus

    Prometheus Well-Known Member

    Joined:
    Mar 8, 2008
    Messages:
    9,474
    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. Esn

    Esn (:";

    Joined:
    Mar 5, 2003
    Messages:
    3,236
    Location:
    Toronto, Canada
    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: Mar 15, 2011
  20. Prometheus

    Prometheus Well-Known Member

    Joined:
    Mar 8, 2008
    Messages:
    9,474
    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: Mar 16, 2011

Share This Page