[AMD64] Gamepad/joystick issue - 32-bit issues

32-bit app w/ 32-bit lib cannot properly detect name/axis/buttons -
64bit detects properly

On my Gentoo AMD64 system [compiled 64-bit] I am having difficulties
w/ Gamepad & Joystick inputs.
For games that are compiled 32-bit and use 32-bit libraries [of
course, 32 & 64-bit libraries don’t play nice together], I’m having
problems with my game-pads. They are only being detected with 2
buttons & 2 axis [and they’re actually loaded w/ em].
I wrote a test application to grab all the details about the joysticks
and compiled both 32-bit and 64-bit versions of it and ran it.
Different results for each.
Another issue that might be related is an SDL parachute is often
deployed at various times in the 32-bit games when the joypads are
connected.

Results from testapp:
– 64 bit version
gcc -I/usr/include/SDL -lSDL joystick.c
./a.out
Num joysticks: 1
Joystick 0 : Logitech Inc. WingMan RumblePad
Opened Joystick 0
Number of Axes: 14
Number of Buttons: 20
Number of Balls: 0

– 32 bit version
gcc -I/usr/include/SDL -lSDL joystick.c -m32
./a.out
Num joysticks: 1
Joystick 0 : /dev/input/js0
Opened Joystick 0
Number of Axes: 2
Number of Buttons: 2
Number of Balls: 0–
Thomas Harning Jr.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: joystick.c
Type: application/octet-stream
Size: 746 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20041231/8b1b344b/attachment.obj

Results from testapp:
– 64 bit version
gcc -I/usr/include/SDL -lSDL joystick.c
./a.out
Num joysticks: 1
Joystick 0 : Logitech Inc. WingMan RumblePad
Opened Joystick 0
Number of Axes: 14
Number of Buttons: 20
Number of Balls: 0

– 32 bit version
gcc -I/usr/include/SDL -lSDL joystick.c -m32
./a.out
Num joysticks: 1
Joystick 0 : /dev/input/js0
Opened Joystick 0
Number of Axes: 2
Number of Buttons: 2
Number of Balls: 0

Is this joystick USB? If it is, then I have the exact same one. I’m
not having any problems here, and I seriously doubt that the 32-bitness
of the app is causing the problem. Have you tried on a non-AMD (or a
32-bit only AMD) machine/kernel?–
Eric Vidal
Lecturer / Graduate Research Assistant, DISCS
Ateneo de Manila University
http://aegis.ateneo.net/evidal/

I believe I have located the issue.

/* from /usr/include/linux/joystick.h… */

struct JS_DATA_SAVE_TYPE {
int JS_TIMEOUT;
int BUSY;
long JS_EXPIRETIME;
long JS_TIMELIMIT;
struct JS_DATA_TYPE JS_SAVE;
struct JS_DATA_TYPE JS_CORR;
};

See those longs? They’re 64-bit under 64-bit and 32-bit under 32-bit. Ergo
the 32-bit and 64-bit versions aren’t using the same structure. Now, I don’t
know how to solve this, maybye those two do need to be long’s. Or maybye
they don’t.On Thursday 30 December 2004 21:20, Thomas Harning Jr. wrote:

32-bit app w/ 32-bit lib cannot properly detect name/axis/buttons -
64bit detects properly

On my Gentoo AMD64 system [compiled 64-bit] I am having difficulties
w/ Gamepad & Joystick inputs.
For games that are compiled 32-bit and use 32-bit libraries [of
course, 32 & 64-bit libraries don’t play nice together], I’m having
problems with my game-pads. They are only being detected with 2
buttons & 2 axis [and they’re actually loaded w/ em].
I wrote a test application to grab all the details about the joysticks
and compiled both 32-bit and 64-bit versions of it and ran it.
Different results for each.
Another issue that might be related is an SDL parachute is often
deployed at various times in the 32-bit games when the joypads are
connected.