From 9e510c898c266d248b2e503c05424af1262671af Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 14 Nov 2021 13:33:01 +0200 Subject: [PATCH] Pending blitter final D write does not happen if D is disabled, line mode is enabled or new blit starts. --- blitter.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/blitter.cpp b/blitter.cpp index 10070882..6da06359 100644 --- a/blitter.cpp +++ b/blitter.cpp @@ -1557,10 +1557,12 @@ static bool decide_blitter_maybe_write2(int until_hpos, uaecptr addr, uae_u32 va } if (blt_info.blit_finald == 1) { - // final D write - int offset = get_rga_pipeline(hpos, RGA_PIPELINE_OFFSET_BLITTER); - cycle_line_pipe[offset] = CYCLE_PIPE_BLITTER; - blitter_pipe[offset] = CYCLE_PIPE_BLITTER | 4 | BLITTER_PIPELINE_ADDMOD | BLITTER_PIPELINE_LASTD; + // final D write. Only if BLTCON D and line mode is off. + if ((bltcon0 & 0x0100) && !(bltcon1 & 1)) { + int offset = get_rga_pipeline(hpos, RGA_PIPELINE_OFFSET_BLITTER); + cycle_line_pipe[offset] = CYCLE_PIPE_BLITTER; + blitter_pipe[offset] = CYCLE_PIPE_BLITTER | 4 | BLITTER_PIPELINE_ADDMOD | BLITTER_PIPELINE_LASTD; + } if (currprefs.chipset_mask & CSMASK_AGA) { blitter_done_all(hpos); } @@ -1810,6 +1812,8 @@ void do_blitter(int hpos, int copper, uaecptr pc) blit_cyclecounter = 0; blit_totalcyclecounter = 0; blt_info.blit_pending = 1; + // pending finald gets cleared when new blit starts + blt_info.blit_finald = 0; blitter_start_init(); -- 2.47.3