winebus.sys: Fix ball value reporting.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrew Eikum 2019-05-06 08:46:12 -05:00 committed by Alexandre Julliard
parent e529387f67
commit ec7bdf6154
1 changed files with 3 additions and 3 deletions

View File

@ -275,8 +275,8 @@ static void set_ball_value(struct platform_private *ext, int index, int value1,
if (value1 < -127) value1 = -127; if (value1 < -127) value1 = -127;
if (value2 > 127) value2 = 127; if (value2 > 127) value2 = 127;
if (value2 < -127) value2 = -127; if (value2 < -127) value2 = -127;
ext->report_buffer[offset] = value1; *((WORD*)&ext->report_buffer[offset]) = LE_WORD(value1);
ext->report_buffer[offset + 1] = value2; *((WORD*)&ext->report_buffer[offset + sizeof(WORD)]) = LE_WORD(value2);
} }
static void set_hat_value(struct platform_private *ext, int index, int value) static void set_hat_value(struct platform_private *ext, int index, int value)
@ -400,7 +400,7 @@ static BOOL build_report_descriptor(struct platform_private *ext)
descript_size += sizeof(REPORT_AXIS_HEADER); descript_size += sizeof(REPORT_AXIS_HEADER);
descript_size += (sizeof(REPORT_AXIS_USAGE) * ball_count * 2); descript_size += (sizeof(REPORT_AXIS_USAGE) * ball_count * 2);
descript_size += sizeof(REPORT_REL_AXIS_TAIL); descript_size += sizeof(REPORT_REL_AXIS_TAIL);
report_size += (sizeof(WORD) * ball_count); report_size += (sizeof(WORD) * 2 * ball_count);
} }
hat_count = pSDL_JoystickNumHats(ext->sdl_joystick); hat_count = pSDL_JoystickNumHats(ext->sdl_joystick);