mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 10:52:19 -05:00
tweak: easy pause buffer to track inputs better (#3054)
This commit is contained in:
parent
78790fe8aa
commit
91c6eba0d0
@ -26,6 +26,8 @@ void BootCommands_Init()
|
|||||||
CVarClear("gOnFileSelectNameEntry"); // Clear when soh is killed on the file name entry page
|
CVarClear("gOnFileSelectNameEntry"); // Clear when soh is killed on the file name entry page
|
||||||
CVarClear("gBetterDebugWarpScreenMQMode");
|
CVarClear("gBetterDebugWarpScreenMQMode");
|
||||||
CVarClear("gBetterDebugWarpScreenMQModeScene");
|
CVarClear("gBetterDebugWarpScreenMQModeScene");
|
||||||
|
CVarClear("gCheatEasyPauseBufferLastInputs");
|
||||||
|
CVarClear("gCheatEasyPauseBufferTimer");
|
||||||
#if defined(__SWITCH__) || defined(__WIIU__)
|
#if defined(__SWITCH__) || defined(__WIIU__)
|
||||||
CVarRegisterInteger("gControlNav", 1); // always enable controller nav on switch/wii u
|
CVarRegisterInteger("gControlNav", 1); // always enable controller nav on switch/wii u
|
||||||
#endif
|
#endif
|
||||||
|
@ -287,6 +287,13 @@ void PadMgr_ProcessInputs(PadMgr* padMgr) {
|
|||||||
Fault_AddHungupAndCrash(__FILE__, __LINE__);
|
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;
|
buttonDiff = input->prev.button ^ input->cur.button;
|
||||||
input->press.button |= (u16)(buttonDiff & input->cur.button);
|
input->press.button |= (u16)(buttonDiff & input->cur.button);
|
||||||
input->rel.button |= (u16)(buttonDiff & input->prev.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);
|
uint8_t rumble = (padMgr->rumbleEnable[0] > 0);
|
||||||
OTRControllerCallback(rumble);
|
OTRControllerCallback(rumble);
|
||||||
|
|
||||||
if (CVarGetInteger("gPauseBufferBlockInputFrame", 0)) {
|
|
||||||
ControllerBlockGameInput(PAUSE_BUFFER_INPUT_BLOCK_ID);
|
|
||||||
} else {
|
|
||||||
ControllerUnblockGameInput(PAUSE_BUFFER_INPUT_BLOCK_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
PadMgr_UnlockPadData(padMgr);
|
PadMgr_UnlockPadData(padMgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,15 +18,24 @@ void KaleidoSetup_Update(PlayState* play) {
|
|||||||
play->shootingGalleryStatus <= 1 && gSaveContext.magicState != 8 && gSaveContext.magicState != 9 &&
|
play->shootingGalleryStatus <= 1 && gSaveContext.magicState != 8 && gSaveContext.magicState != 9 &&
|
||||||
(play->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) {
|
(play->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) {
|
||||||
|
|
||||||
if (CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0) == 2 && !CHECK_BTN_ALL(input->press.button, BTN_START)) {
|
u8 easyPauseBufferEnabled = CVarGetInteger("gCheatEasyPauseBufferEnabled", 0);
|
||||||
CVarSetInteger("gCheatEasyPauseBufferFrameAdvance", 0);
|
u8 easyPauseBufferTimer = CVarGetInteger("gCheatEasyPauseBufferTimer", 0);
|
||||||
|
|
||||||
|
// If start is not seen as pressed on the 2nd to last frame then we should end the easy frame advance flow
|
||||||
|
if (easyPauseBufferEnabled && easyPauseBufferTimer == 2 &&
|
||||||
|
!CHECK_BTN_ALL(input->press.button, BTN_START)) {
|
||||||
|
CVarSetInteger("gCheatEasyPauseBufferTimer", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
|
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
|
||||||
if (BREG(0)) {
|
if (BREG(0)) {
|
||||||
pauseCtx->debugState = 3;
|
pauseCtx->debugState = 3;
|
||||||
}
|
}
|
||||||
} else if ((CHECK_BTN_ALL(input->press.button, BTN_START) && !CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0)) || CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0) == 1) {
|
} else if ((CHECK_BTN_ALL(input->press.button, BTN_START) && (!easyPauseBufferEnabled || !easyPauseBufferTimer)) ||
|
||||||
|
(easyPauseBufferEnabled && easyPauseBufferTimer == 1)) { // Force Kaleido open when easy pause buffer reaches 0
|
||||||
|
// Remember last held buttons for pause buffer cheat (minus start so easy frame advance works)
|
||||||
|
CVarSetInteger("gCheatEasyPauseBufferLastInputs", input->cur.button & ~(BTN_START));
|
||||||
|
|
||||||
gSaveContext.unk_13EE = gSaveContext.unk_13EA;
|
gSaveContext.unk_13EE = gSaveContext.unk_13EA;
|
||||||
|
|
||||||
if (CHECK_BTN_ALL(input->cur.button, BTN_L))
|
if (CHECK_BTN_ALL(input->cur.button, BTN_L))
|
||||||
|
@ -1754,12 +1754,11 @@ time_t Play_GetRealTime() {
|
|||||||
void Play_Main(GameState* thisx) {
|
void Play_Main(GameState* thisx) {
|
||||||
PlayState* play = (PlayState*)thisx;
|
PlayState* play = (PlayState*)thisx;
|
||||||
|
|
||||||
if (CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0)) {
|
// Decrease the easy pause buffer timer every frame
|
||||||
CVarSetInteger("gCheatEasyPauseBufferFrameAdvance", CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0) - 1);
|
if (CVarGetInteger("gCheatEasyPauseBufferTimer", 0) > 0) {
|
||||||
}
|
CVarSetInteger("gCheatEasyPauseBufferTimer", CVarGetInteger("gCheatEasyPauseBufferTimer", 0) - 1);
|
||||||
if (CVarGetInteger("gPauseBufferBlockInputFrame", 0)) {
|
|
||||||
CVarSetInteger("gPauseBufferBlockInputFrame", CVarGetInteger("gPauseBufferBlockInputFrame", 0) - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (play->envCtx.unk_EE[2] == 0 && CVarGetInteger("gLetItSnow", 0)) {
|
if (play->envCtx.unk_EE[2] == 0 && CVarGetInteger("gLetItSnow", 0)) {
|
||||||
play->envCtx.unk_EE[3] = 64;
|
play->envCtx.unk_EE[3] = 64;
|
||||||
Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_OBJECT_KANKYO, 0, 0, 0, 0, 0, 0, 3, 0);
|
Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_OBJECT_KANKYO, 0, 0, 0, 0, 0, 0, 3, 0);
|
||||||
|
@ -3649,10 +3649,8 @@ void KaleidoScope_Update(PlayState* play)
|
|||||||
if (CHECK_BTN_ALL(input->press.button, BTN_START) ||
|
if (CHECK_BTN_ALL(input->press.button, BTN_START) ||
|
||||||
(CHECK_BTN_ALL(input->press.button, BTN_B) && gSaveContext.isBossRush)) {
|
(CHECK_BTN_ALL(input->press.button, BTN_B) && gSaveContext.isBossRush)) {
|
||||||
if (CVarGetInteger("gCheatEasyPauseBufferEnabled", 0) || CVarGetInteger("gCheatEasyInputBufferingEnabled", 0)) {
|
if (CVarGetInteger("gCheatEasyPauseBufferEnabled", 0) || CVarGetInteger("gCheatEasyInputBufferingEnabled", 0)) {
|
||||||
CVarSetInteger("gPauseBufferBlockInputFrame", 9);
|
// Easy pause buffer is 13 frames, 12 for kaledio to end, and one more to advance a single frame
|
||||||
}
|
CVarSetInteger("gCheatEasyPauseBufferTimer", 13);
|
||||||
if (CVarGetInteger("gCheatEasyPauseBufferEnabled", 0)) {
|
|
||||||
CVarSetInteger("gCheatEasyPauseBufferFrameAdvance", 13);
|
|
||||||
}
|
}
|
||||||
Interface_SetDoAction(play, DO_ACTION_NONE);
|
Interface_SetDoAction(play, DO_ACTION_NONE);
|
||||||
pauseCtx->state = 0x12;
|
pauseCtx->state = 0x12;
|
||||||
|
Loading…
Reference in New Issue
Block a user