[PATCH v4 0/2] MR6043: winebus.sys: Fix angle conversions for FFB direction/phase
Fixed rotation of angles < 90deg in bus_sdl. Align logical max of angles to physical max defined in dinput (35900). Before, a polar angle of eg 90deg would end up in bus_sdl/bus_udev as 90.25deg. -- v4: winebus.sys: Align logical max of angles to physical max defined in dinput winebus.sys: Fix rotation for angles < 90deg https://gitlab.winehq.org/wine/wine/-/merge_requests/6043
From: Matthias Gorzellik <matthias.gorzellik(a)gmail.com> --- dlls/winebus.sys/bus_sdl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 2a60f112a83..71f91162fb1 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -661,7 +661,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT struct sdl_device *impl = impl_from_unix_device(iface); int id = impl->effect_ids[index]; SDL_HapticEffect effect = {0}; - UINT16 direction; + INT16 direction; NTSTATUS status; TRACE("iface %p, index %u, params %p.\n", iface, index, params); @@ -672,6 +672,7 @@ static NTSTATUS sdl_device_physical_effect_update(struct unix_device *iface, BYT /* The first direction we get from PID is in polar coordinate space, so we need to * remove 90° to make it match SDL spherical coordinates. */ direction = (params->direction[0] - 9000) % 36000; + if (direction < 0) direction += 36000; switch (params->effect_type) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6043
From: Matthias Gorzellik <matthias.gorzellik(a)gmail.com> --- dlls/winebus.sys/hid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c index d31718c6293..78efe6116ce 100644 --- a/dlls/winebus.sys/hid.c +++ b/dlls/winebus.sys/hid.c @@ -600,7 +600,7 @@ static BOOL hid_descriptor_add_set_periodic(struct unix_device *iface) UNIT(1, 0x14), /* Eng Rot:Angular Pos */ UNIT_EXPONENT(1, -2), LOGICAL_MINIMUM(1, 0), - LOGICAL_MAXIMUM(4, 36000), + LOGICAL_MAXIMUM(4, 35900), REPORT_SIZE(1, 16), REPORT_COUNT(1, 1), OUTPUT(1, Data|Var|Abs), @@ -960,7 +960,7 @@ BOOL hid_device_add_physical(struct unix_device *iface, USAGE *usages, USHORT co UNIT(1, 0x14), /* Eng Rot:Angular Pos */ UNIT_EXPONENT(1, -2), LOGICAL_MINIMUM(1, 0), - LOGICAL_MAXIMUM(4, 36000), + LOGICAL_MAXIMUM(4, 35900), REPORT_SIZE(1, 16), REPORT_COUNT(1, 2), OUTPUT(1, Data|Var|Abs), -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6043
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147051 Your paranoid android. === debian11 (build log) === error: patch failed: dlls/winebus.sys/bus_sdl.c:661 Task: Patch failed to apply === debian11b (build log) === error: patch failed: dlls/winebus.sys/bus_sdl.c:661 Task: Patch failed to apply
participants (3)
-
Marvin -
Matthias Gorzellik -
Matthias Gorzellik (@gotzl)