From 4afcb78331b8b847a92c42fafa5fbea00f4da748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= <159546+serprex@users.noreply.github.com> Date: Mon, 5 Oct 2026 05:19:52 +0000 Subject: speedrun mode (#7073) prevent Esc menu while speedrun file loaded, instead toggles gameplay stats / time splits render RUN tag on speedrun files don't persist speedrun preset into player's settings --- soh/src/code/z_parameter.c | 2 ++ soh/src/code/z_sram.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'soh/src/code') diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 8a4e00c20..524ecd89f 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -21,6 +21,7 @@ #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/gameplaystats.h" #include "soh/ObjectExtension/ActorMaximumHealth.h" +#include "soh/Enhancements/speedrun/Speedrun.h" #include "message_data_static.h" #include @@ -6434,6 +6435,7 @@ void Interface_DrawTotalGameplayTimer(PlayState* play) { rectLeftOri = -9999; } } + Ship_PinSpeedrunTimer(&rectLeftOri, &rectTopOri); s32 rectLeft; s32 rectTop; diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 1e0dffca6..6dd90496e 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -8,6 +8,7 @@ #include "soh/Enhancements/randomizer/savefile.h" #include "soh/OTRGlobals.h" #include "soh/SaveManager.h" +#include "soh/Enhancements/speedrun/Speedrun.h" #include "soh/ResourceManagerHelpers.h" #include @@ -229,7 +230,8 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { u16* ptr; u16 checksum; - if (fileChooseCtx->buttonIndex != 0 || !CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0)) { + if (fileChooseCtx->buttonIndex != 0 || + !Ship_QuestDebugEnabled(fileChooseCtx->questType[fileChooseCtx->buttonIndex])) { Sram_InitNewSave(); } else { Sram_InitDebugSave(); @@ -246,7 +248,8 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { (gSaveContext.language == LANGUAGE_JPN) ? NAME_LANGUAGE_NTSC_JPN : NAME_LANGUAGE_NTSC_ENG; } - if ((fileChooseCtx->buttonIndex == 0 && CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0))) { + if ((fileChooseCtx->buttonIndex == 0 && + Ship_QuestDebugEnabled(fileChooseCtx->questType[fileChooseCtx->buttonIndex]))) { gSaveContext.cutsceneIndex = 0; } @@ -266,6 +269,10 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { gSaveContext.ship.quest.id = currentQuest; } + if (IS_SPEEDRUN) { + Speedrun_InitSaveFile(fileChooseCtx->speedrunIndex); + } + Save_SaveFile(); SaveManager_ThreadPoolWait(); } -- cgit v1.2.3