joncampbell123 / dosbox-x

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

King's Quest I (machine=pcjr) speed issues compared to real hardware #2393

Open Allofich opened 3 years ago

Allofich commented 3 years ago

Comparing King's Quest I running in DOSBox-X to a video of the game running on a real PCjr (https://www.youtube.com/watch?v=v5DSFvWrNWA), the opening screens (Sierra ON-LINE INC and IBM screens, and then the game title screen) are too fast compared to the video.

According to what I read online, a real PCJr has an Intel 8088 (or AMD D8088) processor running at 4.77Mhz. Using the Emulate CPU speed option in DOSBox-X and selecting 8088 XT 4.77 MHz (240 cycles), in-game the speed is not too far off from that of the video, although it is still too fast. (Using the animated flags on the first in-game screen as a reference, I found 205 cycles to be a close match to the video)

Even using 205 cycles, though, the opening screens are both faster than in the video, and the fanfare music that plays twice at the title screen has less time between the two playbacks than in the video. A cycles value around 120 seems to make the title screens close to the video (I haven't measured it), but then in-game will be too slow.

rderooy commented 3 years ago

That is probably because dosbox and by extension, dosbox-x is not cycle accurate.

On real hardware, some instructions take longer than others.

Allofich commented 3 years ago

Yeah, I've heard that before. If it's not something that is feasible to be fixed, I'll close this.

joncampbell123 commented 3 years ago

It might be feasible to add memory I/O delay to PCjr mode for any page below 128KB to emulate the shared video/system memory slowness of real hardware. Based on real hardware, any memory above 128KB is external and not subject to sharing.