core, improve save/load
authorkub <derkub@gmail.com>
Wed, 19 Jan 2022 22:00:23 +0000 (22:00 +0000)
committerkub <derkub@gmail.com>
Wed, 19 Jan 2022 22:00:23 +0000 (22:00 +0000)
pico/32x/32x.c
pico/pico.c

index d1e08aa..c99f5b3 100644 (file)
@@ -616,7 +616,8 @@ void Pico32xStateLoaded(int is_early)
     return;
   }
 
-  sh2s[0].m68krcycles_done = sh2s[1].m68krcycles_done = SekCyclesDone();
+  if (sh2s[0].m68krcycles_done == 0 && sh2s[1].m68krcycles_done == 0)
+    sh2s[0].m68krcycles_done = sh2s[1].m68krcycles_done = SekCyclesDone();
   p32x_update_irls(NULL, SekCyclesDone());
   p32x_timers_recalc();
   p32x_pwm_state_loaded();
index b5ac264..e924cc1 100644 (file)
@@ -187,6 +187,7 @@ int PicoReset(void)
   PsndReset(); // pal must be known here\r
 \r
   // create an empty "dma" to cause 68k exec start at random frame location\r
+  Pico.t.m68c_line_start = Pico.t.m68c_cnt;\r
   PicoVideoFIFOWrite(rand() & 0x1fff, 0, 0, PVS_CPURD);\r
 \r
   SekFinishIdleDet();\r