Module: wine Branch: master Commit: 13d8571b082102e030783bb13d6391b312c74aab URL: https://gitlab.winehq.org/wine/wine/-/commit/13d8571b082102e030783bb13d6391b...
Author: Rémi Bernon rbernon@codeweavers.com Date: Sun Jan 14 12:04:58 2024 +0100
winebus: Move device identification helpers to unixlib.h.
---
dlls/winebus.sys/unix_private.h | 4 ---- dlls/winebus.sys/unixlib.c | 40 ---------------------------------------- dlls/winebus.sys/unixlib.h | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 44 deletions(-)
diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h index 1ec414cce73..f2f4e71f014 100644 --- a/dlls/winebus.sys/unix_private.h +++ b/dlls/winebus.sys/unix_private.h @@ -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 */ diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c index 82eab3717ca..2668468305c 100644 --- a/dlls/winebus.sys/unixlib.c +++ b/dlls/winebus.sys/unixlib.c @@ -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; diff --git a/dlls/winebus.sys/unixlib.h b/dlls/winebus.sys/unixlib.h index 2425484b33f..80852696dd1 100644 --- a/dlls/winebus.sys/unixlib.h +++ b/dlls/winebus.sys/unixlib.h @@ -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 */