So in the interest of simplification I tried this and... now nothing is working.
I also wrote over the original program like a complete dumbass...
Here's the code for the joystick test thingy as it currently stands:
#include "fbgfx.bi"
#Include "SDL\SDL.bi"
Type ObjectType
x as Single
y as Single
speed as Single
End Type
Dim Shared Xmove as Short
Dim Shared Ymove as Short
Dim Shared jptr As SDL_Joystick ptr
Dim Shared CircleM As ObjectType
Dim Shared event as SDL_Event
Screen 13,8,2,0
CircleM.x = 150
CircleM.y = 90
CircleM.speed = 1
If (SDL_Init(SDL_INIT_JOYSTICK) <0) Then
print "Couldn't initialize SDL"
end
End If
For I = 0 To SDL_NumJoysticks()-1
jptr = SDL_JoystickOpen(I)
Next I
Do
Cls
Circle (CircleM.x, CircleM.y), 10, 15
Xmove = SDL_JoystickGetAxis(jptr,1)
Ymove = SDL_JoystickGetAxis(jptr,0)
if Xmove > 1 then CircleM.x = CircleM.x + CircleM.speed
if Xmove < -1 then CircleM.x = CircleM.x - CircleM.speed
if Ymove < 1 then CircleM.y = CircleM.y + CircleM.speed
if Ymove > -1 then CircleM.y = CircleM.y - CircleM.speed
Sleep 10, 1
Loop
For Y = 0 To SDL_NumJoysticks()-1
SDL_JoystickClose(jptr)
Next Y
I've isolated parts of the code and it opens the joystick just fine. It closes the joysticks just fine too. For some reason it doesn't read anything from the joysticks. This particular little program was running with just one controller hooked up. I tried it with both the 360 controller and the logitech dual pro.
BTW, I noticed earlier that while enumerating joysticks the for loop always opened a joystick labeled 0. hence the SDL_NumJoysticks()-1
I'm gonna dig through the rest of the work I've done on this and see if I can't piece together how I got this working in the first place.
Note: I've gotten rid of the event handler thing and called SDL_JoystickUpdate() at the top of the do loop now and that does have some effect, but the results are really funky. Gonna have to mess with it some more.