From 604ff20b0d205bea04c6fe02f5bc7a395af554ae Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 10 Jul 2020 20:15:45 +1000 Subject: [PATCH] AnalogController: Treat rumble as binary on/off Fixes vibration in Final Fantasy 8. --- src/core/analog_controller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/analog_controller.cpp b/src/core/analog_controller.cpp index 65d7af65e..912d218d9 100644 --- a/src/core/analog_controller.cpp +++ b/src/core/analog_controller.cpp @@ -258,7 +258,7 @@ bool AnalogController::Transfer(const u8 data_in, u8* data_out) case State::GetStateButtonsLSB: { if (m_rumble_unlocked) - SetMotorState(1, data_in != 0 ? 255 : 0); + SetMotorState(1, ((data_in & 0xC0) == 0x40) ? 255 : 0); *data_out = Truncate8(m_button_state); m_state = State::GetStateButtonsMSB; @@ -269,7 +269,7 @@ bool AnalogController::Transfer(const u8 data_in, u8* data_out) case State::GetStateButtonsMSB: { if (m_rumble_unlocked) - SetMotorState(0, data_in); + SetMotorState(0, ((data_in & 0x01) != 0) ? 255 : 0); *data_out = Truncate8(m_button_state >> 8); m_state = m_analog_mode ? State::GetStateRightAxisX : State::Idle;