Some drivers (such as hid-sony) configure analog triggers (L2/R2) as axes
with axis range -32768-32767, but the resting value starts at -32768,
causing an initial or light press to register erroneously as a minus
axis value.
Fix by shifting ABS_Z and ABS_RZ axes that are detected to rest at
-32768 so that they will range from 0-32767 instead.
Patch based on Jools Wills' earlier commit: https://github.com/RetroPie/EmulationStation/pull/58
Replace boost::filesystem::is_directory
with Utils::FileSystem::isDirectory
Replace boost::filesystem::is_regular_file
with Utils::FileSystem::isRegularFile
Replace boost::filesystem::is_symlink
with Utils::FileSystem::isSymlink
Replace boost::filesystem::exists
with Utils::FileSystem::exists
Replace boost::filesystem::create_directory
with Utils::FileSystem::createDirectory
Replace boost::filesystem::remove
with Utils::FileSystem::removeFile
Unlike other axis, they don't default to 0, but instead start at -32768 and go to +32767 when pressed. This confuses the
current ES code axis code. As a workaround, we get the initial value and if it is -32767, we add 32767 and divide by two. This gives it
a range that can be handled with the current code (from 0 to 32767). Note on my X11 machine, I had to plug the joystick in after ES
was loaded or it get 0 as the initial axis value for the triggers. This seems ok on the RPI though, so possible some SDL issue.
With this change on a 360 controller the triggers should be correctly detected as +2 and +5 without seeing two presses for each trigger press.