diff --git a/input/drivers/cocoa_input.c b/input/drivers/cocoa_input.c index 61c459545d..b680f7d2b9 100644 --- a/input/drivers/cocoa_input.c +++ b/input/drivers/cocoa_input.c @@ -223,7 +223,7 @@ int32_t cocoa_input_find_any_axis(uint32_t port) if (apple && apple->joypad) apple->joypad->poll(); - for (i = 0; i < 4; i++) + for (i = 0; i < 6; i++) { int16_t value = apple->axes[port][i]; diff --git a/input/drivers/cocoa_input.h b/input/drivers/cocoa_input.h index be4553c2fa..790296f061 100644 --- a/input/drivers/cocoa_input.h +++ b/input/drivers/cocoa_input.h @@ -56,7 +56,7 @@ typedef struct uint32_t buttons[MAX_USERS]; uint32_t mfi_buttons[MAX_USERS]; - int16_t axes[MAX_USERS][4]; + int16_t axes[MAX_USERS][6]; int8_t hats[NUM_HATS][2]; bool icade_enabled; diff --git a/input/drivers_hid/iohidmanager_hid.c b/input/drivers_hid/iohidmanager_hid.c index e499636ec2..4c1f7ad629 100644 --- a/input/drivers_hid/iohidmanager_hid.c +++ b/input/drivers_hid/iohidmanager_hid.c @@ -112,7 +112,7 @@ static int16_t iohidmanager_hid_joypad_axis(void *data, unsigned port, uint32_t return 0; #endif - if (AXIS_NEG_GET(joyaxis) < 4) + if (AXIS_NEG_GET(joyaxis) < 6) { #if defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) val += apple->axes[port][AXIS_NEG_GET(joyaxis)]; @@ -122,7 +122,7 @@ static int16_t iohidmanager_hid_joypad_axis(void *data, unsigned port, uint32_t if (val >= 0) val = 0; } - else if(AXIS_POS_GET(joyaxis) < 4) + else if(AXIS_POS_GET(joyaxis) < 6) { #if defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) val += apple->axes[port][AXIS_POS_GET(joyaxis)]; @@ -198,9 +198,9 @@ static void iohidmanager_hid_device_input_callback(void *data, IOReturn result, default: { int i; - static const uint32_t axis_use_ids[4] = { 48, 49, 50, 53 }; + static const uint32_t axis_use_ids[6] = { 48, 49, 50, 51, 52, 53 }; - for (i = 0; i < 4; i ++) + for (i = 0; i < 6; i ++) { #if defined(HAVE_COCOA) || defined(HAVE_COCOATOUCH) CFIndex min = IOHIDElementGetPhysicalMin(element); diff --git a/input/drivers_hid/mfi_hid.m b/input/drivers_hid/mfi_hid.m index 6561e62965..0c4dc90471 100644 --- a/input/drivers_hid/mfi_hid.m +++ b/input/drivers_hid/mfi_hid.m @@ -77,6 +77,9 @@ static void apple_gamecontroller_poll(GCController *controller) apple->axes[slot][1] = gp.leftThumbstick.yAxis.value * 32767.0f; apple->axes[slot][2] = gp.rightThumbstick.xAxis.value * 32767.0f; apple->axes[slot][3] = gp.rightThumbstick.yAxis.value * 32767.0f; + apple->axes[slot][4] = gp.rightThumbstick.yAxis.value * 32767.0f; + apple->axes[slot][5] = gp.rightThumbstick.yAxis.value * 32767.0f; + } else if (controller.gamepad) {