Mefiresu / RSDKv5-Decompilation

A complete decompilation of Retro Engine (v5) ported to the Wii
Other
49 stars 6 forks source link

Wii classic controller and nunchuk support #1

Closed Anh302kay closed 1 year ago

Anh302kay commented 1 year ago

Adds Wii classic controller support. Buttons are inverted to be correct with the GUI. Analog sticks are supported now, deadzone might need adjusting. Tested on real hardware with snes classic controller. Also now supports the wii nunchuk, tested on real hardware.

Mefiresu commented 1 year ago

Thanks ! Though I believe the best way to implement the inverted buttons would be to use the custom settings available here: https://github.com/Rubberduckycooly/RSDKv5-Decompilation/blob/master/RSDKv5/RSDK/User/Core/UserCore.cpp#L319

It might be necessary to flip the Wiimote inputs too once these options are set. Could you research this ?

Mefiresu commented 1 year ago

Some feedback after testing mappings in general:

DEV: Now that there's effectively 3 different mappings, I feel like the variable names for button names can become confusing (RSDKv5 internally maps using Xbox-style controls with for example A to Confirm / B to Cancel). Maybe changing the variable names to fit their purpose would be clearer (so stateA could be stateConfirm, stateB could be stateCancel), or just writing comments in WiiInputDevice.hpp to explain their function in game. Diving a bit deeper into it made me realize that the confirmButtonFlip setting is actually useless, and adds confusion. This actually caused me problems at first because the value wouldn't be written to Settings.ini if the file already existed. ~~It also appears that the Switch version actually has Confirm on B and Cancel on A (which physically corresponds to an Xbox controller layout). To be more accurate to how the Switch controllers are mapped, I suggest removing the confirmButtonFlip changes and manually swapping stateA with stateB in every mapping.~~ (I was wrong, see next message)

Mefiresu commented 1 year ago

Nevermind about the Switch layout, the buttons are indeed flipped.

IMG_20221001_201254

Also it seems like the confirmButtonFlip setting never gets set on first boot (when no Settings.ini exists yet), so something might be missing in the Load/Save Settings INI functions.