mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-25 15:05:06 -04:00
Fix JUTGamePad stopPatternedRumbleAtThePeriod division by zero
Happens for me when loading a save in Death Mountain Twilight. Confirmed in Dolphin with the same save file. PowerPC does not raise an exception on division by zero, so I assume this is an original game "bug"
This commit is contained in:
@@ -535,6 +535,14 @@ void JUTGamePad::CRumble::stopPatternedRumble(s16 port) {
|
||||
}
|
||||
|
||||
void JUTGamePad::CRumble::stopPatternedRumbleAtThePeriod() {
|
||||
#if TARGET_PC
|
||||
if (mFrameCount == 0) {
|
||||
// Does not trap on hardware
|
||||
// PowerPC spec says result is "undefined". Let's just write zero.
|
||||
mLength = 0;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
u32 r31 = mFrame % mFrameCount;
|
||||
mLength = (mFrame + mFrameCount - 1) % mFrameCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user