Skip to content

Commit

Permalink
Fix rumble on emulation pause
Browse files Browse the repository at this point in the history
Resets rumble on emulation pause and rumble for XInput/DInput controllers
  • Loading branch information
Kekker-git committed Mar 21, 2018
1 parent c661561 commit acb8429
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/Core/Core/Core.cpp
Expand Up @@ -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)
Pad::ResetRumble(i);
#endif

#ifdef USE_MEMORYWATCHER
MemoryWatcher::Shutdown();
Expand Down Expand Up @@ -669,6 +673,10 @@ void SetState(State state)
Wiimote::Pause();
#if defined(__LIBUSB__)
GCAdapter::ResetRumble();
#endif
#if defined(CIFACE_USE_XINPUT) || defined(CIFACE_USE_DINPUT)
for (int i = 0; i != 4; ++i)
Pad::ResetRumble(i);
#endif
break;
case State::Running:
Expand Down
5 changes: 5 additions & 0 deletions Source/Core/Core/HW/GCPad.cpp
Expand Up @@ -60,6 +60,11 @@ void Rumble(const int pad_num, const ControlState strength)
static_cast<GCPad*>(s_config.GetController(pad_num))->SetOutput(strength);
}

void ResetRumble(const int pad_num)
{
static_cast<GCPad*>(s_config.GetController(pad_num))->SetOutput(0.0);
}

bool GetMicButton(const int pad_num)
{
return static_cast<GCPad*>(s_config.GetController(pad_num))->GetMicButton();
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/HW/GCPad.h
Expand Up @@ -27,6 +27,7 @@ InputConfig* GetConfig();
GCPadStatus GetStatus(int pad_num);
ControllerEmu::ControlGroup* GetGroup(int pad_num, PadGroup group);
void Rumble(int pad_num, ControlState strength);
void ResetRumble(int pad_num);

bool GetMicButton(int pad_num);
}

0 comments on commit acb8429

Please sign in to comment.