joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.81k stars 383 forks source link

Pentium II support or Pentium MMX >166MHz #2435

Open Diatonator opened 3 years ago

Diatonator commented 3 years ago

I see that the max amount of cycles I can have in the Dosbox-X is 166MHz with Pentium MMX (and Pentium Pro I guess?): image

While trying a Win98 setup and testing out various stuff I did stumble upon the various apps(games) which either listed speeds like 200/233MHz as minimal/recommended specs. There is a turbo button, but it doesn't appear to magically fix the need in processing power, and often adds some issues than actually helping, in the typical gaming scenario for sure.

I read that Pentium II support is unlikely at the time, but maybe something like an MMX with more cycles will be easier to add? Or maybe it's not that simple here?

Of course I would prioritize the stability over new stuff, as I would like to have a beloved MMX 166 beast run what it's supposed to run :)

brunocastello commented 3 years ago

For Pentium II emulation you'd need, right now and if you are in a hurry, a powerful CPU with enough GHz (approx. i9 w/ 4GHz) and PCem instead of DOSBox to emulate correctly its speed.

But frankly, even PCem has its problems and I find DOSBox much more reliable. My Pentium II games I just moved them to a QEMU machine when they don't require 3D and VMware when they do.

Diatonator commented 3 years ago

i9 w/ 4GHz

Oh no of course I wouldn't have that! I better find the actual PII PC somewhere :) Is PII emulation that taxing on a host system? Will the Dosbox emulation of PII, if it comes, be that taxing on a host too? I seem to run PI MMX on my Ryzen 3 3100 pretty ok, on a dynamic core at least. Will my machine just ask for help and die if I ever try PII emulation?

brunocastello commented 3 years ago

To answer this question... I hope I can quote what @almeath told me in our chats:

"On PCem .. Pentium Mobile 300mhz or regular 233mhz seems to be the absolute cap on my my i9900k. Otherwise it gets all choppy. Even on the 300mhz, my iMac fan ramps up to maximum RPM!"

almeath commented 3 years ago

Yeah, that is accurate in my experience, but I should add that the fan ramping up is when I put the system under full load during 3D games using the Voodoo emulation. 2D games get better mileage and sometimes I can push it up to 266mhz Pentium. The 300mhz mobile Pentium was the best balance between speed, smoothness of game play and pressure on my system. I am using a 3.6ghz i9 with turbo boost to 5ghz. I do find PCem useful for a few higher end Win9x games that do not play nice with DOSBox, but as you mentioned, there are lots of little glitches and compromises with PCem. For example, I hate the lag in the mouse cursor.. even if the underlying system is fast it gives the impression of slow downs and I have to move the cursor very slowly and deliberately. I recommend DOSBox SVN and X in most instances. Higher end Win9x games should be run in virtual machines that can harness the full power of your system.

Diatonator commented 3 years ago

I gave up trying to virtualize Win98 on my Ryzen. I got bunch of random errors trying to setup windows, and I read that there's at least one issue with the processor itself that the 9x OSes are having some bugs because they are incompatible with Ryzen (!). I tried the suggested workaround - disable nested paging in VurtualBox, but was still unable to get Win98 running because of some other problem I didn't care to investigate already. That's why I'm looking into emulation, but seems that higher clocks will be too much for my system.

almeath commented 3 years ago

On the Mac I get very good results from Parallels and VMWare Fusion. Fusion handles Windows 98 perfectly, whereas Parallels provides excellent performance for the more demanding 3D games. These days I hardly have to boot into Windows 10 directly unless I want to play a "modern" game like something that came out in the last 5 years or so. I don't know if there are any better options than Virtual Box for Windows. In the old days there used to be Virtual PC. Doesn't VMWare provide an equivalent to Fusion?

Diatonator commented 3 years ago

Setting Win98 on VMware gave me one batch of errors, VirtualBox game me another batch. I got freezes, BSODs, explorer.exe crashes and all sorts of stuff. I tried to get a working envirnoment for like a day or two and got fed up. One response from the dev on a VirtualBox issue tracker (https://www.virtualbox.org/ticket/19275#comment:8) made it clear that they are not planning to support 9x OSes going through:

Before opening such tickets, please do some due diligence first. Google for "windows 98 ryzen crash" and you will see that this is not a problem with VirtualBox, it's a problem with Ryzen CPUs and Windows 9x, or more likely a bug in Windows 9x. See e.g. here https://communities.vmware.com/thread/579537

I believe this blog post explains what the problem is. The method Windows 9x uses to manage page tables does not work (reliably) on AMD Bulldozer and Ryzen CPUs, and it probably only works by accident on other CPUs.

Disabling the I/O APIC of course does nothing, Windows 9x does not use it. But disabling nested paging does a lot, because it hides the TLB management problem referenced above.

Please note that Windows 9x is known to have serious problems on fast CPUs.

Also note that the first generation Ryzens had a bug related to VME (Virtual-8086 Mode Extensions) but VirtualBox works around that and AMD fixed that a long ago.

You can complain to AMD but they will very likely tell you that this is a bug in Win9x that they have no desire working around. Intel has done such things too, various old operating systems no longer work on current Intel CPUs because they did things that they shouldn't have done, and they're no longer commercially important.

The bottom line is that this is not a regression and it's not something VirtualBox can fix. Disabling nested paging may help but Windows 9x still remains an unsupported guest OS in VirtualBox.

Some people are able to emulate Win98 by chance on a newer machines, some aren't.

almeath commented 3 years ago

Hmm, I would be willing to upload my base install VM of Windows 98 SE for you to give it a try.. which version of Fusion do you have? I got it running years ago and have carried it forward all the way to Fusion v11. I am not using 12 yet because I am still on Mojave.

brunocastello commented 3 years ago

The best software to emulate Windows 98 is QEMU. Sadly, you won't get 3D acceleration. Unless you are skilled enough to try a GPU Passthrough - but then you'd need Win98 drivers for the GPU you're going to use.

VMware Fusion can run Win 98 too, however without acceleration too. VMWARE SVGA II driver does not have 3D acceleration. Only VMWARE SVGA 3D driver has, and this is only supported from Windows XP and later. Win 3.x, Win 9.x and Win 2000 users are left out.

almeath commented 3 years ago

I presume Parallels wont support 3D in Windows 98 either .. I was never able to get Windows 98 working in Parallels despite many attempts.

Diatonator commented 3 years ago

which version of Fusion

It's for a mac computer, isn't it? I'm a PC user :)

almeath commented 3 years ago

Yes, I thought you were on Windows which is why I mentioned Virtual PC (quite old) and was wondering if VMWare had a similar product to Fusion for Windows. I don't know if the format used to store the VMs is transferable. Perhaps QEMU is worth a try for you, as that is definitely cross platform.

joncampbell123 commented 3 years ago

I gave up trying to virtualize Win98 on my Ryzen. I got bunch of random errors trying to setup windows, and I read that there's at least one issue with the processor itself that the 9x OSes are having some bugs because they are incompatible with Ryzen (!). I tried the suggested workaround - disable nested paging in VurtualBox, but was still unable to get Win98 running because of some other problem I didn't care to investigate already. That's why I'm looking into emulation, but seems that higher clocks will be too much for my system.

Are you giving Windows 98 too much memory? More than about 256MB to 512MB?

Yes, really.

Diatonator commented 3 years ago

Are you giving Windows 98 too much memory? More than about 256MB to 512MB?

Yes, really.

I remember giving it 64 MB as it's the amount on the machine I had in the past. And I remember autoassign from Vmware or Virtualbox was never above 512 MB. I could try again if I by chance somehow set up the memory to some higher values, but I most likely didn't give the machine too much.

Diatonator commented 3 years ago

I was able to install Win98 on VM on a Ryzen host using the specific version of Vmware (VMware 12.5.9) because I can specify a virtualization engine: image On later versions this option is disabled, thus any version later than 12.5.9 will refuse to properly run Win98 for me. I got the info from this guide: https://translate.google.com/translate?hl=&sl=de&tl=en&u=https%3A%2F%2Fwww.creopard.de%2F2020%2F05%2FVM-Windows-98-SE-mit-Ryzen-CPU-in-VMware-12.x-installieren.htm This guide has steps on how to avoid the explorer crash by temporarely switching off "Disable all 32-bit protected-mode disk drivers", replacing some file in the system and switching the feature back on. I didn't need to do that thankfully, picking the right virtualization engine was enough for me.

But yeah, no proper 3D drivers&acceleration (only supported here for XP and later) and the games who want that refuse to work. On Virtualbox AFAIK is the similar situation. I already have a bunch of games which I can run on Dosbox-X, but not on Vmware.

almeath commented 3 years ago

Oh good - that is basically the equivalent of using Fusion then. There is not going to be one perfect, catch-all solution. I am finding that I will use a combination of DOSBox SVN/X, PCem and Fusion/Parallels to get my Win9x games working.

rderooy commented 3 years ago

You can always try to run the Windows application with Wine. You can run Wine on Linux or MacOS.

Windows hosts are slightly more problematic. You would need to virtualize a modern Linux system with VMware/VirtualBox/HyperV, and then run Wine in the Linux virtual machine.

Diatonator commented 3 years ago

I recently tried Pentuim MMX 233 MHz with Voodoo 3 3000 card on PCem, on Ryzen 3 3100 host, and it wasn't bad. I got some stutters in games which were really pushing it (and a slight clock rate reduction -10% avg), but mostly I was able to play games, and games who weren't pushing the limit mostly run flawlessly (or crashed for some reason, but that's expected unfortunately). So I will try this on Doxbox-X if it ever gets the update of similar sort.

dodleh commented 3 years ago

I would like to make a relatively short comment, hopefully relevant.

I still think that the race for Pentium II is wrongly considered by users (it is important on the long term, although, for development not real cases). It matters much more how consistent the system is (lag, delays, stable performance). In games you might be fooled that they seem to run better but smooth running means low lag and high fps, which means that you should aim for less than 50% host CPU usage when the emulated system is at full. This actually points at a lot lower performance than you hope for, but a stable one which matters much more! (the idea is to have some reserve for system tasks and emulation slowdowns in fringe cases).

Also, sorry for lengthening my comment. You also need to account video acceleration (3dfx) that is very CPU consuming! This means that you might fare ok with a 200 MHz MMX CPU with a S3 Trio 64 but only an 120-133 MHz CPU equivalent speed when using 3dfx games due to the very large overhead of a 3D GPU emulation. Always keep in mind to aim low if you want predictable performance and get used to that!

brunocastello commented 3 years ago

Well, you should try to run Grand Prix 3 on that and with all the bells and whistles enabled. This will change your mind. Good luck.

Grand Prix 3 states that it requires PII, but in reality it requires at least a Pentium 4.

dodleh commented 3 years ago

I would like to add that a true future challenge is how to improve parallelism by dividing audio/video/cpu load and keep everything synchronized. Probably, the emulation task could be split on three cores, as I see right now, but it is very far from trivial. My experience of having multiple cores dedicated to GPU emulation (PCEm on a very fast multi-core Xeon) points that the graphic task, even in SLI is not optimally distributed and feels slightly laggy if more than 1 core is dedicated to graphics. GPU emulation is very complex. Of course, you could accelerate some tasks through a real GPU pass-through but using DirectX or OpenGL brings other issues and bugs, so CPU emulation, even if slower, it is more predictable.

creopard commented 6 months ago

I was able to install Win98 on VM on a Ryzen host using the specific version of Vmware (VMware 12.5.9) because I can specify a virtualization engine: image On later versions this option is disabled, thus any version later than 12.5.9 will refuse to properly run Win98 for me. I got the info from this guide: https://www.creopard.de/2020/05/VM-Windows-98-SE-mit-Ryzen-CPU-in-VMware-12.x-installieren.htm This guide has steps on how to avoid the explorer crash by temporarely switching off "Disable all 32-bit protected-mode disk drivers", replacing some file in the system and switching the feature back on. I didn't need to do that thankfully, picking the right virtualization engine was enough for me.

@Diatonator Just for reference: Using https://github.com/JHRobotics/patcher9x fixes these issues while installing Windows 9x, so you can also try newer versions of VMware.