Skip to content

Commit

Permalink
Scaling XInputBackend to match NintendoSwitchBackend.
Browse files Browse the repository at this point in the history
- TODO: Check if the "255 - ..." section is needed
  It seems to be working fine, needs more testing
  • Loading branch information
avahe-kellenberger committed Dec 29, 2023
1 parent c41d24d commit 1972e28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions HAL/pico/src/comms/XInputBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ void XInputBackend::SendReport() {
_report.ls = _outputs.leftStickClick;
_report.rs = _outputs.rightStickClick;

_report.lx = (_outputs.leftStickX - 128) * 65535 / 255 + 128;
_report.ly = (_outputs.leftStickY - 128) * 65535 / 255 + 128;
_report.lx = ((_outputs.leftStickX - 128) * 65535 / 255) * 1.266 + 128 + 0.49;
_report.ly = ((_outputs.leftStickY - 128) * 65535 / 255) * 1.256 + 128 + 1.48;

_report.rx = (_outputs.rightStickX - 128) * 65535 / 255 + 128;
_report.ry = (_outputs.rightStickY - 128) * 65535 / 255 + 128;
_report.rx = ((_outputs.rightStickX - 128) * 65535 / 255) * 1.266 + 128 + 0.49;
_report.ry = ((_outputs.rightStickY - 128) * 65535 / 255) * 1.256 + 128 + 1.48;

_xinput->sendReport(&_report);
}
Expand Down

0 comments on commit 1972e28

Please sign in to comment.