New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HW: Fix infinite rumble on emulation pause #6477
Conversation
Source/Core/Core/Core.cpp
Outdated
@@ -278,6 +278,10 @@ void Stop() // - Hammertime! | |||
#if defined(__LIBUSB__) | |||
GCAdapter::ResetRumble(); | |||
#endif | |||
#if defined(CIFACE_USE_XINPUT) || defined(CIFACE_USE_DINPUT) | |||
for (int i = 0; i != 4; ++i) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This can also likely just be a single commit or two (given 2 are added, and then 2 are just reverting them). It's also a convention to prefix the commits with the general area they're modifying. e.g.
|
Yes, I figured the two reverts would seem odd. We're working on this as part of a project, and our professor wanted us to modify the "about" text with our names. I'm not entirely certain how to delete the commits or if I even can, so I just reverted them. Sorry about the prefix bit; if anyone else is wondering, this is modifying Core/Core and Core/Core/HW. |
You can amend this like so:
Once this runs, type Then push the commits with |
@@ -36,7 +36,8 @@ AboutDolphin::AboutDolphin(wxWindow* parent, wxWindowID id, const wxString& titl | |||
_("\n" | |||
"Dolphin is a free and open-source GameCube and Wii emulator.\n" | |||
"\n" | |||
"This software should not be used to play games you do not legally own.\n"); | |||
"This software should not be used to play games you do not legally own.\n" | |||
"\nWith contributions by: Connor Roth, Calvun Williams, Justin Futrell, Andrew Nguyen\n"); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
acb8429
to
2f66d61
Compare
It should be fixed. I squashed it to one commit, removed the reverts, and made a static ResetRumble() function that is called whenever the rumble reset is needed. |
#if defined(__LIBUSB__) | ||
GCAdapter::ResetRumble(); | ||
#endif | ||
#if defined(CIFACE_USE_XINPUT) || defined(CIFACE_USE_DINPUT) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/Core/Core.cpp
Outdated
GCAdapter::ResetRumble(); | ||
#endif | ||
#if defined(CIFACE_USE_XINPUT) || defined(CIFACE_USE_DINPUT) | ||
for (int i = 0; i != 4; ++i) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/Core/Core.cpp
Outdated
@@ -806,6 +801,17 @@ static bool PauseAndLock(bool do_lock, bool unpause_on_unlock) | |||
return was_unpaused; | |||
} | |||
|
|||
static void ResetRumble() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Code looks fine to me now, but please rebase your branch and squash the commits. |
cc95a85
to
32a92a3
Compare
Sorry it took me a while. I had squashed the commits, but asked my partner to move the ResetRumble() function and he didn't squash his commits. The commit has been rebased and squashed to one commit, with ResetRumble() above the Stop() function where it was first called. |
This fixes the old issue of rumble not stopping when emulation is paused. It was fixed for the GameCube adapter and LibUSB controllers here, but that fix did not work for XInput or DInput controllers on Windows.
A partner and I tested on two different machines in multiple games and multiple controllers. With XInput controllers, the rumble stopped on emulation pause and resumed where appropriate, and stopped properly on emulation close. Neither me nor my partner were able to test with DInput. I have a DInput controller, but my rumble motors are not recognized by Dolphin on any build that I've tested.
I believe it follows the code style guidelines, but this is the first pull request from my team so if anything is off please let us know.