Xinput joystick axis jumps from positive to negative

Hi,

I am using Motioninjoy (Dualshock 3 Sixaxxis controller on Windows 7)? together with a recent SDL2 (post rc1) and noticed with the testjoystick binary that the axis 3 (left analog up/down) jumps when going in down direction from 32257 to -32768. This seems obviously wrong and I have never seen this before. In my games the people are now going backwards before they start to sprint forward when the player actually wants to run as fast as possible backwards. This also happens on the axis 2 (right analog stick up/down)

This problem doesn’t happen in DX mode

Attached is my patch. It ensures that the values are correctly limitted between -32767 and 32767 (otherwise the negator - and the conversion to sint16 would corrupt the result)

----- Urspr?ngliche Message -----Von: Franz Schrober <@Franz_Schrober>
An: “sdl at lists.libsdl.org
CC:
Gesendet: 22:52 Mittwoch, 26.Juni 2013
Betreff: Xinput joystick axis jumps from positive to negative

Hi,

I am using Motioninjoy (Dualshock 3 Sixaxxis controller on Windows 7)? together with a recent SDL2 (post rc1) and noticed with the testjoystick binary that the axis 3 (left analog up/down) jumps when going in down direction from 32257 to -32768. This seems obviously wrong and I have never seen this before. In my games the people are now going backwards before they start to sprint forward when the player actually wants to run as fast as possible backwards. This also happens on the axis 2 (right analog stick up/down)

This problem doesn’t happen in DX mode
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl2-2-xinput_range.patch
Type: text/x-patch
Size: 1326 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130626/9a528037/attachment.bin

Patch is in, thanks!On Wed, Jun 26, 2013 at 2:19 PM, Franz Schrober wrote:

Attached is my patch. It ensures that the values are correctly limitted
between -32767 and 32767 (otherwise the negator - and the conversion to
sint16 would corrupt the result)

----- Urspr?ngliche Message -----
Von: Franz Schrober
An: “sdl at lists.libsdl.org
CC:
Gesendet: 22:52 Mittwoch, 26.Juni 2013
Betreff: Xinput joystick axis jumps from positive to negative

Hi,

I am using Motioninjoy (Dualshock 3 Sixaxxis controller on Windows 7)
together with a recent SDL2 (post rc1) and noticed with the testjoystick
binary that the axis 3 (left analog up/down) jumps when going in down
direction from 32257 to -32768. This seems obviously wrong and I have never
seen this before. In my games the people are now going backwards before
they start to sprint forward when the player actually wants to run as fast
as possible backwards. This also happens on the axis 2 (right analog stick
up/down)

This problem doesn’t happen in DX mode


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org