joncampbell123 / dosbox-x

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

Ufo: Enemy unknown hangs after startup intro with cycles=auto/max #4581

Open tazok81 opened 10 months ago

tazok81 commented 10 months ago

Describe the bug

The game "Ufo: Enemy Unknown" hangs after intro ends. I should get to main menu, but It hangs. I tried older version from 30.11.2021 and it works fine with this version.

EDIT: it works with cycles=number, cycles=auto or cycles=max fails

Steps to reproduce the behaviour

  1. Start game
  2. Watch or skip intro

Expected behavior

I should get to main menu

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

Windows 11

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

2023-10-06

Used configuration

No response

Output log

No response

Additional information

No response

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

Code of Conduct & Contributing Guidelines

rderooy commented 10 months ago

Confirmed on Linux with both the SDL1 and SDL2 builds.

Also tried dosbox-staging, and there it does go to the menu.

Should be git bisected

rderooy commented 10 months ago

DOSBox-X 2022.08.0 works, which should make it a bit easier to pin down. Basically when the intro ends, it should load the GEOSCAPE binary for the menu, and that is when things seem to fail.

maron2000 commented 10 months ago

It wasn't actually freezing, but you have to be patient enough to wait. It goes to the menu immediately if you change cycles=auto to some value. ufo

rderooy commented 10 months ago

Thanks for the update @maron2000

To show the git bisect process for those not familiar (you normally don't have so many good hits...):

$ git bisect start
$ git bisect bad dosbox-x-v2023.10.06
$ git bisect good dosbox-x-windows-v2022.08.0
Bisecting: 636 revisions left to test after this (roughly 9 steps)
[67a3690e12b791f36dab08737ddd9b0bbbd784cd] PC-98 INT 18h: Ignore attempts to enable text layer in 256-color mode
$ ./build-sdl2

The generated binary worked, so...

$ git bisect good
Bisecting: 318 revisions left to test after this (roughly 8 steps)
[042d05ff44a55aa13620dc16ed916b3477073471] Revert DOS date/time to use cache DOS kernel copy for date and BIOS ticks for time to match what real MS-DOS does. Initialize time and date by RTC clock on startup. Revise CMOS emulation to run in emulator time, not real time
$ ./build-sdl2

This build has the problem, so...

$ git bisect bad
Bisecting: 160 revisions left to test after this (roughly 7 steps)
[2d05793a3c7cc64382911f80469540cacc7cf988] Move ATI emulation into a file for itself
$ ./build-sdl2

Build worked

$ git bisect good
Bisecting: 80 revisions left to test after this (roughly 6 steps)
[290d1bef7de2cb0936e80014c5f6c7c8238c627d] Merge pull request #4208 from aybe/fix-console-menu-item
$ ./build-sdl2

Build worked

$ git bisect good
Bisecting: 40 revisions left to test after this (roughly 5 steps)
[72cd9dacce2c50b5b7fdb174517b9ef78d9d4f43] Update build date, prepare for release later
$ ./build-sdl2

Build worked

$ git bisect good
Bisecting: 20 revisions left to test after this (roughly 4 steps)
[d51b7c7145e366dd2db24ab825fd2b6fee84a275] Merge pull request #4219 from 1abcd/cht-translation
$ ./build-sdl2

Build worked

$ git bisect good
Bisecting: 10 revisions left to test after this (roughly 3 steps)
[d0f869c28ae1ef61fd92c72f48041f2e0eb919ed] Merge pull request #4225 from Allofich/warn5
$ ./build-sdl2

Build worked

$ git bisect good
Bisecting: 4 revisions left to test after this (roughly 3 steps)
[72237faf4776f966a1138a1b11518a0bfd6ced78] Merge pull request #4229 from scu319hy/master
$ ./build-sdl2

Build worked

$ git bisect good
Bisecting: 2 revisions left to test after this (roughly 1 step)
[b5bd9337a72730a30ba79520c9015a34c9b89514] Merge pull request #4230 from dbjh/hardopl-chmod
$ ./build-sdl2

Build worked

$ git bisect good
Bisecting: 0 revisions left to test after this (roughly 1 step)
[8c30ea15387217016b0b847b0d59e82f272b4e9d] Merge pull request #4231 from dbjh/chmod
$ ./build-sdl2

Build worked

$ git bisect good
042d05ff44a55aa13620dc16ed916b3477073471 is the first bad commit
commit 042d05ff44a55aa13620dc16ed916b3477073471
Author: Jonathan Campbell <jonathan@castus.tv>
Date:   Wed May 3 23:19:52 2023 -0700

    Revert DOS date/time to use cache DOS kernel copy for date and BIOS ticks for time to match what real MS-DOS does. Initialize time and date by RTC clock on startup. Revise CMOS emulation to run in emulator time, not real time

 CHANGELOG             |   7 +-
 src/dos/dos.cpp       |  75 +++++++++-----
 src/gui/sdlmain.cpp   |   4 +
 src/hardware/cmos.cpp | 279 +++++++++++++-------------------------------------
 src/ints/bios.cpp     |  26 ++++-
 5 files changed, 153 insertions(+), 238 deletions(-)
$ git bisect reset 
Previous HEAD position was 8c30ea153 Merge pull request #4231 from dbjh/chmod
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
tazok81 commented 10 months ago

I build executables and tested commits. I found that the issue was created between these commits, I hope I did not make mistake

commit d74744fb779088b166e8db196b4d6e9db9982f98 Date: Thu Apr 27 00:17:05 2023 -0700

commit 7dfc618a4840e0c4f3bd560cd559e18f20ad9b28 Date: Sun Jun 11 11:47:29 2023 +0900

tazok81 commented 10 months ago

I tracked it a bit more and the issue is caused by "date-time/timer" rewrite in files bios.cpp, cmos.cpp, dos.cpp between commits above

grapeli commented 10 months ago

Works properly under the latest version.

dosbox-x-git-X-COM-UFO-Defense.webm

There is no point in reporting bugs that have already been fixed.

If it doesn't work, you need to specify which version, include the configuration and a copy of the program or game.

tazok81 commented 10 months ago

As it was written above, it works with cycles=number. With cycles=auto or cycles=max it hangs.

grapeli commented 10 months ago

Cycles=10000 is recommended for this game. Max or auto not at all. I would suggest changing the title to something adequate and legible.

tazok81 commented 10 months ago

I changed the title. But I disagree, cycles=auto is perfect match and should work. And cycles=max may be questionable, but I don't see any reason why it should not work.

grapeli commented 10 months ago

@tazok81 This is a bug, but it has little significance for this game. The game itself starts and works perfectly fine.

There was already a commit mentioned here earlier, from which it now hangs after the end of the intro. Exactly since this change 042d05ff. I confirm.

rderooy commented 10 months ago

I tracked it a bit more and the issue is caused by "date-time/timer" rewrite in files bios.cpp, cmos.cpp, dos.cpp between commits above

??? I did a full git bisect pointing to the exact commit that changed the behaviour 3 days ago. I even provided the full git bisect process above as an example.

tazok81 commented 10 months ago

Ah, sorry. I am not familiar with git bisect and did not understand the result or I misslooked it. But yes, that is what I found.

@grapeli You are right. It is not important for this game.

caiiiycuk commented 8 months ago

+1

tazok81 commented 6 months ago

I want remind this. This bug is there since may and other people reported it by other apps/games.