Page 1 of 1

DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Wed 07 Aug, 2019 5:59 am
by James-F
Something confuses PCem to run DOS in 65Hz instead locked 70Hz, it affects some Mode 13 games and produce choppy audio.
Prince of Persia 2 for example will have stuttering audio in the intro because PCem runs it at 65Hz instead of standard 70Hz, but only the intro... very strange.
I don't think It's related to the host CPU since Doom for example is much more demanding game and it runs at 70Hz no problem.
Sara, any idea what's going on?

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Wed 07 Aug, 2019 6:42 am
by SarahWalker
Please provide your configuration.

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Wed 07 Aug, 2019 6:52 am
by James-F
Emulated:
Machine: ASUS P55T2P4, Pentium 133, 16MB.
GPU: S3 ViRGE/DX Fast VLB/PCI
Sound: SBPro2.

Host:
i7 3770k at 3.9GHz all cores.
GTX660

I don't think it's a host speed issue, since I've mentioned that much heavier games like Doom or Duke3D run at 70Hz perfectly fine with emulation speed 100% locked (CPU Time below 100%),, but DOS text mode does not.
I don't understand why the refreshrate fluctuates at all? It should be locked at 70Hz in Text Mode and Mode 13h.

EDIT:
When executing EDIT.EXE/COM for example the refresh rate is back to normal 70Hz....
Maybe it's an issue with CPU running in Protected vs Real mode?

EDIT2:
I've noticed that in DOS the "CPU Speed MIPS" are significantly higher then when playing a game (like Doom).
At DOS idle it's running at 0.324 MIPS, and Doom is running at 0.001 MIPS.

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Wed 07 Aug, 2019 7:50 am
by James-F
Sorry for double posting, I found the problem.

In config.sys REM-ing the EMM386.EXE line fixes the MIPS overload in DOS, and no more audio issues in games.
Apparently EMM386.EXE produces a lot of instructions in PCem.
EMM386 is essential to load drivers into high memory and free conventional memory for DOS games.

According to wikipedia: https://en.wikipedia.org/wiki/EMM386
When running protected mode applications emm386 is bypassed, that's why I was seeing MIPS getting much lower in games.

EDIT:
Found a better replacement for EMM386.EXE,, it's called UMBPCI.SYS and it works like magic to load drivers in high memory, but only on compatible motherboards (chipset).
The EMM386 high MIPS usage should still be investigated.

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Wed 07 Aug, 2019 1:43 pm
by SarahWalker
It's already known what causes excessive recompilation with EMM386.

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Wed 07 Aug, 2019 2:39 pm
by James-F
Wow, that was quick!
I'm sure many people using EMM386 are oblivious to that it drastically slows down emulation.
Probably should be documented somewhere until the next release of PCem.

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Wed 07 Aug, 2019 3:06 pm
by SarahWalker
If I listed all the things that slow down emulation we'd be here all day. It's not worth it.

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Thu 08 Aug, 2019 12:57 pm
by SeanB
This is new to me too. Which supported motherboards are compatible with UMBPCI.SYS?

It looks like at a minimum that it only supports Pentium and above.

https://www.uwe-sieber.de/umbpci_e.html

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Thu 08 Aug, 2019 5:12 pm
by James-F
Yes, 430xX motherboards in PCem.
You don't really have to use EMM386 or UMBPCI.SYS, but note that every DOS driver you load (Mouse, CD-ROM, etc..) will take conventional memory and most DOS games need at leask 500KB.

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Fri 09 Aug, 2019 4:40 am
by te_lanus
Anyone tried JEMM?

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Fri 09 Aug, 2019 12:36 pm
by omarsis81
te_lanus wrote: Fri 09 Aug, 2019 4:40 am Anyone tried JEMM?
No, but I will. Thanks for the information :D

Re: DOS running at 65Hz instead of 70Hz, audio issues.

Posted: Fri 09 Aug, 2019 1:30 pm
by James-F
jemmex.exe works great, thanks for that.
No MIPS overload either.

PS. himem.sys has to be removed (rem) too for jemm to work.