Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions HAL/pico/src/comms/NintendoSwitchBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,16 @@ void NintendoSwitchBackend::SendReport() {
_report.r3 = _outputs.rightStickClick;
_report.home = _outputs.home;

// Analog outputs
_report.lx = (_outputs.leftStickX - 128) * 1.25 + 128;
_report.ly = 255 - ((_outputs.leftStickY - 128) * 1.25 + 128);
_report.rx = (_outputs.rightStickX - 128) * 1.25 + 128;
_report.ry = 255 - ((_outputs.rightStickY - 128) * 1.25 + 128);
// Left Stick outputs || Scaling || || Offset ||
_report.lx = ((_outputs.leftStickX - 128) * 1.266 + 128) + 0.49; // Rightwards
_report.ly = (255 - ((_outputs.leftStickY - 128) * 1.256 + 128)) + 1.49; // Downwards
// Right Stick outputs
_report.rx = ((_outputs.rightStickX - 128) * 1.266 + 128) + 0.49;
_report.ry = (255 - ((_outputs.rightStickY - 128) * 1.256 + 128)) + 1.49;

// Note: Despite the Y-Axis being scaled less than the X-Axis, the Y-Axis is still more sensivitive...
// It only affects game profiles by like 0.01, so whatever.


// D-pad Hat Switch
_report.hat =
Expand Down Expand Up @@ -164,4 +169,4 @@ switch_gamepad_hat_t NintendoSwitchBackend::GetHatPosition(
angle = SWITCH_HAT_UP;
}
return angle;
}
}
Loading