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
ControllerInterface/Wiimote: Provide fallback values for extensions with bad calibration. #8936
ControllerInterface/Wiimote: Provide fallback values for extensions with bad calibration. #8936
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.
I can't speak to the low level emulation logic but the code itself seems fine. Never would have guessed it was bad calibration data as I tested this capability a while back with official Nintendo controllers.
Anyway, I tested on master to reproduce the problems with a Nunchuk and confirmed this PR fixes the issue. So... LGTM!
|
Just tested this locally against Build 12259 with Super Mario Galaxy, my Nunchuk works with Hybrid Wiimote now! (I'm musicalmitten from the linked bug tracker issue) |
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.
LGTM other than one minor comment.
| } | ||
| else | ||
| { | ||
| for (size_t i = 0; i != std::size(zero.data); ++i) |
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.
This can likely be a std::all_of
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.
I'm indexing two arrays. I don't think it can be a clean std::all_of but I'll change it to an std::equal.
ed65746
to
acdbbe4
Compare
…ith bad calibration data.
acdbbe4
to
5299e90
Compare
Some Nunchuks and Classic Controllers have bad calibration data.
This was causing unusable inputs in ControllerInterface Wii Remotes (aka Hybrid Wiimote 2.0).
This PR adds fallback values to make things mostly usable if the calibration checksum is bad or values are not sane.
The sanity check is just that "min" and "max" values are on opposite sides of the "zero" value.
This fixes:
https://bugs.dolphin-emu.org/issues/12088
https://bugs.dolphin-emu.org/issues/12027