vdp timing hacks
[picodrive.git] / pico / videoport.c
index 1f57f2d..4da3ce3 100644 (file)
@@ -377,14 +377,12 @@ PICO_INTERNAL_ASM void PicoVideoWrite(unsigned int a,unsigned short d)
     }\r
 \r
     // preliminary FIFO emulation for Chaos Engine, The (E)\r
-    if (!(pvid->status&8) && (pvid->reg[1]&0x40) && !(PicoOpt&POPT_DIS_VDP_FIFO)) // active display?\r
+    if (!(pvid->status & SR_VB) && (pvid->reg[1] & 0x40) && !(PicoOpt&POPT_DIS_VDP_FIFO)) // active display?\r
     {\r
-      pvid->status&=~0x200; // FIFO no longer empty\r
-      pvid->lwrite_cnt++;\r
-      if (pvid->lwrite_cnt >= 4) pvid->status|=0x100; // FIFO full\r
-      if (pvid->lwrite_cnt >  4) {\r
-        SekCyclesBurnRun(32); // penalty // 488/12-8\r
-      }\r
+      int use = pvid->type == 1 ? 2 : 1;\r
+      pvid->lwrite_cnt -= use;\r
+      if (pvid->lwrite_cnt < 0)\r
+        SekCyclesLeft = 0;\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
     }\r