From aa2ad2360182f384a6cd09e2961125e9a3fa7a7b Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Wed, 22 Jan 2025 19:30:34 -0600 Subject: Replace old pause buffer input experience with a more accurate one (#4918) --- soh/src/code/game.c | 2 ++ soh/src/code/padmgr.c | 7 ------- soh/src/code/z_kaleido_setup.c | 14 +------------- soh/src/code/z_play.c | 5 ----- 4 files changed, 3 insertions(+), 25 deletions(-) (limited to 'soh/src/code') diff --git a/soh/src/code/game.c b/soh/src/code/game.c index a14266719..d7524009b 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -255,6 +255,8 @@ void GameState_Update(GameState* gameState) { GameState_SetFrameBuffer(gfxCtx); + GameInteractor_ExecuteOnGameStateMainStart(); + gameState->main(gameState); func_800C4344(gameState); diff --git a/soh/src/code/padmgr.c b/soh/src/code/padmgr.c index 8665fb448..a8bf778af 100644 --- a/soh/src/code/padmgr.c +++ b/soh/src/code/padmgr.c @@ -286,13 +286,6 @@ 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(CVAR_GENERAL("CheatEasyPauseBufferTimer"), 0) == 3) { - input->prev.button = CVarGetInteger(CVAR_GENERAL("CheatEasyPauseBufferLastInputs"), 0); - } - buttonDiff = input->prev.button ^ input->cur.button; input->press.button |= (u16)(buttonDiff & input->cur.button); input->rel.button |= (u16)(buttonDiff & input->prev.button); diff --git a/soh/src/code/z_kaleido_setup.c b/soh/src/code/z_kaleido_setup.c index 69ea3030f..45992279d 100644 --- a/soh/src/code/z_kaleido_setup.c +++ b/soh/src/code/z_kaleido_setup.c @@ -18,23 +18,11 @@ void KaleidoSetup_Update(PlayState* play) { play->shootingGalleryStatus <= 1 && gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY && gSaveContext.magicState != MAGIC_STATE_FILL && (play->sceneNum != SCENE_BOMBCHU_BOWLING_ALLEY || !Flags_GetSwitch(play, 0x38))) { - u8 easyPauseBufferEnabled = CVarGetInteger(CVAR_CHEAT("EasyPauseBuffer"), 0); - u8 easyPauseBufferTimer = CVarGetInteger(CVAR_GENERAL("CheatEasyPauseBufferTimer"), 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(CVAR_GENERAL("CheatEasyPauseBufferTimer"), 0); - } - if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) { if (BREG(0)) { pauseCtx->debugState = 3; } - } 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(CVAR_GENERAL("CheatEasyPauseBufferLastInputs"), input->cur.button & ~(BTN_START)); + } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { gSaveContext.unk_13EE = gSaveContext.unk_13EA; diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index cc7af190d..2b4743417 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -1668,11 +1668,6 @@ time_t Play_GetRealTime() { void Play_Main(GameState* thisx) { PlayState* play = (PlayState*)thisx; - // Decrease the easy pause buffer timer every frame - if (CVarGetInteger(CVAR_GENERAL("CheatEasyPauseBufferTimer"), 0) > 0) { - CVarSetInteger(CVAR_GENERAL("CheatEasyPauseBufferTimer"), CVarGetInteger(CVAR_GENERAL("CheatEasyPauseBufferTimer"), 0) - 1); - } - if (play->envCtx.unk_EE[2] == 0 && CVarGetInteger(CVAR_GENERAL("LetItSnow"), 0)) { play->envCtx.unk_EE[3] = 64; Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_OBJECT_KANKYO, 0, 0, 0, 0, 0, 0, 3, 0); -- cgit v1.2.3