From 250260cccdee1f76bca462cb1e4dbde48ac7e07c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 20 Jun 2013 01:00:53 -0700 Subject: [PATCH] Fix sceCtrl analog range for all input devices. It should map (-1.0... 0.0... 1.0) to (0... 128... 255.) However, it was instead being mapped to (1... 128... 255.) This was causing games to not respect analog movement if they checked for 100%. Fixes #2363. --- Core/HLE/sceCtrl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/HLE/sceCtrl.cpp b/Core/HLE/sceCtrl.cpp index d38bd48151..7d032010f4 100644 --- a/Core/HLE/sceCtrl.cpp +++ b/Core/HLE/sceCtrl.cpp @@ -161,11 +161,11 @@ void __CtrlSetAnalog(float x, float y, int stick) { std::lock_guard guard(ctrlMutex); if (stick == 0) { - ctrlCurrent.analog[0] = (u8)(x * 127.f + 128.f); - ctrlCurrent.analog[1] = (u8)(-y * 127.f + 128.f); + ctrlCurrent.analog[0] = (u8)(x * 127.5f + 128.f); + ctrlCurrent.analog[1] = (u8)(-y * 127.5f + 128.f); } else { - ctrlCurrent.analogRight[0] = (u8)(x * 127.f + 128.f); - ctrlCurrent.analogRight[1] = (u8)(-y * 127.f + 128.f); + ctrlCurrent.analogRight[0] = (u8)(x * 127.5f + 128.f); + ctrlCurrent.analogRight[1] = (u8)(-y * 127.5f + 128.f); } }