PSP: don't block on joystick event query
using the blocking sceCtrlReadBufferPositive() effectively turns SDL_PollEvent() into WaitForVblank(), because the functions does exactly that if no input is buffered.
due to this, calling SDL_PollEvent() once per frame averaged in 7 ms delay out of the available 16ms budget to get a frame calculated and drawn to achieve 60 fps.
(cherry picked from commit 86f223d664
)
This commit is contained in:
parent
747300b356
commit
7169db1e62
1 changed files with 1 additions and 1 deletions
|
@ -209,7 +209,7 @@ static void PSP_JoystickUpdate(SDL_Joystick *joystick)
|
|||
static unsigned char old_x = 0, old_y = 0;
|
||||
Uint64 timestamp = SDL_GetTicksNS();
|
||||
|
||||
sceCtrlReadBufferPositive(&pad, 1);
|
||||
if(sceCtrlPeekBufferPositive(&pad, 1) <= 0) return;
|
||||
buttons = pad.Buttons;
|
||||
x = pad.Lx;
|
||||
y = pad.Ly;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue