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

Raise program exception on floating point exceptions #10043

Merged
merged 7 commits into from Oct 13, 2021

Conversation

JosJuice
Copy link
Member

@JosJuice JosJuice commented Aug 18, 2021

Fixes https://bugs.dolphin-emu.org/issues/7230 (True Crime: New York City) and https://bugs.dolphin-emu.org/issues/9650 (Call of Duty: Finest Hour).

@JMC47
Copy link
Contributor

JMC47 commented Aug 18, 2021

I guess I should note that this doesn't work yet.

@JosJuice JosJuice force-pushed the true-crime branch 2 times, most recently from c8ec427 to 7170219 Compare August 21, 2021 09:33
@JosJuice JosJuice marked this pull request as ready for review August 29, 2021 10:31
@JMC47
Copy link
Contributor

JMC47 commented Aug 29, 2021

While it was painfully slow, enabling the floating point exceptions for Call of Duty: Finest Hour also fixed the crash there, but playing through that game with it on might be worse than it crashing. Actually, playing the game at all is worse than it crashing.

@JosJuice
Copy link
Member Author

JMC has confirmed on IRC that both of the affected games are fixed by just handling divide by zero exceptions (like the game INI commit enables).

Copy link
Contributor

@JMC47 JMC47 left a comment

Choose a reason for hiding this comment

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

I've completed both known games that use this feature.

@JMC47
Copy link
Contributor

JMC47 commented Oct 8, 2021

I'm putting a final call out for this. It will get merged if no one is going to review it. True Crime must be unleashed on the masses.

The next commit will make the interpreter run this after every
float instruction, so I think a little optimization here is justified.
This is needed not only for the next commit, but also for
correctly emulating float instructions that write to CR1.
This is done entirely through interpreter fallbacks. It would
probably be possible to implement this using host exception
handlers instead, but I think it would be a lot of complexity
for a rarely used feature, so let's not do it for now.

For performance reasons, there are two settings for this feature:
One setting which does enables just what True Crime: New York City
needs and one setting which enables it all. The latter makes
almost all float instructions fall back to the interpreter.
Combined with the previous commits in this pull request,
this fixes https://bugs.dolphin-emu.org/issues/7230 (True Crime:
New York City) and https://bugs.dolphin-emu.org/issues/9650
(Call of Duty: Finest Hour).
@leoetlino leoetlino merged commit 71051b7 into dolphin-emu:master Oct 13, 2021
10 checks passed
@JosJuice JosJuice deleted the true-crime branch October 13, 2021 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants