diff options
author | neonloop | 2021-04-03 23:13:51 +0000 |
---|---|---|
committer | neonloop | 2021-04-03 23:13:51 +0000 |
commit | 67c4ecd9a17491c102cdc8e5d08b22ab422826c8 (patch) | |
tree | cdf5b1f2f0554b2ec98b0d6444fbec841968ddaa /frontend/plugin_lib.c | |
parent | 076eba28b80edeb7566d8e12713b029bd324a67b (diff) | |
download | pcsx_rearmed-67c4ecd9a17491c102cdc8e5d08b22ab422826c8.tar.gz pcsx_rearmed-67c4ecd9a17491c102cdc8e5d08b22ab422826c8.tar.bz2 pcsx_rearmed-67c4ecd9a17491c102cdc8e5d08b22ab422826c8.zip |
Enables Menu+L1/R1 for L2/R2 and vice versa
The menu now appears when releasing the button as long as another
button hasn't been pressed. Menu+L will activate L2 if L1 is bound to
L, or L1 if L2 is bound to L. This allows rebinding for games that
prefer L2/R2, like Twisted Metal 2.
Diffstat (limited to 'frontend/plugin_lib.c')
-rw-r--r-- | frontend/plugin_lib.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index 6c5b296..ad877ed 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -601,6 +601,7 @@ static void update_input(void) { int actions[IN_BINDTYPE_COUNT] = { 0, }; unsigned int emu_act; + int keystate; in_update(actions); if (in_type[0] == PSE_PAD_TYPE_ANALOGJOY || in_type[0] == PSE_PAD_TYPE_ANALOGPAD) @@ -615,9 +616,31 @@ static void update_input(void) ; emu_act = which; } + + keystate = actions[IN_BINDTYPE_PLAYER12]; +#ifdef MENU_SHOULDER_COMBO + if (emu_act == SACTION_ENTER_MENU) { + if (keystate) + emu_menu_cancel = 1; + + if (keystate & (1 << DKEY_L1)) { + keystate ^= (1 << DKEY_L1); + keystate |= (1 << DKEY_L2); + } else if (keystate & (1 << DKEY_L2)) { + keystate ^= (1 << DKEY_L2); + keystate |= (1 << DKEY_L1); + } else if (keystate & (1 << DKEY_R1)) { + keystate ^= (1 << DKEY_R1); + keystate |= (1 << DKEY_R2); + } else if (keystate & (1 << DKEY_R2)) { + keystate ^= (1 << DKEY_R2); + keystate |= (1 << DKEY_R1); + } + } +#endif emu_set_action(emu_act); - in_keystate[0] = actions[IN_BINDTYPE_PLAYER12]; + in_keystate[0] = keystate; } #else /* MAEMO */ extern void update_input(void); |