32x: fix some more timing problems
[picodrive.git] / pico / videoport.c
index 3d74f51..b78c358 100644 (file)
@@ -1,11 +1,11 @@
-// PicoDrive\r
-\r
-// (c) Copyright 2004 Dave, All rights reserved.\r
-// (c) Copyright 2006-2008, Grazvydas "notaz" Ignotas\r
-// Free for non-commercial use.\r
-\r
-// For commercial use, separate licencing terms must be obtained.\r
-\r
+/*\r
+ * PicoDrive\r
+ * (c) Copyright Dave, 2004\r
+ * (C) notaz, 2006-2009\r
+ *\r
+ * This work is licensed under the terms of MAME license.\r
+ * See COPYING file in the top-level directory.\r
+ */\r
 \r
 #include "pico_int.h"\r
 #include "cd/gfx_cd.h"\r
@@ -94,7 +94,7 @@ static void DmaSlow(int len)
 \r
   Pico.m.dma_xfers += len;\r
   if ((PicoAHW & PAHW_MCD) && (PicoOpt & POPT_EN_MCD_PSYNC)) SekCyclesBurn(CheckDMA());\r
-  else SekSetCyclesLeftNoMCD(SekCyclesLeftNoMCD - CheckDMA());\r
+  else SekEndTimeslice(SekCyclesLeftNoMCD - CheckDMA());\r
 \r
   if ((source&0xe00000)==0xe00000) { // Ram\r
     pd=(u16 *)(Pico.ram+(source&0xfffe));\r
@@ -208,7 +208,8 @@ static void DmaSlow(int len)
       break;\r
 \r
     default:\r
-      elprintf(EL_VDPDMA|EL_ANOMALY, "DMA with bad type %i", Pico.video.type);\r
+      if (Pico.video.type != 0 || (EL_LOGMASK & EL_VDPDMA))\r
+        elprintf(EL_VDPDMA|EL_ANOMALY, "DMA with bad type %i", Pico.video.type);\r
       break;\r
   }\r
   // remember addr\r
@@ -316,7 +317,7 @@ static void CommandChange(void)
   if (cmd&0x80) CommandDma();\r
 }\r
 \r
-static __inline void DrawSync(int blank_on)\r
+static void DrawSync(int blank_on)\r
 {\r
   if (Pico.m.scanline < 224 && !(PicoOpt & POPT_ALT_RENDERER) &&\r
       !PicoSkipFrame && DrawScanline <= Pico.m.scanline) {\r
@@ -545,3 +546,5 @@ unsigned int PicoVideoRead8(unsigned int a)
 \r
   return 0;\r
 }\r
+\r
+// vim:shiftwidth=2:ts=2:expandtab\r