Skip to content

Fix snes rumble controller#83

Open
undisbeliever wants to merge 2 commits intonesdev-org:masterfrom
undisbeliever:fix-snes-rumble
Open

Fix snes rumble controller#83
undisbeliever wants to merge 2 commits intonesdev-org:masterfrom
undisbeliever:fix-snes-rumble

Conversation

@undisbeliever
Copy link
Copy Markdown

This PR fixes 2 bugs in Mesen's implementation of the LRG rumble controller.

  • The LRG controller clears the internal 16-bit shift register when the controller is latched.
    • Mesen clears _rumbleData after setting force-feedback.
  • The LRG controller stops rumbling when the game stops sending rumble commands to the controller.
    • Mesen on Linux stops after 2 seconds.
    • Mesen on my Windows 11 laptop does not stop rumbling.

This behaviour is discovered by a new test ROM I wrote that was tested by NovaSquirrel (nesdev forum post with 2 test ROMs). I wrote the test because Mesen, SNES_Mister and the rumble controller spec doc have different behaviour regarding rumble controller latching.

The second commit fixes the second bug in a hacky way. It uses SnesRumbleController::RefreshStateBuffer() as a timer callback as I did not want to add a rumble stop timeout to KeyManager and potentially break the game boy rumble.

These commits have been testing by:

The rumble controller spec document states the 16-bit shift register
should be cleared when the P/S Out line goes high and then low.

This behaviour has been verified on a Limited Run Games rumble
controller with a custom test ROM.
https://forums.nesdev.org/viewtopic.php?t=26602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant