Currently Wine does not create device with no axis. They are detected by SDL. Such devices do exist, for example, shifters, button-boxes for various simulation games.
Bug was introduced in https://gitlab.winehq.org/wine/wine/-/merge_requests/181, it doesn't enter in cycle if `axis_count` is 0. Changed cycle from `for` to `do while`, allowing device creation run at least once.
From: Makarenko Oleg oleg@makarenk.ooo
--- dlls/winebus.sys/bus_sdl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index eee95e213c0..5cec049a845 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -999,7 +999,8 @@ static void sdl_add_device(unsigned int index) desc.is_gamepad = (axis_count == 6 && button_count >= 14); }
- for (axis_offset = 0; axis_offset < axis_count; axis_offset += (options.split_controllers ? 6 : axis_count)) + axis_offset = 0; + do { NTSTATUS status;
@@ -1026,7 +1027,9 @@ static void sdl_add_device(unsigned int index) }
bus_event_queue_device_created(&event_queue, &impl->unix_device, &desc); + axis_offset += (options.split_controllers ? 6 : axis_count); } + while (axis_offset < axis_count); }
static void process_device_event(SDL_Event *event)