tweak: easy pause buffer to track inputs better (#3054)

This commit is contained in:
Adam Bird
2023-08-13 11:41:19 -04:00
committed by GitHub
parent 78790fe8aa
commit 91c6eba0d0
5 changed files with 27 additions and 18 deletions

View File

@@ -287,6 +287,13 @@ void PadMgr_ProcessInputs(PadMgr* padMgr) {
Fault_AddHungupAndCrash(__FILE__, __LINE__);
}
// When 3 frames are left on easy pause buffer, re-apply the last held inputs to the prev inputs
// to compute the pressed difference. This makes it so previously held inputs are continued as "held",
// but new inputs when unpausing are "pressed" out of the pause menu.
if (CVarGetInteger("gCheatEasyPauseBufferTimer", 0) == 3) {
input->prev.button = CVarGetInteger("gCheatEasyPauseBufferLastInputs", 0);
}
buttonDiff = input->prev.button ^ input->cur.button;
input->press.button |= (u16)(buttonDiff & input->cur.button);
input->rel.button |= (u16)(buttonDiff & input->prev.button);
@@ -298,12 +305,6 @@ void PadMgr_ProcessInputs(PadMgr* padMgr) {
uint8_t rumble = (padMgr->rumbleEnable[0] > 0);
OTRControllerCallback(rumble);
if (CVarGetInteger("gPauseBufferBlockInputFrame", 0)) {
ControllerBlockGameInput(PAUSE_BUFFER_INPUT_BLOCK_ID);
} else {
ControllerUnblockGameInput(PAUSE_BUFFER_INPUT_BLOCK_ID);
}
PadMgr_UnlockPadData(padMgr);
}