From: Toni Wilen Date: Wed, 3 Apr 2024 15:55:10 +0000 (+0300) Subject: Keep vblank active as long as last seen strobe is STRVBL. X-Git-Tag: 5300~52 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=f02a9a9547552eb1d90df02dd3ca80ccbd2b2119;p=francis%2Fwinuae.git Keep vblank active as long as last seen strobe is STRVBL. --- diff --git a/custom.cpp b/custom.cpp index 4c4732f3..45fa372b 100644 --- a/custom.cpp +++ b/custom.cpp @@ -382,6 +382,7 @@ static uae_u32 refmask; static int refresh_handled_slot; static bool refptr_preupdated; static bool hstrobe_conflict; +static uae_u16 last_hstrobe; static bool vhposw_modified; static int line_disabled; static bool custom_disabled; @@ -6291,6 +6292,9 @@ static void reset_decisions_hsync_start(void) } else if (ecs_agnus) { // Visible vblank end is delayed by 1 line thisline_decision.vb = vb_start_line >= 2 + vblank_extraline || vb_end_next_line ? 0 : VB_NOVB; + if (hstrobe_conflict && last_hstrobe == 0x3a && thisline_decision.vb) { + thisline_decision.vb = VB_XBLANK; + } } else { thisline_decision.vb = vb_start_line >= 2 + vblank_extraline || vb_end_next_line ? 0 : VB_NOVB; } @@ -14140,6 +14144,11 @@ static void hsync_handler_post(bool onvsync) refptr_p = refptr; for (int i = 0; i < 4; i++) { uae_u16 strobe = get_strobe_reg(i); + if (i == 0) { + if (!hstrobe_conflict) { + last_hstrobe = strobe; + } + } alloc_cycle(hp, strobe != 0x1fe ? CYCLE_STROBE : CYCLE_REFRESH); // assume refresh pointer not changed or conflicted #ifdef DEBUGGER @@ -14520,6 +14529,8 @@ void custom_reset(bool hardreset, bool keyboardreset) ht_old = 0; hdiwstate_blank = diw_states::DIW_waiting_start; maxvpos_display_vsync_next = false; + hstrobe_conflict = false; + last_hstrobe = 0; irq_forced_delay = 0; irq_forced = 0; @@ -15156,6 +15167,10 @@ static int REGPARAM2 custom_wput_1 (int hpos, uaecptr addr, uae_u32 value, int n #endif case 0x034: POTGO(value); break; + case 0x038: last_hstrobe = 0x38; break; + case 0x03a: last_hstrobe = 0x3a; break; + case 0x03c: last_hstrobe = 0x3c; break; + case 0x040: BLTCON0(hpos, value); break; case 0x042: BLTCON1(hpos, value); break;