From 2f75209f0b04f6dda78185d658e69bbebae94536 Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Sat, 18 May 2024 23:24:07 -0400 Subject: [PATCH] Add variable save delay. --- mm/src/code/z_sram_NES.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/src/code/z_sram_NES.c b/mm/src/code/z_sram_NES.c index a59c6c06e..94e8c73bc 100644 --- a/mm/src/code/z_sram_NES.c +++ b/mm/src/code/z_sram_NES.c @@ -1994,7 +1994,7 @@ void Sram_UpdateWriteToFlashDefault(SramContext* sramCtx) { sramCtx->status = 4; } } - } else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER(0 /*2*/)) { // 2S2H [Port] Remove arbitrary 2 second delay + } else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER(CVarGetInteger("gEnhancements.Save.SaveDelay", 0))) { // 2S2H [Port] Some tricks require a save delay so we can't just force it to zero // Finished status is hardcoded to 2 seconds instead of when the task finishes sramCtx->status = 0; } @@ -2032,7 +2032,7 @@ void Sram_UpdateWriteToFlashOwlSave(SramContext* sramCtx) { sramCtx->status = 4; } } - } else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER(0 /*2*/)) { // 2S2H [Port] Remove arbitrary 2 second delay + } else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->startWriteOsTime) >= SECONDS_TO_TIMER(CVarGetInteger("gEnhancements.Save.SaveDelay", 0))) { // 2S2H [Port] Some tricks require a save delay so we can't just force it to zero // Finished status is hardcoded to 2 seconds instead of when the task finishes sramCtx->status = 0; memset(sramCtx->saveBuf, 0, SAVE_BUFFER_SIZE);