From: notaz Date: Fri, 1 Dec 2017 22:10:08 +0000 (+0200) Subject: stop IdleDet from affecting save states X-Git-Tag: v1.93~24 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e056c853a0ae81cbfc33135c3802b55eaab5b17;p=picodrive.git stop IdleDet from affecting save states --- 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);