From f77a0750bb3f13a2831a04f3b6a33b3715b5e63a Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 27 Mar 2024 20:13:44 +0200 Subject: [PATCH] Fix vblank start/end position in programmed modes and fix also ECS Denise special case. --- custom.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/custom.cpp b/custom.cpp index 4d0e8536..f023e6ed 100644 --- a/custom.cpp +++ b/custom.cpp @@ -6279,15 +6279,17 @@ static void reset_decisions_hsync_start(void) thisline_decision.fmode = fmode; if (!aga_mode && ecs_denise && exthblank) { - // ECS Denise + EXTBLANK: VBLANK blanking is different - thisline_decision.vb = VB_NOVB; + // ECS Denise + EXTBLANK: VBLANK blanking is different. if (new_beamcon0 & BEAMCON0_BLANKEN) { - // blanking working same as AGA - thisline_decision.vb = vb_start_line >= 1 + vblank_extraline || vb_end_next_line ? 0 : VB_NOVB; + // Follow Agnus VBLANK state directly via CSYNC connection. Ignore strobe vblank state. + thisline_decision.vb = vb_state || vb_end_line ? VB_PRGVB : VB_NOVB; + } else { + // CSYNC: follow CSYNC state + thisline_decision.vb = vs_state_on ? VB_PRGVB : VB_NOVB; } } else if (ecs_agnus) { // Visible vblank end is delayed by 1 line - thisline_decision.vb = vb_start_line >= 1 + vblank_extraline || vb_end_next_line ? 0 : VB_NOVB; + thisline_decision.vb = vb_start_line >= 2 + vblank_extraline || vb_end_next_line ? 0 : VB_NOVB; } else { thisline_decision.vb = vb_start_line >= 2 + vblank_extraline || vb_end_next_line ? 0 : VB_NOVB; } -- 2.47.3