Merge pull request #13081 from gblues/gblues/osx-hid-gca

Get the WIIU GCA working on Mac OSX
This commit is contained in:
Autechre 2021-10-07 16:23:01 +02:00 committed by GitHub
commit 00a5b5411f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);