jeffpar / pcjs

The original IBM PC and other machine emulations in JavaScript
https://www.pcjs.org
Other
853 stars 131 forks source link

Looks like all the emulators are operating below their set maximum speed. #17

Closed Myron-S closed 3 years ago

Myron-S commented 3 years ago

Not sure when this started. Just trying the Windows 95 RTM virtual machine and I have noticed that it's operating at a snails pace. Started the debugger and the emulated clock speed is way below the 16MHz setting and the clock speed can't be changed.

Screen shot: image

Slow on Microsoft Edge too, but not as slow as is within Firefox.

I shall continue testing. My machine is essentially gaming laptop and with the emulator running and everything else, about 30% CPU usage.

IAW9927 commented 3 years ago

Maybe click the button for the CPU speed and it will go to 8/16Mhz faster. Or try installing it to a HDD on copy.sh/PCjs.org

Myron-S commented 3 years ago

@IAW9927, you need to do some in-depth-reading about Windows 95. There is an issue with Windows 95 RTM where it will not start if the clock speed of the CPU is too fast. Something that was fixed in Windows 98. There is a work-around/fix if you want to run that image locally on your own computer. On my machine I had set the speed to 16MHz, but look at the reported emulated CPU speed to the right of the speed selection button.

I have reported the issue on here for @jeffpar to research and I'll try work with him to find out what may be the issue. The issue could even be at my end and if it is, at this moment I don't know what I need to tweak on my computer.

jeffpar commented 3 years ago

I tweaked PCx86 (version 2.07, 37eb6b2acb2abcd74d0539c1fe09f70e586b6232) to bump the current speed multiplier up to 1.0 whenever it drops below that. The speed (and current multiplier) are supposed to "float" back to their target values after some timing anomaly has occurred (eg, the user halted the machine with the debugger, or the user switched away from the browser/web page for some period of time, etc), but that wasn't happening -- at least not as fast as it should have. The speed management code needs an overhaul, but that's more work than I can tackle right now. Hopefully this will suffice for now.

Thanks for reporting this.