From: Toni Wilen Date: Fri, 26 May 2023 18:27:22 +0000 (+0300) Subject: Remove interlace artifacts blitter/cycle state fix. X-Git-Tag: 5.0.0~14 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=05c57c4d915f7f6babb18a17ebcb6a93dc4bf705;p=francis%2Fwinuae.git Remove interlace artifacts blitter/cycle state fix. --- diff --git a/blitter.cpp b/blitter.cpp index fca77c1e..6764ee6e 100644 --- a/blitter.cpp +++ b/blitter.cpp @@ -1500,6 +1500,10 @@ static bool decide_blitter_maybe_write2(int until_hpos, uaecptr addr, uae_u32 va bool written = false; int hsync = until_hpos < 0; + if (scandoubled_line) { + return 0; + } + if (hsync && blt_delayed_irq) { if (blt_delayed_irq > 0) blt_delayed_irq--; diff --git a/custom.cpp b/custom.cpp index ba58c379..262f077a 100644 --- a/custom.cpp +++ b/custom.cpp @@ -132,6 +132,7 @@ static int hpos_hsync_extra; static int vpos_count, vpos_count_diff; int lof_store; // real bit in custom registers int lof_display; // what display device thinks +int scandoubled_line; static bool lof_lastline, lof_prev_lastline; static int lol, lol_prev; static int next_lineno; @@ -142,7 +143,6 @@ static int vposw_change; static bool lof_lace; static bool prevlofs[3]; static bool bplcon0_interlace_seen; -static int scandoubled_line; static bool vsync_rendered, frame_rendered, frame_shown; static frame_time_t vsynctimeperline; static frame_time_t frameskiptime; @@ -12326,6 +12326,13 @@ static void hsync_scandoubler(int hpos) } } } + + uae_u8 cycle_line_slot_tmp[MAX_CHIPSETSLOTS]; + uae_u16 cycle_line_pipe_tmp[MAX_CHIPSETSLOTS]; + + memcpy(cycle_line_slot_tmp, cycle_line_slot, sizeof(uae_u8) * MAX_CHIPSETSLOTS); + memcpy(cycle_line_pipe_tmp, cycle_line_pipe, sizeof(uae_u16) * MAX_CHIPSETSLOTS); + reset_decisions_scanline_start(); reset_scandoubler_sync(hpos); reset_decisions_hsync_start(); @@ -12356,6 +12363,9 @@ static void hsync_scandoubler(int hpos) dmacon = odmacon; copper_enabled_thisline = ocop; + memcpy(cycle_line_slot, cycle_line_slot_tmp, sizeof(uae_u8) * MAX_CHIPSETSLOTS); + memcpy(cycle_line_pipe, cycle_line_pipe_tmp, sizeof(uae_u16) * MAX_CHIPSETSLOTS); + for (int i = 0; i < MAX_PLANES; i++) { bplpt[i] = bpltmp[i]; bplptx[i] = bpltmpx[i]; diff --git a/include/custom.h b/include/custom.h index 86742083..f6a7f558 100644 --- a/include/custom.h +++ b/include/custom.h @@ -76,6 +76,7 @@ extern uae_u16 dmacon; extern uae_u16 intena, intreq, intreqr; extern int vpos, lof_store, lof_display; +extern int scandoubled_line; extern int n_frames;