Commit Graph

259 Commits

Author SHA1 Message Date
Huw Davies 43cd5d8a2d winebus.sys: Convert the product strings to Unicode on the Unix-side.
This avoids keeping two copies of each string.

It also fixes a regression on macOS from commit 9d4b70473c
that incorrectly treated a CFStringRef as a char ptr.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:51:04 +02:00
Rémi Bernon 0fc31aaf21 winebus.sys: Add more Xbox controllers product ids.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:48:34 +02:00
Rémi Bernon 9132162266 winebus.sys: Implement PID effect update for UDEV lnxev devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:33:35 +02:00
Rémi Bernon 2dd369044d winebus.sys: Implement PID effect update for SDL devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:33:30 +02:00
Rémi Bernon 12d91995fd winebus.sys: Add a PID effect update output report.
Advertising support of the periodic effect types only for now.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:33:19 +02:00
Rémi Bernon 6bc71db09e winebus.sys: Use type and size of the current event, not the previous one.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51831
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 11:22:48 +02:00
Rémi Bernon a41c5e057c winebus.sys: Implement PID effect control for UDEV lnxev devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 11:02:02 +02:00
Rémi Bernon 8f0f2fab72 winebus.sys: Implement PID effect control for SDL devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 11:02:00 +02:00
Rémi Bernon 3b3228e9c7 winebus.sys: Add a PID effect control output report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 11:01:56 +02:00
Rémi Bernon 11fe73ed8f winebus.sys: Implement PID device control for UDEV lnxev devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:47 +02:00
Rémi Bernon eeb97fa605 winebus.sys: Implement PID device control for SDL devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:43 +02:00
Rémi Bernon 903c7ea75d winebus.sys: Add a PID device control output report.
And include it in the HID report descriptor when SDL device has support
for any haptic effect, or when UDEV lnxev device has any FF bit set.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 12:37:17 +02:00
Rémi Bernon 55e978168e winebus.sys: Move hidraw_device code around.
To keep lnxev_device functions and related helpers all together.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:40:14 +02:00
Gerald Pfeifer 0c81dc223d winebus.sys: Fix non-Linux builds.
commit 40a9f69a1d

   winebus.sys: Rename UDEV bus device variables to be consistent.

   Introducing a struct base_device, and hidraw_device / lnxev_device
   depending on the sub-type of the device.

moved an existing use of ABS_VOLUME that was guarded by

  #ifdef HAS_PROPER_INPUT_HEADER

outside that guard, breaking the build on non-Linux platforms.

Address this by putting appropriate guards in place.

Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 17:40:14 +02:00
Rémi Bernon a27708dc9b winebus.sys: Add haptics rumble support for UDEV lnxev devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon e42f11d7a2 winebus.sys: Remove old vendor rumble report.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon cb4d378fa9 winebus.sys: Add a new rumble report using HID haptics.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon ef36885b1e winebus.sys: Remove unused SDL_memset function pointer.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon c3ee32e846 winebus.sys: Check for SDL_JoystickRumble presence at runtime.
It's been introduced in SDL2 2.0.9, released on 2018/10/31.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:19 +02:00
Rémi Bernon 78f67d5c08 winebus.sys: Handle feature and output reports in hid_device.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:45 +02:00
Rémi Bernon 777a8fbda8 winebus.sys: Add support for joystick device rumble.
Some devices, such as the DualShock 4 only have support for haptics
through the SDL_JoystickRumble API. Let's use it as a fallback if none
of the more detailed API are supported.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:42 +02:00
Rémi Bernon 04b19a969b winebus.sys: Use report ids in crafted HID reports.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:39 +02:00
Rémi Bernon 9cf1e8353c winebus.sys: Factor out setting HID report values.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:33 +02:00
Rémi Bernon c6df23fed3 winebus.sys: Factor out HID report buffers allocation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 10:28:21 +02:00
Rémi Bernon 9d5e9b5f42 winebus.sys: Use the computed element offsets to create reports.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:10 +02:00
Rémi Bernon de050c974b winebus.sys: Compute offsets while building the report descriptor.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:07 +02:00
Rémi Bernon fa3905bafa winebus.sys: Introduce a new raw_device / hid_device abstraction.
For any device which requires building HID reports.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:48:02 +02:00
Rémi Bernon 0e18098bd5 winebus.sys: Rename IOHID bus device variables to be consistent.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:47:57 +02:00
Rémi Bernon 40a9f69a1d winebus.sys: Rename UDEV bus device variables to be consistent.
Introducing a struct base_device, and hidraw_device / lnxev_device
depending on the sub-type of the device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:47:53 +02:00
Rémi Bernon 12b5bc87db winebus.sys: Rename SDL bus device to struct sdl_device.
And use impl everywhere instead of inconsistent private / ext / device.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-22 21:47:48 +02:00
Alexandre Julliard ab5664a5e6 makefiles: Explicitly name the Unix library in the makefile instead of using --subsystem unixlib.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 17:49:48 +02:00
Rémi Bernon 8375753952 winebus.sys: Simplify SDL controller report descriptor creation.
Now that we have xinput.sys for translation there's no need to keep this
compatible.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:07 +02:00
Rémi Bernon 4a15cc9eb9 winebus.sys: Simplify SDL joystick report descriptor creation.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:41:02 +02:00
Rémi Bernon 8221229498 winebus.sys: Always add padding after button blocks.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:58 +02:00
Rémi Bernon 593c4d5149 winebus.sys: Move hats before buttons and use one byte each.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:54 +02:00
Rémi Bernon d7c4867257 winebus.sys: Enforce all axis values to be 32bit.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:43 +02:00
Rémi Bernon 059764e87e winebus.sys: Remove the bogus SDL "unknown" HID report constant.
It was used for XInput compatibility and is not needed anymore.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 11:40:40 +02:00
Rémi Bernon 65403bb067 winebus.sys: Move fastcall wrapper together with the functions.
The .text directive sometimes makes the global variables go in the
wrong section.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47751
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Rémi Bernon 7608538b40 winebus.sys: Remove unnecessary internal bus ids.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Rémi Bernon 9e3f9408b0 winebus.sys: Use WINEBUS\ as a common hardware ids prefix.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:49 +02:00
Rémi Bernon f37ae29b49 winebus.sys: Use WINEBUS\ as device id prefix for all buses.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Rémi Bernon 8fb10882c9 winebus.sys: Add a VID and PID to mouse and keyboard devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Alexandre Julliard 80a57c617b winebus.sys: Remove the no longer used CFStringToWSTR function.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 12:57:24 +02:00
Alexandre Julliard aff08c7e14 winebus.sys: Fix a typo in find_device_from_iohid().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 12:51:36 +02:00
Rémi Bernon 334d89a253 winebus.sys: Use wide character strings literals.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:48 +02:00
Rémi Bernon 5bbf1d1095 winebus.sys: Use new unixlib subsystem.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:46 +02:00
Rémi Bernon cc2f669390 winebus.sys: Use a pthread_mutex_t instead of CRITICAL_SECTION.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:43 +02:00
Rémi Bernon 8f6932fd35 winebus.sys: Avoid process heap allocations on the unix side.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:41 +02:00
Rémi Bernon e54ff70e5d winebus.sys: Build with msvcrt.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:45:38 +02:00