mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-09 20:41:29 -04:00
autosave when loading scene
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user