[PATCH 0/2] MR6831: winebus: Always return success from PID effect control.
Fixes some force feedback issues with Forza Horizon 5. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6831
From: Rémi Bernon <rbernon(a)codeweavers.com> Forza Horizon 5 doesn't like unsupported racing wheel force feedback effects. --- dlls/winebus.sys/bus_sdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 71f91162fb1..7384dce6509 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -595,7 +595,7 @@ static NTSTATUS sdl_device_physical_effect_control(struct unix_device *iface, BY TRACE("iface %p, index %u, control %04x, iterations %u.\n", iface, index, control, iterations); - if (impl->effect_ids[index] < 0) return STATUS_UNSUCCESSFUL; + if (id < 0) return STATUS_SUCCESS; switch (control) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6831
From: Rémi Bernon <rbernon(a)codeweavers.com> Forza Horizon 5 doesn't like unsupported racing wheel force feedback effects and gives up too soon. On Windows many wheel devices have custom drivers which report support for all types of force feedback effects. --- dlls/winebus.sys/bus_sdl.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 7384dce6509..ac9f5cfdbda 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -198,7 +198,7 @@ static void set_hat_value(struct unix_device *iface, int index, int value) hid_device_set_hatswitch_y(iface, index, y); } -static BOOL descriptor_add_haptic(struct sdl_device *impl) +static BOOL descriptor_add_haptic(struct sdl_device *impl, BOOL force) { USHORT i, count = 0; USAGE usages[16]; @@ -227,16 +227,16 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl) if ((impl->effect_support & EFFECT_SUPPORT_PHYSICAL)) { /* SDL_HAPTIC_SQUARE doesn't exist */ - if (impl->effect_support & SDL_HAPTIC_SINE) usages[count++] = PID_USAGE_ET_SINE; - if (impl->effect_support & SDL_HAPTIC_TRIANGLE) usages[count++] = PID_USAGE_ET_TRIANGLE; - if (impl->effect_support & SDL_HAPTIC_SAWTOOTHUP) usages[count++] = PID_USAGE_ET_SAWTOOTH_UP; - if (impl->effect_support & SDL_HAPTIC_SAWTOOTHDOWN) usages[count++] = PID_USAGE_ET_SAWTOOTH_DOWN; - if (impl->effect_support & SDL_HAPTIC_SPRING) usages[count++] = PID_USAGE_ET_SPRING; - if (impl->effect_support & SDL_HAPTIC_DAMPER) usages[count++] = PID_USAGE_ET_DAMPER; - if (impl->effect_support & SDL_HAPTIC_INERTIA) usages[count++] = PID_USAGE_ET_INERTIA; - if (impl->effect_support & SDL_HAPTIC_FRICTION) usages[count++] = PID_USAGE_ET_FRICTION; - if (impl->effect_support & SDL_HAPTIC_CONSTANT) usages[count++] = PID_USAGE_ET_CONSTANT_FORCE; - if (impl->effect_support & SDL_HAPTIC_RAMP) usages[count++] = PID_USAGE_ET_RAMP; + if (force || (impl->effect_support & SDL_HAPTIC_SINE)) usages[count++] = PID_USAGE_ET_SINE; + if (force || (impl->effect_support & SDL_HAPTIC_TRIANGLE)) usages[count++] = PID_USAGE_ET_TRIANGLE; + if (force || (impl->effect_support & SDL_HAPTIC_SAWTOOTHUP)) usages[count++] = PID_USAGE_ET_SAWTOOTH_UP; + if (force || (impl->effect_support & SDL_HAPTIC_SAWTOOTHDOWN)) usages[count++] = PID_USAGE_ET_SAWTOOTH_DOWN; + if (force || (impl->effect_support & SDL_HAPTIC_SPRING)) usages[count++] = PID_USAGE_ET_SPRING; + if (force || (impl->effect_support & SDL_HAPTIC_DAMPER)) usages[count++] = PID_USAGE_ET_DAMPER; + if (force || (impl->effect_support & SDL_HAPTIC_INERTIA)) usages[count++] = PID_USAGE_ET_INERTIA; + if (force || (impl->effect_support & SDL_HAPTIC_FRICTION)) usages[count++] = PID_USAGE_ET_FRICTION; + if (force || (impl->effect_support & SDL_HAPTIC_CONSTANT)) usages[count++] = PID_USAGE_ET_CONSTANT_FORCE; + if (force || (impl->effect_support & SDL_HAPTIC_RAMP)) usages[count++] = PID_USAGE_ET_RAMP; if (!hid_device_add_physical(&impl->unix_device, usages, count)) return FALSE; @@ -360,7 +360,7 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface) if (!hid_device_end_input_report(iface)) return STATUS_NO_MEMORY; - if (!descriptor_add_haptic(impl)) + if (!descriptor_add_haptic(impl, physical_usage.Usage == HID_USAGE_SIMULATION_AUTOMOBILE_SIMULATION_DEVICE)) return STATUS_NO_MEMORY; if (!hid_device_end_report_descriptor(iface)) @@ -414,7 +414,7 @@ static NTSTATUS build_controller_report_descriptor(struct unix_device *iface) if (!hid_device_end_input_report(iface)) return STATUS_NO_MEMORY; - if (!descriptor_add_haptic(impl)) + if (!descriptor_add_haptic(impl, FALSE)) return STATUS_NO_MEMORY; if (!hid_device_end_report_descriptor(iface)) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6831
participants (1)
-
Rémi Bernon