remove video callback - prevents over-reading of pads

This commit is contained in:
dborth 2009-07-01 18:30:33 +00:00
parent 6478c23656
commit 22d0644b0c

View file

@ -129,8 +129,6 @@ static int __jspad_enabled = 1;
static int __numwiijoysticks = 4; static int __numwiijoysticks = 4;
static int __numgcjoysticks = 4; static int __numgcjoysticks = 4;
static int __num_joysticks_open = 0;
/* Helpers to separate nunchuk vs classic buttons which share the /* Helpers to separate nunchuk vs classic buttons which share the
* same scan codes. In particular, up on the classic controller is * same scan codes. In particular, up on the classic controller is
* the same as Z on the nunchuk. The numbers refer to the sdl_buttons_wii * the same as Z on the nunchuk. The numbers refer to the sdl_buttons_wii
@ -167,14 +165,6 @@ const char *SDL_SYS_JoystickName(int index)
return (const char *)joy_name; return (const char *)joy_name;
} }
static void
UpdatePadsCB()
{
WPAD_ScanPads();
PAD_ScanPads();
}
/* Function to open a joystick for use. /* Function to open a joystick for use.
The joystick to open is specified by the index field of the joystick. The joystick to open is specified by the index field of the joystick.
This should fill the nbuttons and naxes fields of the joystick structure. This should fill the nbuttons and naxes fields of the joystick structure.
@ -212,12 +202,6 @@ int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
joystick->nhats = MAX_GC_HATS; joystick->nhats = MAX_GC_HATS;
} }
} }
/* Update pads at vertical retrace */
if(__num_joysticks_open == 0)
VIDEO_SetPostRetraceCallback ((VIRetraceCallback)UpdatePadsCB);
__num_joysticks_open++;
return(0); return(0);
} }
@ -480,6 +464,9 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
if(!joystick || !joystick->hwdata) if(!joystick || !joystick->hwdata)
return; return;
WPAD_ScanPads();
PAD_ScanPads();
switch(((joystick_hwdata*)(joystick->hwdata))->type) switch(((joystick_hwdata*)(joystick->hwdata))->type)
{ {
case 0: case 0:
@ -502,11 +489,6 @@ void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
return; return;
SDL_free(joystick->hwdata); SDL_free(joystick->hwdata);
/* Clear callback again */
__num_joysticks_open--;
if (__num_joysticks_open == 0)
VIDEO_SetPostRetraceCallback (NULL);
} }
/* Function to perform any system-specific joystick related cleanup */ /* Function to perform any system-specific joystick related cleanup */