From c95c43bfb6f28861380de41b9c1e7f45ae6243e4 Mon Sep 17 00:00:00 2001 From: Tony Gong Date: Sun, 27 Feb 2022 09:58:21 -0800 Subject: [PATCH] Make pos/neg analog axes symmetrical Currently, the axes for the main and C sticks range from 0-255, with 128 being the mid-point; but this isn't symmetrical: the negative axis has 128 values not including 0, while the positive axis has 127 values not including 0. Normalizing so that the range is 1-255 makes the positive and negative axes symmetrical. The inability to yield 0 shouldn't be an issue as a real GC controller cannot yield it anyway. --- Source/Core/Core/HW/GCPadEmu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/HW/GCPadEmu.cpp b/Source/Core/Core/HW/GCPadEmu.cpp index 13fb79e28a..e387d4765a 100644 --- a/Source/Core/Core/HW/GCPadEmu.cpp +++ b/Source/Core/Core/HW/GCPadEmu.cpp @@ -158,12 +158,12 @@ GCPadStatus GCPad::GetInput() const // sticks const auto main_stick_state = m_main_stick->GetState(); - pad.stickX = MapFloat(main_stick_state.x, GCPadStatus::MAIN_STICK_CENTER_X); - pad.stickY = MapFloat(main_stick_state.y, GCPadStatus::MAIN_STICK_CENTER_Y); + pad.stickX = MapFloat(main_stick_state.x, GCPadStatus::MAIN_STICK_CENTER_X, 1); + pad.stickY = MapFloat(main_stick_state.y, GCPadStatus::MAIN_STICK_CENTER_Y, 1); const auto c_stick_state = m_c_stick->GetState(); - pad.substickX = MapFloat(c_stick_state.x, GCPadStatus::C_STICK_CENTER_X); - pad.substickY = MapFloat(c_stick_state.y, GCPadStatus::C_STICK_CENTER_Y); + pad.substickX = MapFloat(c_stick_state.x, GCPadStatus::C_STICK_CENTER_X, 1); + pad.substickY = MapFloat(c_stick_state.y, GCPadStatus::C_STICK_CENTER_Y, 1); // triggers std::array triggers;