Get the WIIU GCA working on Mac OSX

== DETAILS
The GCA uses a weird HID class that our current filters don't
catch, so we add it.

Needed to do a small amount of tweaking on the GCA driver to
account for iohidmanager weirdness.
This commit is contained in:
Nathan Strong 2021-10-06 23:09:13 -07:00
parent 3f179a5762
commit ea249b3827
2 changed files with 10 additions and 0 deletions

View File

@ -215,6 +215,14 @@ static void hidpad_wiiugca_packet_handler(void *device_data, uint8_t *packet, ui
if (!device)
return;
/* Mac OSX reads a 39-byte packet which has both a leading and trailing byte from
* the actual packet data.
*/
#if defined(__APPLE__) && defined(HAVE_IOHIDMANAGER)
packet++;
size = 37;
#endif
memcpy(device->data, packet, size);
for (i = 1; i < 37; i += 9)

View File

@ -1021,6 +1021,8 @@ static int iohidmanager_hid_manager_set_device_matching(
iohidmanager_hid_append_matching_dictionary(matcher,
kHIDPage_GenericDesktop,
kHIDUsage_GD_GamePad);
/* The GameCube Adapter reports usage id 0x00 */
iohidmanager_hid_append_matching_dictionary(matcher, kHIDPage_Game, 0x00);
IOHIDManagerSetDeviceMatchingMultiple(hid->ptr, matcher);
IOHIDManagerRegisterDeviceMatchingCallback(hid->ptr,iohidmanager_hid_device_matched, 0);