From 2a2e0f890a004c3d572b68f2f0aff3787b2c955e Mon Sep 17 00:00:00 2001 From: kub Date: Wed, 22 Apr 2020 21:51:35 +0200 Subject: [PATCH] vdp fifo, bugfix --- pico/videoport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pico/videoport.c b/pico/videoport.c index dac74dc3..f9fd6ece 100644 --- a/pico/videoport.c +++ b/pico/videoport.c @@ -91,8 +91,10 @@ static __inline int AdvanceFIFOEntry(struct VdpFIFO *vf, struct PicoVideo *pv, i // if entry has been processed... if (cnt == 0) { // remove entry from FIFO - if (vf->fifo_ql) + if (vf->fifo_ql) { + vf->fifo_queue[vf->fifo_qx] = 0; vf->fifo_qx = (vf->fifo_qx+1) & 7, vf->fifo_ql --; + } // start processing for next entry if there is one if (vf->fifo_ql) { b = vf->fifo_queue[vf->fifo_qx] & FQ_BYTE; @@ -230,7 +232,7 @@ int PicoVideoFIFOWrite(int count, int flags, unsigned sr_mask,unsigned sr_flags) if (count && vf->fifo_ql < 8) { // determine queue position for entry int x = (vf->fifo_qx + vf->fifo_ql - 1) & 7; - if (unlikely(vf->fifo_ql && (vf->fifo_queue[x] & FQ_BGDMA))) { + if (unlikely(vf->fifo_queue[x] & FQ_BGDMA)) { // CPU FIFO writes have priority over a background DMA Fill/Copy // XXX if interrupting a DMA fill, fill data changes if (x == vf->fifo_qx) { // overtaking to queue head? -- 2.39.5