About the speed issue: that would require a different structure. Best is, to make a function called for instance XUpdate, that reads all the data into the bank at once. Then, the other functions can use the same bank.
This bank can be declared global. The global command can be placed right before the 'Function', like this:
I mean, it doesn't need to be in a part of the code that will be executed, as long as it appears before the bank is used.
Maybe for creating/releasing the banks, you could make an 'initialize' and a 'release' function. Users can then call initialize at the start of the program, and finalize when ending it.
ZeroMemory would be called like this:
On msdn, Microsoft suggests to clear the bank every time before using it and I think that ZeroMemory is faster than a for..next loop.
The declaration for ZeroMemory can be placed in the same decls file as the other commands. Just place .lib "kernel.dll" before it. Sort of like this:
Then, the second problem is the random-like numbers, right ? Where are they returned ? From the ThumbX/Y parameters? Or was that solved by shifting everything up one byte ? Then the problem is 'only' the signed/non-signed/byteorder issue, with the strange order of numbers as you described above:
This bank can be declared global. The global command can be placed right before the 'Function', like this:
Global xinputbank Function XUpdate() End function
I mean, it doesn't need to be in a part of the code that will be executed, as long as it appears before the bank is used.
Maybe for creating/releasing the banks, you could make an 'initialize' and a 'release' function. Users can then call initialize at the start of the program, and finalize when ending it.
ZeroMemory would be called like this:
api_ZeroMemory bank, banksize
On msdn, Microsoft suggests to clear the bank every time before using it and I think that ZeroMemory is faster than a for..next loop.
The declaration for ZeroMemory can be placed in the same decls file as the other commands. Just place .lib "kernel.dll" before it. Sort of like this:
.lib "xinput.dll" getstatus(bank*, id) setstatus .. etc .lib "kernel32.dll" zeromemroy(bank*, size)
Then, the second problem is the random-like numbers, right ? Where are they returned ? From the ThumbX/Y parameters? Or was that solved by shifting everything up one byte ? Then the problem is 'only' the signed/non-signed/byteorder issue, with the strange order of numbers as you described above:
left-to-center range is 32768 to 65535, and from center-to-right is 0 to 32767
?