Fix various issues with NintendoSwitchBackend #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NintendoSwitchBackend had several issues. Firstly, I messed up the descriptor, which was why this comms backend didn't work on PC. Secondly, because the Nintendo Switch apparently applies a deadzone and scaling to GameCube controller analog stick inputs, it was necessary to reverse engineer this scaling and replicate it in NintendoSwitchBackend so that we scale the inputs before sending them to the console, in the same way that the Switch would scale them after receiving them. Until now I have been using a naive multiplication which was not close enough to the actual formula to prevent input issues manifesting when using the Ultimate mode. Thanks to Zeronia, we have much more data now and I have been able to reverse engineer the scaling formula to get one that matches almost exactly. The only remaining considerations are that the GameCube controller C-Stick is apparently scaled differently to the left analog stick, and that I have only implemented a basic square deadzone rather than a circular deadzone. It is yet to be seen whether these things will cause any input inconsistencies in existing controller modes.