From 38003227358683ed9163c9b7574c3cb0c4a23749 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 19 Mar 2022 17:45:04 -0700 Subject: [PATCH] CInputGenerator: Toggle rumble if a controller is connected and it's a GC controller --- Runtime/Input/CInputGenerator.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Runtime/Input/CInputGenerator.cpp b/Runtime/Input/CInputGenerator.cpp index bdddd8ad5..1f0e379dc 100644 --- a/Runtime/Input/CInputGenerator.cpp +++ b/Runtime/Input/CInputGenerator.cpp @@ -47,6 +47,14 @@ void CInputGenerator::controllerAdded(uint32_t which) noexcept { aurora::set_controller_player_index(which, 0); } + if (m_state[player].m_hasRumble && m_state[player].m_isGamecube) { + /* The GameCube controller can get stuck in a state where it's always rumbling if the game crashes + * (this can actually happen on hardware in certain cases) + * so lets toggle the motors to ensure they're off, this happens so quickly the player doesn't notice + */ + aurora::controller_rumble(which, 1, 1); + aurora::controller_rumble(which, 0, 0); + } m_state[player] = SAuroraControllerState(which, aurora::is_controller_gamecube(which), aurora::controller_has_rumble(which)); }