]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Blitter+copper wakeup fix.
authorToni Wilen <twilen@winuae.net>
Sat, 9 Jan 2021 14:56:48 +0000 (16:56 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 9 Jan 2021 14:56:48 +0000 (16:56 +0200)
blitter.cpp
custom.cpp

index cddcc334de8db84a479a17cc9e0d6138cce8578b..716254c37b30a456ee4141a88ed2a68cc0d76eda 100644 (file)
@@ -1237,8 +1237,13 @@ bool decide_blitter_maybe_write(int hpos, uaecptr addr, uae_u16 value)
                return false;
        }
 
+       if (hpos < 0) {
+               hpos = maxhpos;
+       }
+
        if (!blt_info.blit_main && !blt_info.blit_finald) {
-               return false;
+               last_blitter_hpos = hpos;
+               goto end;
        }
 
        if (log_blitter && blitter_delayed_debug) {
@@ -1250,10 +1255,6 @@ bool decide_blitter_maybe_write(int hpos, uaecptr addr, uae_u16 value)
                return false;
        }
 
-       if (hpos < 0) {
-               hpos = maxhpos;
-       }
-
        while (last_blitter_hpos < hpos) {
 
                int c = get_current_channel();
@@ -1357,6 +1358,7 @@ bool decide_blitter_maybe_write(int hpos, uaecptr addr, uae_u16 value)
 
                last_blitter_hpos++;
        }
+end:
        reset_channel_mods();
        if (hsync)
                last_blitter_hpos = 0;
index 00503f70411e997a0aae643eeb8c87d1426cdc37..5890cee1781ab7902e827619fc0eb39ba34eea12 100644 (file)
@@ -7594,39 +7594,22 @@ static void compute_spcflag_copper (int hpos)
 
 void blitter_done_notify (int hpos)
 {
+       bool nextline = false;
+
        if (cop_state.state != COP_bltwait)
                return;
 
-       cop_state.state = COP_wait;
-       int hp = current_hpos();
-       hp += 3;
-       hp &= ~1;
        int vp_wait = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80);
        int vp = vpos;
-       if (hpos >= maxhpos) {
-               hpos -= maxhpos;
-               vp++;
-       }
-       last_copper_hpos = hp;
-       cop_state.hpos = hp;
-       cop_state.vpos = vp;
-       if (dmaen(DMA_COPPER) && vp_wait >= cop_state.vcmp) {
-               copper_enabled_thisline = 1;
-               set_special(SPCFLAG_COPPER);
-       } else {
-               unset_special(SPCFLAG_COPPER);
-       }
-       return;
 
-       vp_wait = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80);
-       vp = vpos;
-
-       hpos += 1;
+       hpos += 3;
        hpos &= ~1;
        if (hpos >= maxhpos) {
                hpos -= maxhpos;
                vp++;
+               nextline = true;
        }
+
        cop_state.hpos = hpos;
        cop_state.vpos = vp;
        cop_state.state = COP_wait;
@@ -7640,11 +7623,11 @@ void blitter_done_notify (int hpos)
                record_copper_blitwait(cop_state.ip - 4, hpos, vp);
 #endif
 
-       if (dmaen(DMA_COPPER) && vp_wait >= cop_state.vcmp) {
+       if (dmaen(DMA_COPPER) && vp_wait >= cop_state.vcmp && !nextline) {
                copper_enabled_thisline = 1;
                set_special(SPCFLAG_COPPER);
        } else {
-               unset_special (SPCFLAG_COPPER);
+               unset_special(SPCFLAG_COPPER);
        }
 }