Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config: Replace FpuNegDivHack with eeDivRoundMode #10555

Merged
merged 2 commits into from
Jan 7, 2024
Merged

Config: Replace FpuNegDivHack with eeDivRoundMode #10555

merged 2 commits into from
Jan 7, 2024

Conversation

stenzek
Copy link
Contributor

@stenzek stenzek commented Jan 5, 2024

Description of Changes

I can't escape the curse of GT4 😢.

Turns out the Japanese release of GT4 crashes with nearest rounding on division, because of this abomination (see #10550 (comment)):
image

Another, potentially cleaner solution is to use chop for division as well as rounding, which apparently prevent the error from accumulating in this routine, and causing the validation to fail.

I'm a bit iffy about changing the default behaviour to follow the normal rounding mode this close to a release, so while that's something we could consider in the future, a stop-gap measure is to make the force-to-nearest-rounding opt-in. And at the same time, get rid of the negative division gamefix, since it can be represented using this new value instead.

According to #3816, it could potentially help other games too.

Rationale behind Changes

Closes #10550.

Suggested Testing Steps

Check a couple of the games in the GameDB that have FpuNegDivHack set (see the diff) - make sure I haven't broken them.
Check the Japanese version of GT4. As far as I'm aware, the US versions seem unaffected, but that's probably just by chance, maybe due to the constants that it's dividing by..

Copy link
Member

@refractionpcsx2 refractionpcsx2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, untested

@Goatman13
Copy link
Contributor

Probably helpful for (but need testing for other parts of game and new gamedb entries):
#9681
#8587
#8407

And for other floats related issues where game worked only with ee int enabled (as it disabled force round for div).

@stenzek
Copy link
Contributor Author

stenzek commented Jan 5, 2024

Yeah... The discrepancy with the EE int is what made me suspect divides in the first place.

I think we should make div matching everything else the default, then allow MK Shaolin Monks to opt in, but didn't want to make such a significant change close to a stable release. After that... :)

@AmyRoxwell
Copy link

AmyRoxwell commented Jan 6, 2024

Probably helpful for (but need testing for other parts of game and new gamedb entries): #9681 #8587 #8407

And for other floats related issues where game worked only with ee int enabled (as it disabled force round for div).

Tried using it for #8587 and didn't seem to help with the borked AI behavior at all, maybe I did something wrong so do your own tests, but for me the robots ai still breaks if recompiler is not disabled :/

@Goatman13
Copy link
Contributor

Probably helpful for (but need testing for other parts of game and new gamedb entries): #9681 #8587 #8407
And for other floats related issues where game worked only with ee int enabled (as it disabled force round for div).

Tried using it for #8587 and didn't seem to help with the borked AI behavior at all, maybe I did something wrong so do your own tests, but for me the robots ai still breaks if recompiler is not disabled :/

To test correctly you need to set eeDivRoundMode to Zero. New setting should be available somewhere in per game settings. Because new fix is not enabled by default, testing on default settings still round to nearest for DIV.

@wxvu
Copy link
Contributor

wxvu commented Jan 6, 2024

All Division Rounding Mode settings seem to have no affect on #8587, including Chop/Zero.

@stenzek stenzek merged commit 34a7e00 into PCSX2:master Jan 7, 2024
13 checks passed
@stenzek stenzek deleted the gt4 branch January 7, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Gran Turismo 4 (Japanese version) Crash on International B license test.
6 participants