diff options
Diffstat (limited to 'backends/platform/psp/input.cpp')
-rw-r--r-- | backends/platform/psp/input.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/backends/platform/psp/input.cpp b/backends/platform/psp/input.cpp index e087099585..7a2047f28e 100644 --- a/backends/platform/psp/input.cpp +++ b/backends/platform/psp/input.cpp @@ -280,12 +280,6 @@ bool Nub::getEvent(Common::Event &event, PspEvent &pspEvent, SceCtrlData &pad) { analogStepX = modifyNubAxisMotion(analogStepX); analogStepY = modifyNubAxisMotion(analogStepY); - static int32 hiresX = 0; - static int32 hiresY = 0; - - hiresX += analogStepX; - hiresY += analogStepY; - int32 speedFactor = 25; switch (ConfMan.getInt("kbdmouse_speed")) { // 0.25 keyboard pointer speed @@ -324,18 +318,24 @@ bool Nub::getEvent(Common::Event &event, PspEvent &pspEvent, SceCtrlData &pad) { speedFactor = 25; } - int32 additionalFactor = 32; + // the larger the factor, the slower the cursor will move + int32 additionalFactor = 16; if (_shifted) { - additionalFactor = 256; + additionalFactor = 192; } - int32 factor = speedFactor * additionalFactor / 25; + int32 factor = (speedFactor * additionalFactor) / 25; + + // hi-res cumulative analog delta for sub-pixel cursor positioning + _hiresX += (analogStepX * 1024) / factor; + _hiresY += (analogStepY * 1024) / factor; - analogStepX = hiresX / factor; - analogStepY = hiresY / factor; + analogStepX = (_hiresX / 1024); + analogStepY = (_hiresY / 1024); - hiresX %= factor; - hiresY %= factor; + // keep track of remainder for true sub-pixel cursor position + _hiresX %= 1024; + _hiresY %= 1024; int32 oldX = _cursor->getX(); int32 oldY = _cursor->getY(); |