various bugfixes
[picodrive.git] / Pico / PicoFrameHints.c
index 562229f..ba76f6f 100644 (file)
@@ -22,7 +22,7 @@
     else { \
       cnt = SekCyclesDone() - z80startCycle; \
       cnt = (cnt>>1)-(cnt>>5); \
-      if (cnt > (z80_cycles)) cnt = z80_cycles; \
+      if (cnt < 0 || cnt > (z80_cycles)) cnt = z80_cycles; \
       Pico.m.z80Run |= 2; \
       z80CycleAim+=cnt; \
     } \
@@ -139,6 +139,10 @@ static int PicoFrameHints(void)
 #endif
   }
 
+#ifdef DRAW_FINISH_FUNC
+  DRAW_FINISH_FUNC();
+#endif
+
   // V-int line (224 or 240)
   Pico.m.scanline=(short)y;