joncampbell123 / dosbox-x

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

Math error in macOS ARM version of DOSBox? #3387

Closed digistorm79 closed 1 year ago

digistorm79 commented 2 years ago

Code of Conduct & Contributing Guidelines

Have you checked that no other similar bug report(s) already exists?

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

macOS Monterey 12.3.1 running on M1 Pro

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

0.83.24 macOS ARM build

Describe the bug

When running the PC Player Benchmark from PhilsComputerLabs DOSBench pack, it does not apply the camera position. The whole scene runs viewed straight from above. It looks like it miscalculates or ignores a certain calculation during the 3D transform. This seems to correlate with other reported bugs of Quake not launching and some FPU bug when running Windows 98. pcpbench_000

Expected behavior

On the Intel build, running with Rosetta 2, the benchmark runs as expected. Or any other machine running DOSBox, or any real PC. pcpbench_001

Steps to reproduce the behaviour

  1. Download the DOSBench suite from PhilsComputerLab (https://www.philscomputerlab.com/uploads/3/7/2/3/37231621/dosbench_v_1.4_jan_2017.zip)
  2. Extract it and execute it by running DOSBENCH.BAT
  3. Type 6 to run the benchmark
  4. It looks weird and wrong on the ARM build, and correct on any other build

Used configuration

No response

Emulator log

It outputs nothing that relates to this benchmark, only messages about changing the output resolution.

Additional context

The bug appears with any type of core and any type of emulated CPU.

joncampbell123 commented 2 years ago

This may be related to Touhou Project 1 where the orb is stuck in the air, rolling left to right, and never falls downward.

digistorm79 commented 2 years ago

Update: In the current version (0.84.0) the benchmark - just like Quake - works perfectly with the "normal" cpu core. With the dynamic core, it crashes with a black screen, just like a lot of other applications since version 0.84.0.

CyberXZT commented 2 years ago

I believe I may be seeing something similar to your latest update on the Raspberry Pi 4. Tested with the latest commit and 0.84.2. I also tested with a couple older versions. I could have sworn I had Quake running on the Raspberry Pi 4 with the dynamic core but none of the versions I compiled worked. Some failed in ways different to the below.

Here are my tests:

Normal core:

Dynamic core:

Dynamic core, FPU disabled:

Dynamic core, SDL2:

I've also attached logs of Quake starting with the dynamic core and the normal core:

quake-dynamic.txt quake-normal.txt

Amusing Note: It seems Quake will try to open a file named "emu387.dxe". I tried a few versions that I found on the web but have not been able to make it do anything.


EDIT: There may be multiple problems here. If I set use dynamic core with paging on = false then I get the following results on dynamic core:

digistorm79 commented 1 year ago

It is fixed in version 2023.03.31