]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Keep vblank active as long as last seen strobe is STRVBL.
authorToni Wilen <twilen@winuae.net>
Wed, 3 Apr 2024 15:55:10 +0000 (18:55 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 3 Apr 2024 15:55:10 +0000 (18:55 +0300)
custom.cpp

index 4c4732f3c9c17a52ce900bd1c28aca5db9100c07..45fa372b6af04827f91615c622dd67657b0d9ded 100644 (file)
@@ -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;