From: Toni Wilen Date: Sun, 22 Apr 2018 10:36:48 +0000 (+0300) Subject: Fix BPLCON1 special case where same scanline has odd!=even and odd==even BPLCON1... X-Git-Tag: 4000~101 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=aed65173bddab2b4e0e26977c029876e3a768759;p=francis%2Fwinuae.git Fix BPLCON1 special case where same scanline has odd!=even and odd==even BPLCON1 modifications. --- diff --git a/custom.cpp b/custom.cpp index 86b50e91..95cc918a 100644 --- a/custom.cpp +++ b/custom.cpp @@ -150,6 +150,7 @@ static bool genlockvtoggle; static bool graphicsbuffer_retry; static int scanlinecount; static int cia_hsync; +static bool toscr_scanline_complex_bplcon1; #define LOF_TOGGLES_NEEDED 3 //#define NLACE_CNT_NEEDED 50 @@ -1687,13 +1688,17 @@ static void toscr_1 (int nbits, int fm) { if (delay_cycles + nbits >= delay_lastcycle[lol]) { toscr_right_edge (nbits, fm); - } else if (toscr_delay[0] == toscr_delay[1]) { + } else if (!toscr_scanline_complex_bplcon1 && toscr_delay[0] == toscr_delay[1]) { // Most common case. do_delays_fast (nbits, fm); delay_cycles += nbits; } else { do_delays (nbits, fm); delay_cycles += nbits; + // if scanline has at least one complex case (odd != even) + // all possible remaining odd == even cases in same scanline + // must also use complex case routine. + toscr_scanline_complex_bplcon1 = true; } out_nbits += nbits; @@ -3973,6 +3978,7 @@ static void reset_decisions (void) bitplane_maybe_start_hpos = -1; bitplane_off_delay = -1; hack_delay_shift = 0; + toscr_scanline_complex_bplcon1 = false; if (line_cyclebased) { line_cyclebased--;