]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix BPLCON1 special case where same scanline has odd!=even and odd==even BPLCON1...
authorToni Wilen <twilen@winuae.net>
Sun, 22 Apr 2018 10:36:48 +0000 (13:36 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 22 Apr 2018 10:36:48 +0000 (13:36 +0300)
custom.cpp

index 86b50e9199beab8dd2b5df9220e818ba5892f3b7..95cc918aad2267233e641c11fdf1abeb28cc256a 100644 (file)
@@ -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--;