mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
Add an option to allow DirectInput to swap the right analog stick axes, in case the emulator detects them incorrectly.
This commit is contained in:
1 parent
a56e97d58c
commit
3560a489fb
3 files changed
+54
-16
No files matched your search
+52
-16
@@ -216,30 +216,66 @@ int DinputDevice::UpdateState(InputState &input_state)
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RIGHT;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LEFT;
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_UP;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_DOWN;
|
||||
if(!g_Config.iSwapRightAxes) {
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RIGHT;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LEFT;
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_UP;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_DOWN;
|
||||
}
|
||||
else {
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RIGHT;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LEFT;
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_UP;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_DOWN;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_B;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_X;
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_Y;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_A;
|
||||
if(!g_Config.iSwapRightAxes) {
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_B;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_X;
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_Y;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_A;
|
||||
}
|
||||
else {
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_B;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_X;
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_Y;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_A;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RBUMPER;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LBUMPER;
|
||||
if(!g_Config.iSwapRightAxes) {
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RBUMPER;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LBUMPER;
|
||||
}
|
||||
else {
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RBUMPER;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LBUMPER;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RBUMPER;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LBUMPER;
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_Y;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_A;
|
||||
if(!g_Config.iSwapRightAxes) {
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RBUMPER;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LBUMPER;
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_Y;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_A;
|
||||
}
|
||||
else {
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RBUMPER;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LBUMPER;
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_Y;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_A;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RIGHT;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LEFT;
|
||||
if(!g_Config.iSwapRightAxes) {
|
||||
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RIGHT;
|
||||
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LEFT;
|
||||
}
|
||||
else {
|
||||
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RIGHT;
|
||||
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LEFT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user