From 9f902c8bd4812b958a1b5eb253e1f69f78f4d245 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 15 Apr 2021 07:27:43 +0200 Subject: [PATCH] input_joypad_analog_button - only call fabs when input value is not 0 --- retroarch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retroarch.c b/retroarch.c index e29021a89a..dd32c33d3e 100644 --- a/retroarch.c +++ b/retroarch.c @@ -25116,9 +25116,9 @@ static int16_t input_joypad_analog_button( { int16_t mult = 0; if (axis != AXIS_NONE) - mult = drv->axis( - joypad_info->joy_idx, axis); - normal_mag = fabs((1.0f / 0x7fff) * mult); + if ((mult = drv->axis( + joypad_info->joy_idx, axis)) != 0) + normal_mag = fabs((1.0f / 0x7fff) * mult); } /* If the result is zero, it's got a digital button