From 72c2a04a9d4ae0fe52383dbf4d680849036b48a1 Mon Sep 17 00:00:00 2001 From: kub Date: Fri, 22 Apr 2022 20:50:20 +0200 Subject: [PATCH] core vdp, fix status reading synchronisation --- pico/videoport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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) -- 2.39.2