GP2X Usb Joystick Support In Sdl


paeryn

Reclusive maniac
Joined
Nov 28, 2005
Messages
432
Age
47
Location
Sheffield, England
Website
paeryn.myby.co.uk
Hiya, could anyone with a USB Host cable and a joystick test my latest version of SDL please?
The lib is here rename it libSDL.a when unpacked and copy it over to where it belongs (make a backup of your original first just incase!)
I've put up a simple test program that just tells you how many joysticks it sees and how many axes/buttons/etc they have, grab that here if you want.
Please let me know if it can see them. joystick(0) is the GP2X's internal and only has 19 buttons, no axes.
If you could (if you have time) test whether it registers movement that would be great also.

Cheers, Paeryn.
Edit: Oops, I forgot to upload the test code... It's there now :)
 

jokeman

Still Fresh
Joined
Feb 4, 2006
Messages
101
Location
Austria
Website
Visit site
hi!

i've tested it... but i had some problems compiling the test program
Code:
'BACK_LIGHT_OFF' undeclared';  'BACK_LIGHT_ON' undeclared'
i commented it out and compiled it

whem i started the program, i got:
Code:
SDL_SYS_JoystickInit
SDL_GP2X: SYS_JoystickNapme(0)
Nc umber of joystic:ks: 2
0 oystick [<0 is at 0xf60b8
   It ha0s 0 axes02, 0 hats, 0 trac9kballs abnd 19 bu5ttons
c>]	lr : [<00029b3c>]	Not tainted
sp : bffffb04  ip : 00000004  fp : bffffde0
r10: 0003964c  r9 : 000081dc  r8 : 00000000
r7 : 00000004  r6 : 000b2a4c  r5 : 000f60f0  r4 : 000f60b8
r3 : 000b2a64  r2 : 00000000  r1 : 00000000  r0 : 00000000
Flags: nzCv  IRQs on  FIQs on  Mode USER_32  Segment user
Control: C000317F  Table: 01F1C000  DAC: 00000015
with my Logitech Logitech Cordless RumblePad 2

looks a little bit stange to me, but i haven't time to test more at the moment

grz, Jokeman
 

paeryn

Reclusive maniac
Joined
Nov 28, 2005
Messages
432
Age
47
Location
Sheffield, England
Website
paeryn.myby.co.uk
jokeman posted on May 28 2006 at 07:07 PM said:
i've tested it... but i had some problems compiling the test program
Code:
'BACK_LIGHT_OFF' undeclared';  'BACK_LIGHT_ON' undeclared'
You need to download the updated SDL_joystick.h from here. From now on the absolute latest library is going to be http://paeryn.myby.co.uk/libSDL.tar.bz2 which comes with any modified header files.
when i started the program, i got:
Code:
SDL_SYS_JoystickInit
SDL_GP2X: SYS_JoystickNapme(0)
Nc umber of joystic:ks: 2
0 oystick [<0 is at 0xf60b8
   It ha0s 0 axes02, 0 hats, 0 trac9kballs abnd 19 bu5ttons
with my Logitech Logitech Cordless RumblePad 2
Cheers for testing.
It looks like it's seeing the joystick, but crashing when trying to access it. I'll look into it tomorrow.

The mess in the output is due to either stdout or stderr not getting flushed when it crashes, the two streams end up getting jumbled together. Best way to fix it is to redirect one of stdout or stderr to a file from the command line. I'm used to seperating the two in my head (15 years of programming under irix, unix and linux gets you used to these things :rolleyes: )
 
Last edited by a moderator:

GP2X_Coder

Member
Joined
May 17, 2006
Messages
220
Age
47
Location
USA
Website
mysite.verizon.net
paeryn this would be fantastic if you could get a second joystick working we could all play two player games with all of our emu's like gngeo two player support would be fantastic! Awesome job man keep up the work I am going to go get a usb joystick to test out and hopefully help you get it going.
 

joyrider

Member
Joined
Mar 29, 2006
Messages
590
Age
39
Website
www.willemssoft.Be
paeryn posted on May 28 2006 at 07:23 PM said:
From now on the absolute latest library is going to be http://paeryn.myby.co.uk/libSDL.tar.bz2 which comes with any modified header files.
Did something change with the compiled libaries ? cause i used to be able to just copy the lib over my existing one and it worked fine. However with the latest one on that adress i get the following error when trying to link against it :

c:\devkitgp2x\lib\libSDL.a: could not read symbols: File format not recognized

i'm using devkitgp2x from the archive.
 
Last edited by a moderator:

paeryn

Reclusive maniac
Joined
Nov 28, 2005
Messages
432
Age
47
Location
Sheffield, England
Website
paeryn.myby.co.uk
joyrider posted on May 29 2006 at 12:40 PM said:
Did something change with the compiled libaries ? cause i used to be able to just copy the lib over my existing one and it worked fine. However with the latest one on that adress i get the following error when trying to link against it :

c:\devkitgp2x\lib\libSDL.a: could not read symbols: File format not recognized

i'm using devkitgp2x from the archive.
Hmm, unless I managed to pack the version from a few weeks ago that was broken that way (although I thought I'd deleted it.) I'll check in a mo.
Very sorry, my mistake entirely. I had altered something and re-configured SDL - unfortunately I'd set the host to arm-gnu (which it used to be) instead of gp2x. This ended up with it compiling the library for x86_64 :(
I'm uploading the arm version now.
 
Last edited by a moderator:
Top