joncampbell123 / dosbox-x

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

Regression: Demoscene demo "Eden" runs introduction too fast, then the overall sequence too slow. #3556

Closed joncampbell123 closed 2 years ago

joncampbell123 commented 2 years ago

Describe the bug

This demo: http://files.scene.org/get:nl-http/mirrors/hornet/demos/1997/e/eden.zip

Open credits and scrolling background scroll too fast. Then the 3D animated sequence runs too slow.

Timing is correct with DOSBox SVN.

Steps to reproduce the behaviour

  1. Download demo
  2. Run the demo
  3. Observe too fast, then too slow behavior

Expected behavior

No response

What operating system(s) this bug have occurred on?

Linux, Mac OS X

What version(s) of DOSBox-X have this bug?

0.84.1 (development in progress)

Used configuration

[dosbox]
memsize=48

[cpu]
cputype=pentium
cycles=120000
core=normal

[sblaster]
sbtype=sb16
sbbase=220
dma=1
hdma=5

[gus]
gus=true
gusbase=240
gusirq=5
gusdma=3

[autoexec]
@echo off
cls
mount c: .
c:
REM ------ RUN THE DEMO -------
EDEN.EXE

Output log

No response

Additional information

No response

Have you checked that no similar bug report(s) exist?

Code of Conduct & Contributing Guidelines

joncampbell123 commented 2 years ago

Commit 78e5688d325bd459ab6e4c1fa1b7f61ef7e2e34f works, complains it cannot auto detect refresh rate Commit af4f11e275385250872213e16a9fec166cb2096f works, complains it cannot auto detect refresh rate Commit ba62a0ebc77cc756867309af2d5c3a62d6e0bf48 runs too fast, too slow Commit fd8bb2cfd6375d6360b5ebf23e50ba398665957a runs too fast, too slow Commit f9a9d6bdf83b67ec92720c1460f74466fd1a598c runs too fast, too slow

joncampbell123 commented 2 years ago

It seems to be dependent on CPU cycles count. The issue is seen at cycles=120000.

grapeli commented 2 years ago

The commit f9a9d6b that caused the regression in the Eden demo fixed the Lemmings game which was not working completely properly (#3365).

Before this change, the introduction to the Eden demo worked well in my opinion. Exactly the same as in this video. With cycles=max, core=normal. Correct synchronization of graphics and sound. No slowdowns in the final intro sequence.

It is currently not working properly.

maron2000 commented 2 years ago

As @grapeli mentioned, the said patch is a hack to fix Lemmings. It was refined to make it a conditional branch 2f48151, but it seems it need more refinement.See my comment https://github.com/joncampbell123/dosbox-x/issues/3380#issuecomment-1100627651.

Anyway, considering that Dosbox SVN doesn't need such hack, there should be a root cause that we need the hack. Maybe this comment is worth considering. https://github.com/joncampbell123/dosbox-x/issues/3365#issuecomment-1082277178

joncampbell123 commented 2 years ago

I am able to determine the demo is correctly detecting refresh rate on init. It seems to be a problem with using PIT mode 0 for IRQ0 as an event timer.

grapeli commented 2 years ago

I did the same experiment again. I mean, I rolled back timer.cpp from 0.82.14. Built with the latest dosbox-x code (no pc-speaker support). Lemmings and the Eden demo work fine. https://github.com/joncampbell123/dosbox-x/files/8404554/timer.cpp.txt

This version of timer.cpp also has drawbacks. Running NFS2SE under Win 98 SE works way too fast. https://github.com/joncampbell123/dosbox-x/issues/2689#issuecomment-1100702343

joncampbell123 commented 2 years ago

It turns out Eden tries to detect vertical refresh using the PIT 0 timer in mode 3, which was incorrectly emulated.

maron2000 commented 2 years ago

@joncampbell123 Although I can't reproduce your issue, your commit seems to work well. It's nice that my ugly hack is not needed anymore :-D

grapeli commented 2 years ago

I also confirm. This new commit b0a410c restores the correct presentation of the Eden demo. Without spoiling the proper operation of Lemmings.

In my opinion, the best settings for Eden are core=normal and cycles=max. This guarantees the correct timing and correct pace of this presentation. It is not known why sometimes (so every second run) this message appears.

eden_000

In my opinion, it does not affect the quality of the presentation.

grapeli commented 2 years ago

I noticed this b0a410c commit hangs SysChk (2.46 Beta 7) when trying to estimate Cpu Speed if cputype is set to pentium or higher.