mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 16:20:27 +00:00
(Apple) Fix iCade support
This commit is contained in:
parent
3a11aca654
commit
1e67100ac6
@ -32,7 +32,7 @@ static void hid_input_callback(void* inContext, IOReturn inResult, void* inSende
|
||||
|
||||
if (type == 2 && page == 9)
|
||||
{
|
||||
int state = (int)IOHIDValueGetIntegerValue(inIOHIDValueRef);
|
||||
CFIndex state = IOHIDValueGetIntegerValue(inIOHIDValueRef);
|
||||
|
||||
if (state) g_current_input_data.pad_buttons[slot] |= (1 << (use - 1));
|
||||
else g_current_input_data.pad_buttons[slot] &= ~(1 << (use - 1));
|
||||
@ -45,15 +45,8 @@ static void hid_input_callback(void* inContext, IOReturn inResult, void* inSende
|
||||
if (use == axis_use_ids[i])
|
||||
{
|
||||
CFIndex min = IOHIDElementGetPhysicalMin(element);
|
||||
CFIndex max = IOHIDElementGetPhysicalMax(element);
|
||||
CFIndex state = IOHIDValueGetIntegerValue(inIOHIDValueRef);
|
||||
|
||||
if (min != 0)
|
||||
{
|
||||
max -= min;
|
||||
state -= min;
|
||||
min = 0;
|
||||
}
|
||||
CFIndex max = IOHIDElementGetPhysicalMax(element) - min;
|
||||
CFIndex state = IOHIDValueGetIntegerValue(inIOHIDValueRef) - min;
|
||||
|
||||
float val = (float)state / (float)max;
|
||||
g_current_input_data.pad_axis[slot][i] = ((val * 2.0f) - 1.0f) * 32767.0f;
|
||||
|
@ -131,6 +131,7 @@ static void apple_input_poll(void *data)
|
||||
}
|
||||
|
||||
input_joypad_poll(g_joydriver);
|
||||
g_polled_input_data.pad_buttons[0] |= icade_buttons;
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user