winebus: Move device identification helpers to unixlib.h.
This commit is contained in:
parent
814d2c176d
commit
13d8571b08
3 changed files with 40 additions and 44 deletions
|
@ -266,8 +266,4 @@ extern void hid_device_drop_report(struct unix_device *iface);
|
|||
|
||||
extern void hid_device_set_effect_state(struct unix_device *iface, BYTE index, BYTE flags);
|
||||
|
||||
BOOL is_xbox_gamepad(WORD vid, WORD pid);
|
||||
BOOL is_dualshock4_gamepad(WORD vid, WORD pid);
|
||||
BOOL is_dualsense_gamepad(WORD vid, WORD pid);
|
||||
|
||||
#endif /* __WINEBUS_UNIX_PRIVATE_H */
|
||||
|
|
|
@ -38,46 +38,6 @@
|
|||
|
||||
#include "unix_private.h"
|
||||
|
||||
BOOL is_xbox_gamepad(WORD vid, WORD pid)
|
||||
{
|
||||
if (vid != 0x045e) return FALSE;
|
||||
if (pid == 0x0202) return TRUE; /* Xbox Controller */
|
||||
if (pid == 0x0285) return TRUE; /* Xbox Controller S */
|
||||
if (pid == 0x0289) return TRUE; /* Xbox Controller S */
|
||||
if (pid == 0x028e) return TRUE; /* Xbox360 Controller */
|
||||
if (pid == 0x028f) return TRUE; /* Xbox360 Wireless Controller */
|
||||
if (pid == 0x02d1) return TRUE; /* Xbox One Controller */
|
||||
if (pid == 0x02dd) return TRUE; /* Xbox One Controller (Covert Forces/Firmware 2015) */
|
||||
if (pid == 0x02e0) return TRUE; /* Xbox One X Controller */
|
||||
if (pid == 0x02e3) return TRUE; /* Xbox One Elite Controller */
|
||||
if (pid == 0x02e6) return TRUE; /* Wireless XBox Controller Dongle */
|
||||
if (pid == 0x02ea) return TRUE; /* Xbox One S Controller */
|
||||
if (pid == 0x02fd) return TRUE; /* Xbox One S Controller (Firmware 2017) */
|
||||
if (pid == 0x0b00) return TRUE; /* Xbox Elite 2 */
|
||||
if (pid == 0x0b05) return TRUE; /* Xbox Elite 2 Wireless */
|
||||
if (pid == 0x0b12) return TRUE; /* Xbox Series */
|
||||
if (pid == 0x0b13) return TRUE; /* Xbox Series Wireless */
|
||||
if (pid == 0x0719) return TRUE; /* Xbox 360 Wireless Adapter */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL is_dualshock4_gamepad(WORD vid, WORD pid)
|
||||
{
|
||||
if (vid != 0x054c) return FALSE;
|
||||
if (pid == 0x05c4) return TRUE; /* DualShock 4 [CUH-ZCT1x] */
|
||||
if (pid == 0x09cc) return TRUE; /* DualShock 4 [CUH-ZCT2x] */
|
||||
if (pid == 0x0ba0) return TRUE; /* Dualshock 4 Wireless Adaptor */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL is_dualsense_gamepad(WORD vid, WORD pid)
|
||||
{
|
||||
if (vid != 0x054c) return FALSE;
|
||||
if (pid == 0x0ce6) return TRUE; /* DualSense */
|
||||
if (pid == 0x0df2) return TRUE; /* DualSense Edge */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
struct mouse_device
|
||||
{
|
||||
struct unix_device unix_device;
|
||||
|
|
|
@ -152,4 +152,44 @@ static inline const char *debugstr_device_desc(struct device_desc *desc)
|
|||
desc->vid, desc->pid, desc->version, desc->input, desc->uid, desc->is_gamepad, desc->is_hidraw);
|
||||
}
|
||||
|
||||
static inline BOOL is_xbox_gamepad(WORD vid, WORD pid)
|
||||
{
|
||||
if (vid != 0x045e) return FALSE;
|
||||
if (pid == 0x0202) return TRUE; /* Xbox Controller */
|
||||
if (pid == 0x0285) return TRUE; /* Xbox Controller S */
|
||||
if (pid == 0x0289) return TRUE; /* Xbox Controller S */
|
||||
if (pid == 0x028e) return TRUE; /* Xbox360 Controller */
|
||||
if (pid == 0x028f) return TRUE; /* Xbox360 Wireless Controller */
|
||||
if (pid == 0x02d1) return TRUE; /* Xbox One Controller */
|
||||
if (pid == 0x02dd) return TRUE; /* Xbox One Controller (Covert Forces/Firmware 2015) */
|
||||
if (pid == 0x02e0) return TRUE; /* Xbox One X Controller */
|
||||
if (pid == 0x02e3) return TRUE; /* Xbox One Elite Controller */
|
||||
if (pid == 0x02e6) return TRUE; /* Wireless XBox Controller Dongle */
|
||||
if (pid == 0x02ea) return TRUE; /* Xbox One S Controller */
|
||||
if (pid == 0x02fd) return TRUE; /* Xbox One S Controller (Firmware 2017) */
|
||||
if (pid == 0x0b00) return TRUE; /* Xbox Elite 2 */
|
||||
if (pid == 0x0b05) return TRUE; /* Xbox Elite 2 Wireless */
|
||||
if (pid == 0x0b12) return TRUE; /* Xbox Series */
|
||||
if (pid == 0x0b13) return TRUE; /* Xbox Series Wireless */
|
||||
if (pid == 0x0719) return TRUE; /* Xbox 360 Wireless Adapter */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static inline BOOL is_dualshock4_gamepad(WORD vid, WORD pid)
|
||||
{
|
||||
if (vid != 0x054c) return FALSE;
|
||||
if (pid == 0x05c4) return TRUE; /* DualShock 4 [CUH-ZCT1x] */
|
||||
if (pid == 0x09cc) return TRUE; /* DualShock 4 [CUH-ZCT2x] */
|
||||
if (pid == 0x0ba0) return TRUE; /* Dualshock 4 Wireless Adaptor */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static inline BOOL is_dualsense_gamepad(WORD vid, WORD pid)
|
||||
{
|
||||
if (vid != 0x054c) return FALSE;
|
||||
if (pid == 0x0ce6) return TRUE; /* DualSense */
|
||||
if (pid == 0x0df2) return TRUE; /* DualSense Edge */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif /* __WINEBUS_UNIXLIB_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue