Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
WiimoteEmu: Major cleanups #7674
This is a step towards making emulated MotionPlus fully functional, making wiimote TAS/Netplay work better, and possibly supporting real wiimote input in the Dolphin UI / ControllerInterface.
I've reorganized the emulated wiimote code into multiple files and classes. (It was one giant mega class in a mega file)
I've improved the accuracy of the emulated wiimote's behavior based on testing I've done on physical wiimotes. Most of this was concerning edge cases and error codes so the changes are going to be mostly unnoticed, but I've added lots of comments and added names to lots of magic numbers.
I've improved how data reports are created and modified.
The "Interleaved" reports and "Full IR" camera data are now implemented but untested because I am not aware of a game that actually uses them. (Fishie Fishie and Cricket Challenge only enable Full IR for half a second on boot)
I've tried to make the names of things more consistent so the old wiimote
I've reorganized what should and and shouldn't be wiimote state in the
FYI: The emulated MotionPlus is now enabled and should simulate a "stable" sensor. 25-ish% of the time it will fail a certificate check and you will get a PanicAlert. More investigation is needed to fix this. Nunchuck pass-through is also not working. Non-motion plus games are unaffected because they do not attempt to activate the motion plus of course.
Testing wise, this appears to not cause any new issues. There are thousands of games, so I particularly targeted games that were problematic. Motion+ games are noted to be broken by Billiard, so I didn't do much with them aside from squee when they went in-game for those precious moments before the game realized something was wrong.
1: Boom Blox - Variable Shakes still working
I tested a few other games and features as well.
New Super Mario Bros. Wii - TAS Input + Input recording. This feature works as intended it seems.
I skimmed the code a bit and loving the cleanup and comments. I'm not sure how much I'll be able to contribute but I do plan on giving it a more in-depth look soon.
@jordan-woyak - is this code complete or do you plan on waiting until the M+ is more accurate?
I don't believe we need to expose M+ to users in this PR. Also not sure if it's wise to advertise it until there's a clear plan on how to present it to users. However, just from the code cleanup and the potential for more accurate emulation, I think this is great!
Agreed. I'm not opposed to having the framework down for initial WM+ support, especially since real hardware is getting harder to find, but the UX for this is going to be a nightmare to figure out no matter how you slice it. It would have been nice to have OpenXR so we could just say "get a controller with a gyro" but my hair will probably start going grey before that ever becomes a thing.
Is there a list of WM+ enabled games so we have an idea on what the implementation needs to do? Or for the sake of sane UX, I'd be ok with a reasonable implementation that covers the majority of games.
left a comment
In the future, consider not dumping a 4K+ LoC slab of changes as one PR, and instead breaking it out into smaller PRs. Several of these would have been fine on their own, and also been way less of a pain to review individually.