On Thu Dec 18 09:50:30 2025 +0000, SeongChan Lee wrote:
I originally wrote the predicate as `(min >= -128 && max <= 127) || (min
= 0 && max <= 255)` . But I wasn't sure about how the signed and unsigned integer conversions would be handled between the C language, Wine, SDL, evdev, and games, so I've let the next biggest size cover them. It would use a smaller size if the range is -32768-32767, and it would behave the same as before if the range is 0-65535. It's not perfect, but it's better than before in some cases without potentially breaking something:stuck_out_tongue_winking_eye:. SDL always provides signed 16-bit range (-32768, 32767) axes, `struct input_value` in `evdev` has a `__s32 value` field, and the HID spec says, "Otherwise, all integer values are signed values represented in 2’s complement format," so I assumed they're normally signed values. But I'm not sure how to interpret "If Logical Minimum and Logical Maximum are both positive values then a sign bit is unnecessary in the report field and the contents of a field can be assumed to be an unsigned value." in the HID spec. Simple. As much as it doesn't make much difference, signed values should be used for axes that have a defined center (like steering wheel_ and unsigned values should be used for axes without a center (like pedals). God only knows why Moza for example has this flipped and steering range is 0-65535 but all other axes (including pedals) are defined as -32768:32767. This actually creates a a bit of a deadzone in the middle of the pedal stroke on linux if fuzz/flat values aren't corrected.
As much as it doesn't matter for the SDL bus since it always normalizes values, it would still matter with udev bus. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9789#note_125782