Skip to content

Commit

Permalink
Vita: decrease default joystick sensitivity (was too fast)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Mar 16, 2018
1 parent 9e2fccf commit a7d2691
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions src/psp2/psp2_input.c
Expand Up @@ -116,26 +116,33 @@ void PSP2_HandleJoysticks() {
int analogX = SDL_JoystickGetAxis(vitaJoy0, 0);
int analogY = SDL_JoystickGetAxis(vitaJoy0, 1);

rescaleAnalog( &analogX, &analogY, 1000);
rescaleAnalog( &analogX, &analogY, 3000);
hiresDX += analogX;
hiresDY += analogY;

if (insideMenu) {
SDL_WarpMouse(lastmx + hiresDX / 2048, lastmy + hiresDY / 2048);
}
else
{
SDL_Event event;
event.type = SDL_MOUSEMOTION;
event.motion.x = lastmx + hiresDX / 2048;
event.motion.y = lastmy + hiresDY / 2048;
event.motion.xrel = hiresDX / 2048;
event.motion.yrel = hiresDY / 2048;
SDL_PushEvent(&event);
}
const int slowdown = 4096;

if (hiresDX != 0 || hiresDY != 0) {
int xrel = hiresDX / slowdown;
int yrel = hiresDY / slowdown;

hiresDX = hiresDX - ((hiresDX / 2048) * 2048);
hiresDY = hiresDY - ((hiresDY / 2048) * 2048);
if (insideMenu) {
SDL_WarpMouse(lastmx + xrel, lastmy + yrel);
}
else
{
SDL_Event event;
event.type = SDL_MOUSEMOTION;
event.motion.x = lastmx + xrel;
event.motion.y = lastmy + yrel;
event.motion.xrel = xrel;
event.motion.yrel = yrel;
SDL_PushEvent(&event);
}

hiresDX %= slowdown;
hiresDY %= slowdown;
}
}


Expand Down

0 comments on commit a7d2691

Please sign in to comment.