Cleanup 8BitDo HIDAPI support for SF30 Pro and SN30 Pro

This sets the correct number of buttons for older controllers, and adds parsing for older firmware USB reports
This commit is contained in:
Sam Lantinga
2025-05-07 11:53:55 -07:00
parent 89a8cf2505
commit 5bee85408c
5 changed files with 146 additions and 41 deletions

View File

@@ -3175,24 +3175,6 @@ bool SDL_IsJoystickHoriSteamController(Uint16 vendor_id, Uint16 product_id)
return vendor_id == USB_VENDOR_HORI && (product_id == USB_PRODUCT_HORI_STEAM_CONTROLLER || product_id == USB_PRODUCT_HORI_STEAM_CONTROLLER_BT);
}
bool SDL_IsJoystick8BitDoController(Uint16 vendor_id, Uint16 product_id)
{
if (vendor_id == USB_VENDOR_8BITDO) {
switch (product_id) {
case USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS:
case USB_PRODUCT_8BITDO_SN30_PRO:
case USB_PRODUCT_8BITDO_SN30_PRO_BT:
case USB_PRODUCT_8BITDO_SF30_PRO:
case USB_PRODUCT_8BITDO_PRO_2:
case USB_PRODUCT_8BITDO_PRO_2_BT:
return true;
default:
break;
}
}
return false;
}
bool SDL_IsJoystickSteamDeck(Uint16 vendor_id, Uint16 product_id)
{
EControllerType eType = GuessControllerType(vendor_id, product_id);