stop IdleDet from affecting save states
authornotaz <notasas@gmail.com>
Fri, 1 Dec 2017 22:10:08 +0000 (00:10 +0200)
committernotaz <notasas@gmail.com>
Fri, 1 Dec 2017 22:10:08 +0000 (00:10 +0200)
pico/state.c

index 100f423..5092ddc 100644 (file)
@@ -227,6 +227,9 @@ static int state_save(void *file)
   areaWrite(&ver, 1, 4, file);\r
 \r
   if (!(PicoIn.AHW & PAHW_SMS)) {\r
+    // the patches can cause incompatible saves with no-idle\r
+    SekFinishIdleDet();\r
+\r
     memset(buff, 0, sizeof(buff));\r
     SekPackCpu(buff, 0);\r
     CHECKED_WRITE_BUFF(CHUNK_M68K,  buff);\r
@@ -235,6 +238,9 @@ static int state_save(void *file)
     CHECKED_WRITE_BUFF(CHUNK_IOPORTS, PicoMem.ioports);\r
     ym2612_pack_state();\r
     CHECKED_WRITE(CHUNK_FM, 0x200+4, ym2612_regs);\r
+\r
+    if (!(PicoIn.opt & POPT_DIS_IDLE_DET))\r
+      SekInitIdleDet();\r
   }\r
   else {\r
     CHECKED_WRITE_BUFF(CHUNK_SMS, Pico.ms);\r