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.
This commit is contained in:
Unknown W. Brackets 2013-06-20 01:00:53 -07:00
parent df4adeec35
commit 250260cccd

View file

@ -161,11 +161,11 @@ void __CtrlSetAnalog(float x, float y, int stick)
{
std::lock_guard<std::recursive_mutex> 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);
}
}