From 2c4675a9934b8dce2b07a58cb755aa3e4d7fa230 Mon Sep 17 00:00:00 2001 From: kub Date: Sun, 16 Oct 2022 19:27:15 +0000 Subject: [PATCH] core, fix cpu sync regression --- pico/pico_cmn.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pico/pico_cmn.c b/pico/pico_cmn.c index b2b34750..27ed5fd3 100644 --- a/pico/pico_cmn.c +++ b/pico/pico_cmn.c @@ -118,8 +118,7 @@ static int PicoFrameHints(void) // === active display === pv->status |= PVS_ACTIVE; - lines_vis = (pv->reg[1] & 8) ? 240 : 224; - for (y = 0; y < lines_vis; y++) + for (y = 0; ; y++) { pv->v_counter = Pico.m.scanline = y; if ((pv->reg[12]&6) == 6) { // interlace mode 2 @@ -128,6 +127,9 @@ static int PicoFrameHints(void) pv->v_counter &= 0xff; } + if (y == (pv->reg[1] & 8 ? 240 : 224)) + break; + PAD_DELAY(); // H-Interrupts: @@ -175,7 +177,9 @@ static int PicoFrameHints(void) #endif // === VBLANK, 1st line === - pv->status &= ~PVS_ACTIVE; + lines_vis = (pv->reg[1] & 8) ? 240 : 224; + if (y == lines_vis) + pv->status &= ~PVS_ACTIVE; memcpy(PicoIn.padInt, PicoIn.pad, sizeof(PicoIn.padInt)); PAD_DELAY(); -- 2.39.5