diff --git a/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp b/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp index 4604c00ca11..373d481ef90 100644 --- a/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp +++ b/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp @@ -25,20 +25,22 @@ static u16 pauseInputs = 0; #define PAUSE_STATE_OFF 0 #define PAUSE_STATE_OPENING_1 2 #define PAUSE_STATE_UNPAUSE_SETUP 18 +#define PAUSE_STATE_SAVEPROMPT 7 void RegisterPauseBufferInputs() { COND_VB_SHOULD(VB_KALEIDO_UNPAUSE_CLOSE, CVAR_BUFFER_VALUE || CVAR_INCLUDE_VALUE, { Input* input = &gPlayState->state.input[0]; - // Store all inputs that were pressed during the buffer window - pauseInputs |= input->press.button; - - // If the user opts to include held inputs in the buffer window, store the held inputs, minus the held inputs when the pause menu was opened + // STEP #3: If the user opts to include held inputs in the buffer window, store the currnently held inputs, minus + // the held inputs when the pause menu was opened. This only applies to the first frame of the buffer window if (CVAR_INCLUDE_VALUE && inputBufferTimer == 0) { pauseInputs |= input->cur.button & ~prePauseInputs; prePauseInputs = 0; } + // STEP #4: Store all inputs that were pressed during the buffer window + pauseInputs |= input->press.button; + // Wait a specified number of frames before continuing the unpause inputBufferTimer++; if (inputBufferTimer < CVAR_BUFFER_VALUE) { @@ -54,10 +56,21 @@ void RegisterPauseBufferInputs() { Input* input = &gPlayState->state.input[0]; PauseContext* pauseCtx = &gPlayState->pauseCtx; - // if the input buffer timer is not 0 and the pause state is off, then the player just unpaused - if (inputBufferTimer != 0 && pauseCtx->state == PAUSE_STATE_OFF) { + // STEP #1: If the user opts to include held inputs in the buffer window, store the held inputs at the beginning + // of the pause process, minus the START input + if (pauseCtx->state == PAUSE_STATE_OPENING_1 && CVAR_INCLUDE_VALUE) { + prePauseInputs = input->cur.button & ~BTN_START; + } + + // STEP #2: The unpause process has begun, so let's reset the input buffer timer + if (pauseCtx->state == PAUSE_STATE_UNPAUSE_SETUP || ( + pauseCtx->state == PAUSE_STATE_SAVEPROMPT && (pauseCtx->unk_1EC == 2 || pauseCtx->unk_1EC == 5) + )) { inputBufferTimer = 0; + } + // STEP #5: If the input buffer timer is not 0 and the pause state is off, then the player just unpaused + if (inputBufferTimer != 0 && pauseCtx->state == PAUSE_STATE_OFF) { // If the user opts into easy frame advance, remove START input if (CVAR_FRAME_ADVANCE_VALUE) { pauseInputs &= ~BTN_START; @@ -65,17 +78,10 @@ void RegisterPauseBufferInputs() { // So we need to re-apply the inputs that were pressed during the buffer window input->press.button |= pauseInputs; - } - // Reset the timer and stored inputs at the beginning of the unpause process - if (pauseCtx->state == PAUSE_STATE_UNPAUSE_SETUP && pauseCtx->unk_1F4 != 160.0f) { - inputBufferTimer = 0; + // Reset the used variables pauseInputs = 0; - } - - // If the user opts to include held inputs in the buffer window, store the held inputs at the beginning of the pause process, minus the START input - if (pauseCtx->state == PAUSE_STATE_OPENING_1 && CVAR_INCLUDE_VALUE) { - prePauseInputs = input->cur.button & ~BTN_START; + inputBufferTimer = 0; } }); } diff --git a/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp b/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp index fd1f5ae4d84..3081d48630e 100644 --- a/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp @@ -2393,7 +2393,7 @@ void StaticData::HintTable_Init() { /*french*/ "J'admire ce que tu as fait à l'Île Koholint... Toi et moi, nous devrions faire équipe!")); // /*spanish*/Después de lo que le hiciste a la Isla Koholint, ¿cómo te atreves a llamarme malvado? - hintTextTable[RHT_GANON_JOKE10] = HintText(CustomMessage("Today, let's begin down&'The Hero is Defeated' timeline.", + hintTextTable[RHT_GANON_JOKE11] = HintText(CustomMessage("Today, let's begin down&'The Hero is Defeated' timeline.", /*german*/ "", /*french*/ "Si tu me vaincs, Hyrule sera englouti... mais si tu meurs, on aura A Link to the Past, le meilleur opus " "de la série!")); diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index af6062723a7..dd15a49328a 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -2141,12 +2141,11 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, // Note: the viewport x and y values are overwritten below, before usage static Vp viewport = { (PAUSE_EQUIP_PLAYER_WIDTH / 2) << 2, (PAUSE_EQUIP_PLAYER_HEIGHT / 2) << 2, G_MAXZ / 2, 0, (PAUSE_EQUIP_PLAYER_WIDTH / 2) << 2, (PAUSE_EQUIP_PLAYER_HEIGHT / 2) << 2, G_MAXZ / 2, 0 }; - static Lights1 lights1 = gdSPDefLights1(80, 80, 80, 255, 255, 255, 84, 84, 172); + static Lights1 lights1 = gdSPDefLights1(80, 80, 80, 255, 255, 255, 84, 84, -84); static Vec3f lightDir = { 89.8f, 0.0f, 89.8f }; u8 playerSwordAndShield[2]; Gfx* opaRef; Gfx* xluRef; - Gfx* kalRef; u16 perspNorm; Mtx* perspMtx = Graph_Alloc(play->state.gfxCtx, sizeof(Mtx)); Mtx* lookAtMtx = Graph_Alloc(play->state.gfxCtx, sizeof(Mtx)); @@ -2155,8 +2154,18 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, OPEN_DISPS(play->state.gfxCtx); + opaRef = POLY_OPA_DISP; + POLY_OPA_DISP++; + + xluRef = POLY_XLU_DISP; + POLY_XLU_DISP++; + + gSPDisplayList(WORK_DISP++, POLY_OPA_DISP); + gSPDisplayList(WORK_DISP++, POLY_XLU_DISP); + if (mirrorWorldActive) { gSPSetExtraGeometryMode(POLY_OPA_DISP++, G_EX_INVERT_CULLING); + gSPSetExtraGeometryMode(POLY_XLU_DISP++, G_EX_INVERT_CULLING); } gSPSegment(POLY_OPA_DISP++, 0x00, NULL); @@ -2170,7 +2179,14 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2); - gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); + + // Also matches if some of the previous graphics commands are moved inside this block too. Possible macro? + if (1) { + s32 pad[2]; + + gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); + } + gDPSetScissor(POLY_OPA_DISP++, G_SC_NON_INTERLACE, 0, 0, width, height); gSPClipRatio(POLY_OPA_DISP++, FRUSTRATIO_1); @@ -2192,8 +2208,8 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, gDPSetDepthImage(POLY_OPA_DISP++, depthFrameBuffer); - viewport.vp.vscale[0] = viewport.vp.vtrans[0] = width * 2; - viewport.vp.vscale[1] = viewport.vp.vtrans[1] = height * 2; + viewport.vp.vscale[0] = viewport.vp.vtrans[0] = width * ((1 << 2) / 2); + viewport.vp.vscale[1] = viewport.vp.vtrans[1] = height * ((1 << 2) / 2); gSPViewport(POLY_OPA_DISP++, &viewport); guPerspective(perspMtx, &perspNorm, fovy, (f32)width / (f32)height, 10.0f, 4000.0f, 1.0f); @@ -2226,28 +2242,26 @@ void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList); Player_DrawImpl(play, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, 0, tunic, boots, 0, - Player_OverrideLimbDrawPause, NULL, &playerSwordAndShield); - - if (CVarGetInteger(CVAR_GENERAL("PauseMenuAnimatedLinkTriforce"), 0)) { + Player_OverrideLimbDrawPause, NULL, &playerSwordAndShield); + if (CVarGetInteger(CVAR_GENERAL("PauseMenuAnimatedLinkTriforce"), 0)) { Matrix_SetTranslateRotateYXZ(pos->x - (LINK_AGE_IN_YEARS == YEARS_ADULT ? 25 : 0), pos->y + 280 + (LINK_AGE_IN_YEARS == YEARS_ADULT ? 48 : 0), pos->z, rot); Matrix_Scale(scale * (mirrorWorldActive ? -1 : 1), scale * 1, scale * 1, MTXMODE_APPLY); - Gfx* ohNo = POLY_XLU_DISP; - POLY_XLU_DISP = POLY_OPA_DISP; - Pause_DrawTriforceSpot(play, 1); - - POLY_OPA_DISP = POLY_XLU_DISP; - POLY_XLU_DISP = ohNo; } if (mirrorWorldActive) { gSPClearExtraGeometryMode(POLY_OPA_DISP++, G_EX_INVERT_CULLING); + gSPClearExtraGeometryMode(POLY_XLU_DISP++, G_EX_INVERT_CULLING); } - POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP++); + gSPEndDisplayList(POLY_OPA_DISP++); + gSPEndDisplayList(POLY_XLU_DISP++); + + gSPBranchList(opaRef, POLY_OPA_DISP); + gSPBranchList(xluRef, POLY_XLU_DISP); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 5fd8aa2b513..5ed5bdbaa9a 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -148,7 +148,10 @@ void KaleidoScope_DrawPlayerWork(PlayState* play) { scale = 0.047f; } - gsSPSetFB(play->state.gfxCtx->polyOpa.p++, gPauseLinkFrameBuffer); + // SOH [Port] Draw the pause Link on a separate framebuffer starting in the work buffer + OPEN_DISPS(play->state.gfxCtx); + gsSPSetFB(WORK_DISP++, gPauseLinkFrameBuffer); + rot.y = 32300; rot.x = rot.z = 0; Player_DrawPause(play, pauseCtx->playerSegment, &pauseCtx->playerSkelAnime, &pos, &rot, scale, @@ -156,7 +159,9 @@ void KaleidoScope_DrawPlayerWork(PlayState* play) { TUNIC_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC)), SHIELD_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD)), BOOTS_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_BOOTS))); - gsSPResetFB(play->state.gfxCtx->polyOpa.p++); + + gsSPResetFB(WORK_DISP++); + CLOSE_DISPS(play->state.gfxCtx); } void KaleidoScope_DrawEquipment(PlayState* play) {