int burn = 0, x;\r
\r
// sync only needed if queue is too full or background dma might be deferred\r
- if ((vf->fifo_ql >= 6) | (pv->status & SR_DMA))\r
+ if ((vf->fifo_ql >= 6) | (pv->status & PVS_DMABG))\r
PicoVideoFIFOSync(lc);\r
- pv->status = (pv->status & ~sr_mask) | sr_flags;\r
\r
- x = (vf->fifo_qx + vf->fifo_ql - 1) & 7;\r
- if (unlikely(vf->fifo_queue[x] & FQ_BGDMA))\r
- x = (x-1) & 7; // ignore bg dma ent (pushed back below if new ent created)\r
+ // determine last ent, ignoring bg dma (pushed back below if new ent created)\r
+ x = (vf->fifo_qx + vf->fifo_ql - 1 - !!(pv->status & PVS_DMABG)) & 7;\r
\r
- // determine queue position for entry\r
- if (!(flags & FQ_BGDMA))\r
- vf->fifo_total += count;\r
+ pv->status = (pv->status & ~sr_mask) | sr_flags;\r
+ vf->fifo_total += count * !(flags & FQ_BGDMA);\r
if (!vf->fifo_ql)\r
vf->fifo_slot = Cyc2Sl(vf, lc+7); // FIFO latency ~3 vdp slots\r
\r
+ // determine queue position for entry\r
count <<= (flags & FQ_BYTE)+3;\r
if (vf->fifo_queue[x] && (vf->fifo_queue[x] & 7) == flags) {\r
// amalgamate entries if of same type and not empty (in case of bgdma)\r