@Todd,
I'm testing that out now. I get these results, is this correct?
North = 1
East = 8
South = 2
West = 4
NE = 9
SE = 10
SW = 6
NW = 5
I assigned a dword var for the return and just used a text command to print to the screen. Also, this is interesting, seems that you can get info from the DBPro command AND your dll at the same time.
edit:
I wrote a little app to test Todd's .dll, but it appears I can't use rumble using the stock Microsoft driver. I haven't tried xbcd yet, I'll do that in a bit.
Unless I'm doing something wrong. Everything else works great.
//test Todd Riggins XB360 dll
autocam off
sync on
sync rate 0
set display mode desktop width(),desktop height(),32
type xbox_todds_dll
id as integer
ctype as integer
thdze as boolean
thdzp as integer
trdze as boolean
trdzp as integer
a_button as boolean
b_button as boolean
x_button as boolean
y_button as boolean
back_button as boolean
start_button as boolean
dpad as integer
l_shoulder as boolean
r_shoulder as boolean
l_thumb as boolean
r_thumb as boolean
l_trigger as float
r_trigger as float
l_thumbX as integer
l_thumbY as integer
r_thumbX as integer
r_thumbY as integer
l_rumble as integer
r_rumble as integer
endtype
global controller1 as xbox_Todds_dll
gamepad_init_xb360()
empty checklist
perform checklist for control devices
do
cls
gamepad_update_xb360()
gamepad_rumble()
stats_display()
sync
loop
function gamepad_init_xb360()
controller1.thdze = 1
controller1.thdzp = 20
controller1.trdze = 1
controller1.trdzp = 20
controller1.l_rumble = 65535
controller1.r_rumble = 65535
xb360 init
for i = 0 to 3
a = xb360 controller connected(i)
if a = 1
controller1.id = i
endif
next i
xb360 thumb dead zone enable controller1.id,controller1.thdze
xb360 thumb dead zone percent controller1.id,controller1.thdzp
xb360 trigger dead zone enable controller1.id,controller1.trdze
xb360 trigger dead zone percent controller1.id,controller1.trdzp
endfunction
function gamepad_update_xb360()
xb360 poll 0
controller1.x_button = xb360 x button(controller1.id)
controller1.y_button = xb360 y button(controller1.id)
controller1.a_button = xb360 a button(controller1.id)
controller1.b_button = xb360 b button(controller1.id)
controller1.back_button = xb360 back button(controller1.id)
controller1.start_button = xb360 start button(controller1.id)
controller1.dpad = xb360 dpad(controller1.id)
controller1.l_shoulder = xb360 left shoulder(controller1.id)
controller1.r_shoulder = xb360 right shoulder(controller1.id)
controller1.l_thumb = xb360 left thumb(controller1.id)
controller1.r_thumb = xb360 right thumb(controller1.id)
controller1.l_trigger = xb360 left trigger(controller1.id)
controller1.r_trigger = xb360 right trigger(controller1.id)
controller1.l_thumbX = xb360 thumb left x(controller1.id)
controller1.l_thumbY = xb360 thumb left y(controller1.id)
controller1.r_thumbX = xb360 thumb right x(controller1.id)
controller1.r_thumbY = xb360 thumb right y(controller1.id)
endfunction
function gamepad_rumble()
controller1.l_rumble = controller1.l_trigger * 257
controller1.r_rumble = controller1.r_trigger * 257
xb360 left motor speed controller1.id,controller1.l_rumble
xb360 right motor speed controller1.id,controller1.r_rumble
endfunction
function stats_display()
text 10,0,"FPS : " + str$(screen fps())
text 10,10,"Controller ID : " + str$(controller1.id)
//buttons
text 10,20,"A button : " + str$(controller1.a_button)
text 10,30,"B button : " + str$(controller1.b_button)
text 10,40,"X button : " + str$(controller1.x_button)
text 10,50,"Y button : " + str$(controller1.y_button)
text 10,60,"Dpad : " + str$(controller1.dpad)
text 10,70,"Back button : " + str$(controller1.back_button)
text 10,80,"Start button : " + str$(controller1.start_button)
text 10,90,"Left shoulder : " + str$(controller1.l_shoulder)
text 10,100,"Right shoulder : " + str$(controller1.r_shoulder)
text 10,110,"Left thumb button : " + str$(controller1.l_thumb)
text 10,120,"Right thumb button: " + str$(controller1.r_thumb)
//analog
text 10,140,"Left trigger : " + str$(controller1.l_trigger)
text 10,150,"Right trigger : " + str$(controller1.r_trigger)
text 10,160,"Left thumb X axis : " + str$(controller1.l_thumbX)
text 10,170,"Left thumb Y axis : " + str$(controller1.l_thumbY)
text 10,180,"Right thumb X axis: " + str$(controller1.r_thumbX)
text 10,190,"right thumb Y axis: " + str$(controller1.r_thumbY)
//rumble
text 10,210,"Left rumble speed : " + str$(controller1.l_rumble)
text 10,220,"Right rumble speed: " + str$(controller1.r_rumble)
text 10,240,"Controller name : " + checklist string$(1)
text 10,250,"ForceFeedback? : " + str$(checklist value a(1))
endfunction
edit:
ok, my mistake. I was confused about the values to input into the motor speed. I was thinking it was 0 to 100, but its 0 to 65535.
So, it works fine!
So, thanks Todd for all your hard work. It works great with the stock driver. I'll be using your .dll, if thats ok!