From: kub Date: Fri, 22 Apr 2022 18:50:20 +0000 (+0200) Subject: core vdp, fix status reading synchronisation X-Git-Tag: v2.00~309 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72c2a04a9d4ae0fe52383dbf4d680849036b48a1;p=picodrive.git core vdp, fix status reading synchronisation --- diff --git a/pico/videoport.c b/pico/videoport.c index 279347b9..07b16b51 100644 --- a/pico/videoport.c +++ b/pico/videoport.c @@ -984,14 +984,15 @@ static u32 VideoSr(const struct PicoVideo *pv) { unsigned int hp = pv->reg[12]&1 ? hboff40*488/slots40 : hboff32*488/slots32; unsigned int hl = pv->reg[12]&1 ? hblen40*488/slots40 : hblen32*488/slots32; - unsigned int c; - u32 d = (u16)pv->status; + unsigned int c = SekCyclesDone() - Pico.t.m68c_line_start; + u32 d; + + PicoVideoFIFOSync(c); + d = (u16)pv->status; - c = SekCyclesDone() - Pico.t.m68c_line_start; if (c - hp < hl) d |= SR_HB; - PicoVideoFIFOSync(c); if (VdpFIFO.fifo_total >= 4) d |= SR_FULL; else if (!VdpFIFO.fifo_total)