Getting B3D to work with XInput?

Blitz3D Forums/Blitz3D Beginners Area/Getting B3D to work with XInput?

If you put a command in a .decls, and restart Blitz, the F1 description is enabled automatically.
About the sign/unsigned conversion, I think it is:
value = value and $efff

To convert a value from (0..65535) to the range (-1.0..1.0), first substract 32767.5, then divide by 32767.5

The memory leak could be in the function xJoyZ, where the 'return' command is placed before FreeBank. Also in xJoyType and xGetJoy, no FreeBank is called.
In the msdn, 'ZeroMemory' is used to clear the bank.

That function is found in kernel32.dll.
http://www.blitzbasic.com/codearcs/codearcs.php?code=1751

Also, I made a bank with a size of 255 .. however, that is way too big. The bank should be smaller to fit the memory that is used.
For instance, if the 'rumble' structure holds 2 shorts, the bank needs to be only 4 bytes long. byte=1, short=2, integer/float=4 bytes