(MFi) No longer let MFi pad go through 'pad connection'
This commit is contained in:
parent
6f50187b56
commit
c84b76c394
|
@ -24,9 +24,6 @@
|
||||||
#include <AvailabilityMacros.h>
|
#include <AvailabilityMacros.h>
|
||||||
#import <GameController/GameController.h>
|
#import <GameController/GameController.h>
|
||||||
|
|
||||||
#include "../connect/joypad_connection.h"
|
|
||||||
|
|
||||||
joypad_connection_t *slots;
|
|
||||||
static uint32_t mfi_buttons[MAX_USERS];
|
static uint32_t mfi_buttons[MAX_USERS];
|
||||||
static int16_t mfi_axes[MAX_USERS][6];
|
static int16_t mfi_axes[MAX_USERS][6];
|
||||||
|
|
||||||
|
@ -133,27 +130,8 @@ static void apple_gamecontroller_joypad_register(GCGamepad *gamepad)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t apple_gamecontroller_joypad_connect_gcapi(joypad_connection_t *joyconn)
|
|
||||||
{
|
|
||||||
int pad = pad_connection_find_vacant_pad(joyconn);
|
|
||||||
|
|
||||||
if (pad >= 0 && pad < MAX_USERS)
|
|
||||||
{
|
|
||||||
joypad_connection_t *s = (joypad_connection_t*)&joyconn[pad];
|
|
||||||
|
|
||||||
if (s)
|
|
||||||
s->connected = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pad;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void apple_gamecontroller_joypad_connect(GCController *controller)
|
static void apple_gamecontroller_joypad_connect(GCController *controller)
|
||||||
{
|
{
|
||||||
int32_t slot = apple_gamecontroller_joypad_connect_gcapi(slots);
|
|
||||||
|
|
||||||
controller.playerIndex = (slot >= 0 && slot < MAX_USERS) ? slot : GCCONTROLLER_PLAYER_INDEX_UNSET;
|
|
||||||
|
|
||||||
if (controller.playerIndex == GCControllerPlayerIndexUnset)
|
if (controller.playerIndex == GCControllerPlayerIndexUnset)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -165,8 +143,6 @@ static void apple_gamecontroller_joypad_disconnect(GCController* controller)
|
||||||
unsigned pad = (uint32_t)controller.playerIndex;
|
unsigned pad = (uint32_t)controller.playerIndex;
|
||||||
if (pad == GCCONTROLLER_PLAYER_INDEX_UNSET)
|
if (pad == GCCONTROLLER_PLAYER_INDEX_UNSET)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pad_connection_pad_deinit(&slots[pad], pad);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool apple_gamecontroller_joypad_init(void *data)
|
bool apple_gamecontroller_joypad_init(void *data)
|
||||||
|
|
Loading…
Reference in New Issue