Enhancement to double pause menu animation speed (#5615)
Some checks failed
generate-builds / generate-soh-otr (push) Has been cancelled
generate-builds / build-macos (push) Has been cancelled
generate-builds / build-linux (push) Has been cancelled
generate-builds / build-windows (push) Has been cancelled

* Add enhancement to speed up pause menu animation

* Rename CVar to FasterPauseMenu

* Rename kaleido to pause menu

* Rename register func to InitFasterPauseMenu
This commit is contained in:
Eblo 2025-06-28 10:50:28 -04:00 committed by GitHub
parent e15f8d395b
commit 9924ebbd05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,35 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/ShipInit.hpp"
extern "C" {
#include "variables.h"
extern PlayState* gPlayState;
extern void func_808237B4(PlayState* play, Input* input);
}
#define CVAR_FASTER_PAUSE_MENU_NAME CVAR_ENHANCEMENT("FasterPauseMenu")
#define CVAR_FASTER_PAUSE_MENU_VALUE CVarGetInteger(CVAR_FASTER_PAUSE_MENU_NAME, 0)
void OnKaleidoUpdateFaster() {
ZREG(46) = 2; // pauseCtx->eye and pauseCtx->unk_1EA multiply by this for animation. Double the default value.
WREG(6) = 4; // Numerous kaleido animations divide by this for movement and alpha. Half the default value.
// Page turn animation is governed by func_808237B4. Those values don't use registers to modify the speed, so we
// just directly call it twice to effectively double the speed.
if (gPlayState->pauseCtx.state == 6 && gPlayState->pauseCtx.unk_1E4 == 1) { // In page turning mode
func_808237B4(gPlayState, gPlayState->state.input);
}
}
void InitFasterPauseMenu() {
COND_HOOK(GameInteractor::OnKaleidoUpdate, CVAR_FASTER_PAUSE_MENU_VALUE, OnKaleidoUpdateFaster);
// Reset register values on close. These values are only used by z_kaleido_scope_PAL.c
COND_VB_SHOULD(VB_KALEIDO_UNPAUSE_CLOSE, CVAR_FASTER_PAUSE_MENU_VALUE, {
// Default values, as defined in Regs_InitDataImpl
ZREG(46) = 1;
WREG(6) = 8;
});
}
static RegisterShipInitFunc initFunc(InitFasterPauseMenu, { CVAR_FASTER_PAUSE_MENU_NAME });

View file

@ -351,6 +351,9 @@ void SohMenu::AddMenuEnhancements() {
AddWidget(path, "King Zora Speed: %.2fx", WIDGET_CVAR_SLIDER_FLOAT)
.CVar(CVAR_ENHANCEMENT("MweepSpeed"))
.Options(FloatSliderOptions().Min(0.1f).Max(5.0f).DefaultValue(1.0f).Format("%.2fx"));
AddWidget(path, "Faster Pause Menu", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("FasterPauseMenu"))
.Options(CheckboxOptions().Tooltip("Speeds up animation of the pause menu, similar to Majora's Mask"));
path.column = SECTION_COLUMN_3;
AddWidget(path, "Misc", WIDGET_SEPARATOR_TEXT);