-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, untested
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... :) |
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. |
All Division Rounding Mode settings seem to have no affect on #8587, including Chop/Zero. |
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)):

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..