[PR] Fix stuck rumble and polish unranked LRAS #85
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.
So to be frank I don't understand how rumble works enough to understand exactly why the rumble stuck bug was working but this PR is effectively a work-around while at the same time polishing the LRAS process.
What this PR does:
And now some notes about rumble and why the rumble stuck bug was happening prior to this update:
The image above shows the rumble messages detected on an LRAS after the first game. The thing to note is that the rumble state is set to 0 for ALL ports once we have returned to the CSS (scene 0x0008). So for the first game, the rumble bug would never happen.
This image now shows the same LRAS process but on game 2. In this case my controller was in Port 2 but my character was Port 1 in the game. The message to stop rumble for Port 2 comes in during the in-game scene (0x0208). This message is ignored because Port 2 is not the local player (I'm playing the Port 1 character). The message to stop rumble for Port 1, however, comes in only once we return to the CSS. At this point, the rumble for Port 1 is in fact turned off but the problem is, my controller is in port 2! In this way, rumble is never turned off for the controller in port 2.
Now I don't know why after game 1 the rumble stop messages for the non-local ports start coming in while the scene was still in-game instead of once we've returned to the CSS. Everything would work fine if either all the rumble stop messages happened while still in-game. And so, since I was pretty unhappy with the LRAS process in unranked (it was very jarring). I figured I would just fix/improve that and a side-effect of it would be to fix the rumble bug.