Added/Restored the option to automatically boot into Debug Warp Screen

This commit is contained in:
nclok1405 2025-05-13 13:58:38 +09:00
commit 46985bccc7
3 changed files with 22 additions and 1 deletions

View file

@ -183,7 +183,15 @@ void OnZTitleInitReplaceTitleMainWithCustom(void* gameState) {
void OnZTitleUpdatePressButtonToSkip(void* gameState) { void OnZTitleUpdatePressButtonToSkip(void* gameState) {
TitleContext* titleContext = (TitleContext*)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 // 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->visibleDuration = 0;
titleContext->addAlpha = std::max<int16_t>((255 - titleContext->coverAlpha) / 5, 1); titleContext->addAlpha = std::max<int16_t>((255 - titleContext->coverAlpha) / 5, 1);

View file

@ -21,6 +21,12 @@ void SohMenu::AddMenuDevTools() {
.Options( .Options(
CheckboxOptions().Tooltip("Enables Debug Mode, allowing you to select maps with L + R + Z, noclip " 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.")); "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) AddWidget(path, "OoT Registry Editor", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_DEVELOPER_TOOLS("RegEditEnabled")) .CVar(CVAR_DEVELOPER_TOOLS("RegEditEnabled"))
.PreFunc([](WidgetInfo& info) { info.isHidden = !CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0); }) .PreFunc([](WidgetInfo& info) { info.isHidden = !CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0); })

View file

@ -3588,6 +3588,13 @@ void FileChoose_Main(GameState* thisx) {
gSaveContext.skyboxTime += 0x10; 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); OPEN_DISPS(this->state.gfxCtx);
this->n64ddFlag = 0; this->n64ddFlag = 0;