From af8052189ffa031dbf43d0d41db3edc5aff2cb4d Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 12 Jun 2017 20:10:02 +0200 Subject: [PATCH] Added revert of patch which assumes a 1-to-1 axes mapping when no axes match. --- ...sume-a-1-to-1-axes-map-when-no-axes-.patch | 55 +++++++++++++++++++ .../dinput-Revert_Joystick_Hack/definition | 1 + patches/patchinstall.sh | 19 +++++++ 3 files changed, 75 insertions(+) create mode 100644 patches/dinput-Revert_Joystick_Hack/0001-Revert-dinput-Assume-a-1-to-1-axes-map-when-no-axes-.patch create mode 100644 patches/dinput-Revert_Joystick_Hack/definition diff --git a/patches/dinput-Revert_Joystick_Hack/0001-Revert-dinput-Assume-a-1-to-1-axes-map-when-no-axes-.patch b/patches/dinput-Revert_Joystick_Hack/0001-Revert-dinput-Assume-a-1-to-1-axes-map-when-no-axes-.patch new file mode 100644 index 00000000..b962582f --- /dev/null +++ b/patches/dinput-Revert_Joystick_Hack/0001-Revert-dinput-Assume-a-1-to-1-axes-map-when-no-axes-.patch @@ -0,0 +1,55 @@ +From 0eb3047ec54504764bc6c860fecb465815bb8597 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Mon, 12 Jun 2017 20:07:24 +0200 +Subject: Revert "dinput: Assume a 1-to-1 axes map when no axes match." + +This reverts commit e87ccb8b055dc846211967e46ee2f17fbabef7a1. +--- + dlls/dinput/joystick_linux.c | 19 +------------------ + 1 file changed, 1 insertion(+), 18 deletions(-) + +diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c +index 1032659621e..1f8f94d7382 100644 +--- a/dlls/dinput/joystick_linux.c ++++ b/dlls/dinput/joystick_linux.c +@@ -228,36 +228,19 @@ static INT find_joystick_devices(void) + else + if ((joydev.dev_axes_map = HeapAlloc(GetProcessHeap(), 0, joydev.axis_count * sizeof(int)))) + { +- INT j, found_axes = 0; ++ INT j; + + /* Remap to DI numbers */ + for (j = 0; j < joydev.axis_count; j++) +- { + if (axes_map[j] < 8) +- { + /* Axis match 1-to-1 */ + joydev.dev_axes_map[j] = j; +- found_axes++; +- } + else if (axes_map[j] == 16 || + axes_map[j] == 17) +- { + /* POV axis */ + joydev.dev_axes_map[j] = 8; +- found_axes++; +- } + else + joydev.dev_axes_map[j] = -1; +- } +- +- /* If no axes were configured but there are axes assume a 1-to-1 (wii controller) */ +- if (joydev.axis_count && !found_axes) +- { +- ERR("Incoherent joystick data, advertised %d axes, detected 0. Assuming 1-to-1.\n", +- joydev.axis_count); +- for (j = 0; j < joydev.axis_count; j++) +- joydev.dev_axes_map[j] = j; +- } + } + + /* Find vendor_id and product_id in sysfs */ +-- +2.13.1 + diff --git a/patches/dinput-Revert_Joystick_Hack/definition b/patches/dinput-Revert_Joystick_Hack/definition new file mode 100644 index 00000000..46f23160 --- /dev/null +++ b/patches/dinput-Revert_Joystick_Hack/definition @@ -0,0 +1 @@ +Fixes: [!43120] Revert patch to assume a 1-to-1 axes mapping when no axes match diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 24534d81..bd668f03 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -147,6 +147,7 @@ patch_enable_all () enable_ddraw_Write_Vtable="$1" enable_devenum_AudioCompressorCategory="$1" enable_dinput_Initialize="$1" + enable_dinput_Revert_Joystick_Hack="$1" enable_dmloader_Tests="$1" enable_dsound_EAX="$1" enable_dsound_Fast_Mixer="$1" @@ -684,6 +685,9 @@ patch_enable () dinput-Initialize) enable_dinput_Initialize="$2" ;; + dinput-Revert_Joystick_Hack) + enable_dinput_Revert_Joystick_Hack="$2" + ;; dmloader-Tests) enable_dmloader_Tests="$2" ;; @@ -4181,6 +4185,21 @@ if test "$enable_dinput_Initialize" -eq 1; then ) >> "$patchlist" fi +# Patchset dinput-Revert_Joystick_Hack +# | +# | This patchset fixes the following Wine bugs: +# | * [#43120] Revert patch to assume a 1-to-1 axes mapping when no axes match +# | +# | Modified files: +# | * dlls/dinput/joystick_linux.c +# | +if test "$enable_dinput_Revert_Joystick_Hack" -eq 1; then + patch_apply dinput-Revert_Joystick_Hack/0001-Revert-dinput-Assume-a-1-to-1-axes-map-when-no-axes-.patch + ( + printf '%s\n' '+ { "Sebastian Lackner", "Revert \"dinput: Assume a 1-to-1 axes map when no axes match.\".", 1 },'; + ) >> "$patchlist" +fi + # Patchset dmloader-Tests # | # | Modified files: