From fa5ca5a0fd5732506cb4c23f02a3936dc7e3f041 Mon Sep 17 00:00:00 2001 From: abcpea Date: Sun, 29 Mar 2026 15:10:42 +1100 Subject: [PATCH] Requested change --- src/pc/controller/controller_sdl2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pc/controller/controller_sdl2.c b/src/pc/controller/controller_sdl2.c index 40b2d09a2..9ed46f263 100644 --- a/src/pc/controller/controller_sdl2.c +++ b/src/pc/controller/controller_sdl2.c @@ -178,8 +178,6 @@ static inline void update_button(const int i, const bool new) { static inline void update_analog_stick(s8 *stick_x, s8 *stick_y, int16_t input_x, int16_t input_y) { - static const float INPUT_ABS_MAX = 0x8000; - float magnitude_sq = (float)(input_x * input_x) + (float)(input_y * input_y); float deadzone = configStickDeadzone * DEADZONE_STEP; @@ -188,7 +186,7 @@ static inline void update_analog_stick(s8 *stick_x, s8 *stick_y, float dir_x = (float)input_x / magnitude; float dir_y = (float)input_y / magnitude; float scale = 1.f / fmaxf(fabsf(dir_x), fabsf(dir_y)); - float max_magnitude = INPUT_ABS_MAX * scale; + float max_magnitude = 0x8000 * scale; magnitude -= deadzone; magnitude *= max_magnitude / (max_magnitude - deadzone);