Haven't used decls in a long time since I could never figure out how to properly work with DLLs (I'd kill for a tutorial), but basically, with a .decls, it doesn't matter what the label of the file is, and it has to be stored in the userlib folder right?
Keep getting userlib not found error here for some reason.
[EDIT] Nevermind, forgot to put the DLL in the folder with it, seems to work, off to have a play with it, thanks.
[EDIT2] Input test has a few probs with the numbers not being reset in some spots (such as the hat-switch), and right-trigger/analog are sharing the same numeric value on the display, off to see what's up. Btw, how do you figure this kind of stuff out, figuring out how to operate the DLL and interpret it and what not?
(basically, I can't for the life of me figure out which values you're supposed to peek and poke to get desired results, as all I see on the MSDN sites are pointers, which I can't make sense of)
[EDIT3] Ok, after more playing, it appears to me that the values for the thumbsticks and triggers are really off, what I was expecting to see was a transition from 0'ish to 65535 moving my thumbstick from the bottom to the top, I get the 0, and the 65535, but all the numbers in between are completely random.
Yep, I know, got a standard dual-analogue controller here as well, and my god it ticks me off just how many games don't properly support gamepads, with crap like not being able to set the dead-zone, or invert the axis, and other sorts of things.
(although, it would just be a lot more conveniant if all that could just be setup in the control panel, rather than per each individual title)
[EDIT4] Ok, got a tiny bit of work done, basically building off from what b32 supplied...., still having the weird-number issue with the joysticks, I doubt it has anything to do with the fact Blitz works with unsigned variables? Anyways, triggers working, brought the rumble into a function, I plan to try and emulate all the existing Joystick commands with xinput, once I figure out how to read that MSDN site better....
A couple questions anyhow -
1) Is it safe to create and free banks on the fly, or should I just use the one globally and just clear it's contents with a for loop whenever I need to use?
2) It appears all the buttons on the 360 controller return bit values in numeric form (1,2,4,8,16,32, etc), I'm not exactly quite sure how to take a given value of a combination of button presses (say 4097 for example, which is Dpad being pressed up{1} along with A button {4096} being pressed) without making a stupidly long list of Case/Select statements.
Haven't really coded in awhile so I'm forgetting some things, and a bit rusty on the overall code structure, but here's what I added onto from b32's code :
Hopefully I'll figure this whole DLL thing out with your guys help, so I can make this a library of functions so it'd be painless for anyone to easily integrate a native 360-controller interface in their titles.
(as I just love this freaking controller)
Keep getting userlib not found error here for some reason.
[EDIT] Nevermind, forgot to put the DLL in the folder with it, seems to work, off to have a play with it, thanks.
[EDIT2] Input test has a few probs with the numbers not being reset in some spots (such as the hat-switch), and right-trigger/analog are sharing the same numeric value on the display, off to see what's up. Btw, how do you figure this kind of stuff out, figuring out how to operate the DLL and interpret it and what not?
(basically, I can't for the life of me figure out which values you're supposed to peek and poke to get desired results, as all I see on the MSDN sites are pointers, which I can't make sense of)
[EDIT3] Ok, after more playing, it appears to me that the values for the thumbsticks and triggers are really off, what I was expecting to see was a transition from 0'ish to 65535 moving my thumbstick from the bottom to the top, I get the 0, and the 65535, but all the numbers in between are completely random.
Just make sure you don't forget to include true, WinXP DX9 conform, controller support as well.
Yep, I know, got a standard dual-analogue controller here as well, and my god it ticks me off just how many games don't properly support gamepads, with crap like not being able to set the dead-zone, or invert the axis, and other sorts of things.
(although, it would just be a lot more conveniant if all that could just be setup in the control panel, rather than per each individual title)
[EDIT4] Ok, got a tiny bit of work done, basically building off from what b32 supplied...., still having the weird-number issue with the joysticks, I doubt it has anything to do with the fact Blitz works with unsigned variables? Anyways, triggers working, brought the rumble into a function, I plan to try and emulate all the existing Joystick commands with xinput, once I figure out how to read that MSDN site better....
A couple questions anyhow -
1) Is it safe to create and free banks on the fly, or should I just use the one globally and just clear it's contents with a for loop whenever I need to use?
2) It appears all the buttons on the 360 controller return bit values in numeric form (1,2,4,8,16,32, etc), I'm not exactly quite sure how to take a given value of a combination of button presses (say 4097 for example, which is Dpad being pressed up{1} along with A button {4096} being pressed) without making a stupidly long list of Case/Select statements.
Haven't really coded in awhile so I'm forgetting some things, and a bit rusty on the overall code structure, but here's what I added onto from b32's code :
Most recent progress posted below.
Hopefully I'll figure this whole DLL thing out with your guys help, so I can make this a library of functions so it'd be painless for anyone to easily integrate a native 360-controller interface in their titles.
(as I just love this freaking controller)