From 46985bccc7b93bb088dd9094b889d5493749d3e3 Mon Sep 17 00:00:00 2001 From: nclok1405 <155463060+nclok1405@users.noreply.github.com> Date: Tue, 13 May 2025 13:58:38 +0900 Subject: [PATCH] Added/Restored the option to automatically boot into Debug Warp Screen --- soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp | 10 +++++++++- soh/soh/SohGui/SohMenuDevTools.cpp | 6 ++++++ .../gamestates/ovl_file_choose/z_file_choose.c | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp index 029284fa4..b465229a1 100644 --- a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp +++ b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp @@ -183,7 +183,15 @@ void OnZTitleInitReplaceTitleMainWithCustom(void* gameState) { void OnZTitleUpdatePressButtonToSkip(void* gameState) { TitleContext* titleContext = (TitleContext*)gameState; - if (CHECK_BTN_ANY(titleContext->state.input->press.button, BTN_A | BTN_B | BTN_START)) { + if ((CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0) != 0) && (CVarGetInteger(CVAR_DEVELOPER_TOOLS("BootToDebugWarpScreen"), 0) != 0)) { + // Boot to Debug Warp Screen + gSaveContext.seqId = (u8)NA_BGM_DISABLED; + gSaveContext.natureAmbienceId = 0xFF; + gSaveContext.gameMode = GAMEMODE_FILE_SELECT; + titleContext->state.running = false; + + SET_NEXT_GAMESTATE(&titleContext->state, FileChoose_Init, FileChooseContext); + } else if (CHECK_BTN_ANY(titleContext->state.input->press.button, BTN_A | BTN_B | BTN_START)) { // Force the title state to start fading to black and to last roughly 5 frames based on current fade in/out titleContext->visibleDuration = 0; titleContext->addAlpha = std::max((255 - titleContext->coverAlpha) / 5, 1); diff --git a/soh/soh/SohGui/SohMenuDevTools.cpp b/soh/soh/SohGui/SohMenuDevTools.cpp index 6a5c292eb..0573544b2 100644 --- a/soh/soh/SohGui/SohMenuDevTools.cpp +++ b/soh/soh/SohGui/SohMenuDevTools.cpp @@ -21,6 +21,12 @@ void SohMenu::AddMenuDevTools() { .Options( CheckboxOptions().Tooltip("Enables Debug Mode, allowing you to select maps with L + R + Z, noclip " "with L + D-pad Right, and open the debug menu with L on the pause screen.")); + AddWidget(path, "Boot To Debug Warp Screen", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_DEVELOPER_TOOLS("BootToDebugWarpScreen")) + .PreFunc([](WidgetInfo& info) { info.isHidden = !CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0); }) + .Options(CheckboxOptions() + .Tooltip("Automatically shows Debug Warp Screen when starting or resetting the game.\n" + "This option takes precedence over \"Boot Sequence\" option.")); AddWidget(path, "OoT Registry Editor", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_DEVELOPER_TOOLS("RegEditEnabled")) .PreFunc([](WidgetInfo& info) { info.isHidden = !CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0); }) diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 2b6e9fd5d..d49d1b229 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -3588,6 +3588,13 @@ void FileChoose_Main(GameState* thisx) { gSaveContext.skyboxTime += 0x10; } + // Boot to Debug Warp Screen + if ((CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0) != 0) && (CVarGetInteger(CVAR_DEVELOPER_TOOLS("BootToDebugWarpScreen"), 0) != 0)) { + this->buttonIndex = 0xFF; + this->menuMode = FS_MENU_MODE_SELECT; + this->selectMode = SM_LOAD_GAME; + } + OPEN_DISPS(this->state.gfxCtx); this->n64ddFlag = 0;