| 719 | } |
| 720 | |
| 721 | void Xbox360Peripheral::normalizeAxis(SInt16& axis, short deadzone) |
| 722 | { |
| 723 | static const UInt16 max16=32767; |
| 724 | const float current=getAbsolute(axis); |
| 725 | const float maxVal=max16-deadzone; |
| 726 | |
| 727 | if (current>deadzone) { |
| 728 | if (axis<0) { |
| 729 | axis=max16*(current-deadzone)/maxVal; |
| 730 | axis=~axis; |
| 731 | } else { |
| 732 | axis=max16*(current-deadzone)/maxVal; |
| 733 | } |
| 734 | } else { |
| 735 | axis=0; |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | void Xbox360Peripheral::fiddleReport(XBOX360_HAT& left, XBOX360_HAT& right) |
| 740 | { |
nothing calls this directly
no test coverage detected