From 7e056c853a0ae81cbfc33135c3802b55eaab5b17 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 2 Dec 2017 00:10:08 +0200 Subject: [PATCH] stop IdleDet from affecting save states --- pico/state.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pico/state.c b/pico/state.c index 100f4237..5092ddcb 100644 --- a/pico/state.c +++ b/pico/state.c @@ -227,6 +227,9 @@ static int state_save(void *file) areaWrite(&ver, 1, 4, file); if (!(PicoIn.AHW & PAHW_SMS)) { + // the patches can cause incompatible saves with no-idle + SekFinishIdleDet(); + memset(buff, 0, sizeof(buff)); SekPackCpu(buff, 0); CHECKED_WRITE_BUFF(CHUNK_M68K, buff); @@ -235,6 +238,9 @@ static int state_save(void *file) CHECKED_WRITE_BUFF(CHUNK_IOPORTS, PicoMem.ioports); ym2612_pack_state(); CHECKED_WRITE(CHUNK_FM, 0x200+4, ym2612_regs); + + if (!(PicoIn.opt & POPT_DIS_IDLE_DET)) + SekInitIdleDet(); } else { CHECKED_WRITE_BUFF(CHUNK_SMS, Pico.ms); -- 2.39.5