Open dark-swordsman opened 3 years ago
Yes, I found this bug too. I think the axix math calculation is wrong. I was able to fix it changing line #177 in dllmain.cpp:
from this: long v = long((value0.5f + 0.5f) 0x7999) + 1;
to this: long v = long((value0.5f + 0.5f) 0x8000);
Oops, not sure how I missed that one. Somehow I used 0x7999 instead of 0x7fff. :( (No, I really understand hex! I swear)
long v = long((value0.5f + 0.5f) 0x8000); is incorrect though (but closer to correct than my first version. This would convert a (-1.0, 1.0) range to (0, 32768). But the vJoy documentation states that axes must be 1 to 32768, not 0 to 32768.
So the final code should be: long v = long((value0.5f + 0.5f) 0x7fff) + 1;
Hello,
I used this mod to implement custom joysticks into Flight Simulator. Re-writing one of the scripts, I was able to effectively create a "slider" that goes from -1 to 1 to work as throttle.
However, I noticed that my throttle was only going to 95% (or 90% on the slider, since it's -100% to 100%).
Here's a screenshot showing the slider and its max state:
Even manually setting the vJoy to 1 or a value higher than 1 (
SetvJoyAxis(HID_USAGE_SL0, 1.1)
), it only goes to 90%.I noticed that it also does this for all the other axis. Basically any axis is limited to 90%. I believe this is an issue with the
vJoyInterface.dll
, but I am not sure. Is there something else I am missing or need to check?