autosave when loading scene

This commit is contained in:
MelonSpeedruns
2026-04-17 13:12:20 -04:00
parent 916dfcd9da
commit 8c5673d9b8
2 changed files with 16 additions and 3 deletions
+16
View File
@@ -700,6 +700,10 @@ static u8 lbl_8074CAE4;
static u32 l_sceneChangeStartTick;
#endif
#if TARGET_PC
static BOOL shouldAutoSave;
#endif
static int dScnPly_Execute(dScnPly_c* i_this) {
#if DEBUG
fapGm_HIO_c::startCpuTimer();
@@ -742,6 +746,13 @@ static int dScnPly_Execute(dScnPly_c* i_this) {
}
}
#if TARGET_PC
if (!fopOvlpM_IsPeek() && !dComIfG_resetToOpening(i_this) && !dComIfGp_isEnableNextStage() && shouldAutoSave == FALSE) {
triggerAutoSave();
shouldAutoSave = TRUE;
}
#endif
dKy_itudemo_se();
#if DEBUG
@@ -1598,6 +1609,11 @@ static int dScnPly_Create(scene_class* i_this) {
dScnPly_c* a_this = (dScnPly_c*)i_this;
int phase_state = dComLbG_PhaseHandler(&a_this->field_0x1c4, l_method, a_this);
#if TARGET_PC
shouldAutoSave = FALSE;
#endif
return phase_state;
}
-3
View File
@@ -766,9 +766,6 @@ void updateAutoSave() {
}
void writeAutoSave() {
int stageNo = dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo());
dComIfGs_putSave(stageNo);
dComIfGs_setMemoryToCard(mSaveBuffer, dComIfGs_getDataNum());
mDoMemCdRWm_SetCheckSumGameData(mSaveBuffer, dComIfGs_getDataNum());