From 3f7fed48c93c966b1ffa3eafa78957273b320973 Mon Sep 17 00:00:00 2001 From: Cristian Boehm <75502884+GalaxisBeast@users.noreply.github.com> Date: Sat, 5 Sep 2026 04:20:15 -0400 Subject: [PATCH] Fix GC Pocket+ rumble stop handling (#148) --- aurora-main/lib/input.cpp | 9 +++++++++ aurora-main/lib/input.hpp | 1 + 2 files changed, 10 insertions(+) diff --git a/aurora-main/lib/input.cpp b/aurora-main/lib/input.cpp index 8884f1a..6c9418b 100644 --- a/aurora-main/lib/input.cpp +++ b/aurora-main/lib/input.cpp @@ -401,6 +401,8 @@ SDL_JoystickID add_controller(SDL_JoystickID which) noexcept { return -1; } controller.m_isGameCube = controller.m_vid == 0x057E && controller.m_pid == 0x0337; + const char* serial = SDL_GetGamepadSerial(ctrl); + controller.m_gameCubeUseOrdinaryStop = controller.m_isGameCube && serial && "GCP+"sv == serial; if (controller.m_isGameCube || (SDL_GetGamepadType(ctrl) == SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO && controller.m_pid == 0x2073)) { controller.m_deadZones.emulateTriggers = false; @@ -481,6 +483,13 @@ bool controller_has_rumble(Uint32 instance) noexcept { void controller_rumble(uint32_t instance, uint16_t low_freq_intensity, uint16_t high_freq_intensity, uint16_t duration_ms) noexcept { if (auto it = g_GameControllers.find(instance); it != g_GameControllers.end()) { + // GC Pocket+ has been observed continuing to vibrate after a hard stop; + // an ordinary stop cleared it. With GAMECUBE_RUMBLE_BRAKE enabled, SDL + // encodes (0, 1) as adapter command 0, whereas (0, 0) sends command 2. + // Apply the workaround here so shutdown uses the same stop as PAD calls. + if (it->second.m_gameCubeUseOrdinaryStop && low_freq_intensity == 0 && high_freq_intensity == 0) { + high_freq_intensity = 1; + } SDL_RumbleGamepad(it->second.m_controller, low_freq_intensity, high_freq_intensity, duration_ms); } } diff --git a/aurora-main/lib/input.hpp b/aurora-main/lib/input.hpp index 1c6f24e..ae083b1 100644 --- a/aurora-main/lib/input.hpp +++ b/aurora-main/lib/input.hpp @@ -17,6 +17,7 @@ extern Module Log; struct GameController { SDL_Gamepad* m_controller = nullptr; bool m_isGameCube = false; + bool m_gameCubeUseOrdinaryStop = false; Sint32 m_index = -1; Sint32 m_playerIndex = -1; bool m_hasRumble = false;