summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorPhilip Dubé <159546+serprex@users.noreply.github.com>2026-10-05 05:19:52 +0000
committerGitHub <noreply@github.com>2026-10-05 05:19:52 +0000
commit4afcb78331b8b847a92c42fafa5fbea00f4da748 (patch)
tree31b54e848855933a008993784e40331d4b9546ff /soh/src/code
parentb69cb6607e493f3a8f347dbf4bf32ae852fc9142 (diff)
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
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_parameter.c2
-rw-r--r--soh/src/code/z_sram.c11
2 files changed, 11 insertions, 2 deletions
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 <libultraship/bridge/consolevariablebridge.h>
@@ -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 <libultraship/bridge/consolevariablebridge.h>
@@ -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();
}