cd sync improvements, part2
[picodrive.git] / pico / videoport.c
index ab02af8..42f55c8 100644 (file)
@@ -93,8 +93,7 @@ static void DmaSlow(int len)
     SekCyclesDone(), SekPc);\r
 \r
   Pico.m.dma_xfers += len;\r
-  if ((PicoAHW & PAHW_MCD) && (PicoOpt & POPT_EN_MCD_PSYNC)) SekCyclesBurn(CheckDMA());\r
-  else SekEndTimeslice(SekCyclesLeftNoMCD - CheckDMA());\r
+  SekCyclesBurnRun(CheckDMA());\r
 \r
   if ((source&0xe00000)==0xe00000) { // Ram\r
     pd=(u16 *)(Pico.ram+(source&0xfffe));\r
@@ -208,7 +207,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
@@ -361,8 +361,7 @@ PICO_INTERNAL_ASM void PicoVideoWrite(unsigned int a,unsigned short d)
         pvid->lwrite_cnt++;\r
         if (pvid->lwrite_cnt >= 4) pvid->status|=0x100; // FIFO full\r
         if (pvid->lwrite_cnt >  4) {\r
-          SekCyclesBurn(32); // penalty // 488/12-8\r
-          if (SekCycleCnt>=SekCycleAim) SekEndRun(0);\r
+          SekCyclesBurnRun(32); // penalty // 488/12-8\r
         }\r
         elprintf(EL_ASVDP, "VDP data write: %04x [%06x] {%i} #%i @ %06x", d, Pico.video.addr,\r
                  Pico.video.type, pvid->lwrite_cnt, SekPc);\r
@@ -424,7 +423,7 @@ PICO_INTERNAL_ASM void PicoVideoWrite(unsigned int a,unsigned short d)
 update_irq:\r
 #ifndef EMU_CORE_DEBUG\r
         // update IRQ level\r
-        if (!SekShouldInterrupt) // hack\r
+        if (!SekShouldInterrupt()) // hack\r
         {\r
           int lines, pints, irq=0;\r
           lines = (pvid->reg[1] & 0x20) | (pvid->reg[0] & 0x10);\r
@@ -545,3 +544,5 @@ unsigned int PicoVideoRead8(unsigned int a)
 \r
   return 0;\r
 }\r
+\r
+// vim:shiftwidth=2:ts=2:expandtab\r