Page 1 of 2

DOSBox performance

Posted: Mon Nov 21, 2016 2:26 pm
by necron2600
Its so slow.. is it just me or is everyone on an SGI box having slow performance with DOSBox? (or no one tries to run DOS on an SGI anymore?). Granted, 80s games work well for the most part.

I researched tweaks.. output of opengl or surface, priority=higher,normal, frameskip=8, cpu core=simple, cycles=540 (600mhz Octane2), sound rate to 11025, etc..

I am using DOSBox-0.71_MIPS-4_IRIX65.tar.gz from ElChupanibre at:
viewtopic.php?t=10361&start=30

I have tried to compile DOSBox myself but never able to mount anything .. as that link above details some of that mount class issue.

Is there another dosbox build floating around that is not easy to search for in nekochan/google that may run better?

In comparison.. AMIGA emulation via E-UAE is blazing fast.
As a test. The Dune 2 Game.. very sluggish in Dosbox. but just right in E-UAE. Other than the routine floppy swapping of, its not bad.. except a lot of games and apps are avail in DOS.

Re: DOSBox performance

Posted: Tue Nov 22, 2016 7:25 am
by ClassicHasClass
DOSBox isn't super flash on Power Macs either. I'd thought about rewriting the core in PPC assembly.

Re: DOSBox performance

Posted: Tue Nov 22, 2016 10:32 am
by jirka
Isn't the DOSbox slow by design? Even on the PC-compatible computers? If I remember correctly it was very slow on my 1+ GHz AMD Athlon, too. And yes, it is not fast on my O2 (R10k/250). ;-)

Re: DOSBox performance

Posted: Wed Nov 23, 2016 4:09 am
by Trippynet
Well, DOSBox is designed to emulate a slowish PC (speed of the emulated PC can be adjusted). The issue with it is that it seems to require a pretty inordinate amount of power to emulate such a slow PC.

Re: DOSBox performance

Posted: Sun Nov 27, 2016 5:35 pm
by necron2600
Does anyone have a logical explanation for why newer SGI hardware runs dosbox extremely slower (at least for me) than vintage SUN hardware using the same dosbox config?

I can play DOSBOX better on a vintage SUN Ultra2 with 400mhz UltraSPARC than an SGI Octane2 with 600mhz (both with gobs of RAM and same SCA hard disk model too)
Same exact dosbox.conf and games (Dune2 as the example), just using dosbox 0.73 from Sun Freeware.. runs nearly flawlessly.

Granted, it was slow when the cpu cycles were set to 400 on the SUN.. but when I set to ~2000 it worked very well. Maybe IRIX' dosbox has the same problem with cpu cycles?.. but in all my attempts to adjust cpu cycles up and down still leads to extremely poor usability.

It does seems the person (elchupanibre) who compiled DOSBox for IRIX earlier and posted on nekochan forums with the binary did not detail what was done to get the drive mounting (C:) feature working for IRIX (dosbox 0.71 and 0.74 can compile on IRIX but no luck with getting anything mounted), so I am not sure if the Dosbox version could be a factor (Good performing SUN using 0.73, poor performing IRIX using 0.71).

Thanks ;)

Re: DOSBox performance

Posted: Sun Nov 27, 2016 8:07 pm
by necron2600
Ok. DOSBOX and MIPSPro seems to not work well out of the box with its mount feature. Googling around shows even SUN's compiler and DOSBOX has the same problem by a few people.

So I took to compiling DOSBOX 0.73 with GCC (since its same version I tested on a Solaris system). After some mods, it worked! Speed is much better compared to other binaries of dosbox found on nekoware and in the wild.. still see some sluggishness and cannot change the cycles any higher than 540~ (600mhz CPU) where the SUN Solaris version got up to 2000.

I recompiled using O3 optimizations.. now the resulting DOSBOX binary works almost same speed as the SPARC version I tested. And.. I can get the cycles up to 2000 now (just as the SPARC version did).. which is where it needs to be on my particular system for something like 'Dune 2' to run naturally.

NOTE: CDROM support is disabled.

Double NOTE: I still configure dosbox.conf (you can find examples online) for best performance.. lowering sound rate,etc..

I am throwing together a tarball attached here.. this is unofficial, no quality/testing done... just documenting my work for someone else to benefit.
The tarball has the following files:

dosbox-73-gcc-O3-optimizations # the binary itself.. you can rename it to just dosbox
dosbox-0.73.tar # original source code
dosbox-0.73-irix-gcc-patch.patch # patch to the source code for it to compile on IRIX with gcc4.7
ldd-links.txt # text file with ldd output on the binary.. note nekoware's libSDL_sound-1.0.so.2, libSDL-1.2.so.1, etc.. in particular..
I see I had it linked with libFLAC.so.5 which I have a copy at /opt/lib32/libFLAC.so.5 on my system.
Since others may not have libFLAC.so.5 around, I included the library in this tarball... place it where the binary can find it.
libFLAC.so.5 # libFLAC.so.5 .. this is old/outdated compared to what nekoware has. It may only be linked due to my environment.. so sorry. Ill see about linking it to nekoware's libFLAC.so.9 in the future.
ENVIRONMENT .. text file with the environment I used to compile with gcc

At last.. a bit faster dosbox for IRIX.
Thanks.

Re: DOSBox performance

Posted: Mon Nov 28, 2016 2:46 am
by Trippynet
Outstanding, thank you! I'm very much looking forward to trying this when I get a bit of free time (snowed under with work and family commitments at the moment, so haven't had time to fire up my SGIs for a couple of weeks).

Re: DOSBox performance

Posted: Sun Dec 18, 2016 6:26 am
by Trippynet
OK, finally had time to give it a try. Well, it launches fine (once I'd copied your libFLAK.so.5 file across).

Main issue though is that the keyboard layout seems utterly screwed up in it, not sure why. Tried setting a US layout in my dosbox.conf file, but this doesn't help. Keyboard seems fine in the older 0.71 DOSBox.

Basically, "a" is giving me "Enter", "s" gives "]", "d" gives "h", etc. Not really possible to use. Any ideas at all?

Re: DOSBox performance

Posted: Tue Dec 27, 2016 10:00 am
by Trippynet
Well, it's not an O3 issue. I've tried compiling it myself with O2 optimisations and still get the ropey keyboard for some reason, despite popping the latest SDL on from beta. Google isn't being much help. I might have a try at porting 0.74 at some point and see if I can get that to compile and work properly.

Re: DOSBox performance

Posted: Tue Dec 27, 2016 5:15 pm
by necron2600
If I run the dosbox binary with no existing config file, I also see the messed up keys.
If I have this dosbox.conf file in the current dir (or replace the default config file location) then my keys are not messed up.

dosbox.conf.txt
rename to just dosbox.conf
(7.07 KiB) Downloaded 28 times


Unless its something else I have done to my system to resolve this, this config may fix your problem.
apologies if the dosbox.conf is messy.. lets see if it works first before I clean it up and even make a nekoware package out of it all. It is currently setup to work well on an Octane2 with 600mhz.. reducing sound quality, etc..

Re: DOSBox performance

Posted: Tue Dec 27, 2016 5:22 pm
by necron2600
Well, comparing the default dosbox config file generated to mine.. here is the line that is causing the problem:
usescancodes=true

Change it to false, and works fine for me.
What does usescancodes do? "Avoid usage of symkeys, might not work on all operating systems."

Re: DOSBox performance

Posted: Wed Dec 28, 2016 3:40 am
by Trippynet
Awesome, thanks! I'll give that a try.

One quick question, did you compile it with --enable-core-inline?

Re: DOSBox performance

Posted: Wed Dec 28, 2016 8:57 pm
by necron2600
I did not enable-core-inline. I believe that would set CFLAGS to -g -O2?
I did note (very very unscientifically) that if I compiled with -O2 .. I was not able to get dosbox cpu cycles to 2000.. was far less. But when I compiled with -O3 I saw a great improvement in speed.. and able to go to 2000 cpu cycles. I just keep xosview running while dosbox is running so I can set the cpu cycles to where it just hits 100% CPU load and doesnt peg the system. It does seem every game requires slightly different cpu cycle settings for the most part.

While games like warcraft 2 (1995 release.. ) run far better now for me in my 10 mins of testing (600mhz Octane2 and a few tweaks as noted in the dosbox.conf such as reducing sound quality), it is not super fast as what I would see on a more modern system with dosbox, but it is playable (other IRIX dosbox binaries did not seem to handle it in my experience). Most likely, games before 1995 may be best suited for SGI with dosbox unless you have a 1ghz Tezro lying around.

Re: DOSBox performance

Posted: Mon Nov 13, 2017 1:14 pm
by necron2600
Even though SDL works already, I noticed (and ignored all this time) the following startup error/warning:

SDL:OPENGL:No support for texturesize of 1024, falling back to surface

You can only scale the resolution if using 'overlay' or 'opengl'.. not surface. After I got tired of playing in tiny windows on a 1920x1200 desktop.. I realized that opengl may be a good thing to get working.

I modded the sdlmain.cpp file to disable the sdl.opengl.max_texsize check that appears to always come back with 0, so it doesnt work anyway and defaults to surface no matter what (details here: https://github.com/joncampbell123/dosbox-x/issues/212). Then compiled using GCC and -O3 optimization (seems faster than -O2 to me)

However, I have yet to test performance now that opengl is available (and scaling). most likely things will slow down a bit. Go back to no scaling if that is the case.

Attached is a tarball with the newer dosbox binary, dosbox.conf example config used on an IRIX system (its a working copy; messy with comments), and the required libFLAC.so.5 library that you can place somewhere in your LD_LIBRARYN32_PATH.

dosbox-73-gcc-O3-optimizations-working-opengl.tar
dosbox 7.3 mips4/IRIX GCC with O3 optimization and working OpenGL support
(5.35 MiB) Downloaded 13 times

Re: DOSBox performance

Posted: Mon Nov 13, 2017 2:24 pm
by Trippynet
Many thanks! I'll have to give this a try.