mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-12-23 11:31:41 +00:00
Joystick controller fixes
- only poll for joystick connectivity once per second - if keypad joystick enabled, pump the handler
This commit is contained in:
parent
575bb2448b
commit
5c6c66f243
@ -91,6 +91,10 @@ void gldriver_joystick_reset(void) {
|
|||||||
#pragma mark Joystick connectivity polling
|
#pragma mark Joystick connectivity polling
|
||||||
|
|
||||||
- (void)connectivityPoll:(NSNotification *)notification
|
- (void)connectivityPoll:(NSNotification *)notification
|
||||||
|
{
|
||||||
|
static unsigned int counter = 0;
|
||||||
|
counter = (counter+1) % 60;
|
||||||
|
if (counter == 0)
|
||||||
{
|
{
|
||||||
NSArray *joysticks = [DDHidJoystick allJoysticks];
|
NSArray *joysticks = [DDHidJoystick allJoysticks];
|
||||||
BOOL changed = ([joysticks count] != [self.allJoysticks count]);
|
BOOL changed = ([joysticks count] != [self.allJoysticks count]);
|
||||||
@ -108,6 +112,13 @@ void gldriver_joystick_reset(void) {
|
|||||||
[self resetJoysticks];
|
[self resetJoysticks];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef KEYPAD_JOYSTICK
|
||||||
|
if (joy_mode == JOY_KPAD)
|
||||||
|
{
|
||||||
|
c_keys_handle_input(-1, 0, 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark NSObject(DDHidJoystickDelegate)
|
#pragma mark NSObject(DDHidJoystickDelegate)
|
||||||
|
Loading…
Reference in New Issue
Block a user