From: Toni Wilen Date: Sun, 18 Dec 2022 13:25:38 +0000 (+0200) Subject: 68020+ CPU config glitch workaround X-Git-Tag: 41000~3 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=05f063e20f3f49d97d49493c0cbf0349dd407141;p=francis%2Fwinuae.git 68020+ CPU config glitch workaround --- diff --git a/custom.cpp b/custom.cpp index d6cfda3e..288b12fb 100644 --- a/custom.cpp +++ b/custom.cpp @@ -5517,6 +5517,21 @@ static void get_strobe_conflict_shift(int hpos) delay_cycles = unalign << LORES_TO_SHRES_SHIFT; } +static uae_u16 BPLCON0_Denise_mask(uae_u16 v) +{ + if (!ecs_denise) { + v &= ~0x00F1; + } else if (!aga_mode) { + v &= ~0x00B0; + } + + v &= ~((currprefs.cs_color_burst ? 0x0000 : 0x0200) | 0x0100 | 0x0080 | 0x0020); +#if SPRBORDER + v |= 1; +#endif + return v; +} + static void reset_decisions_hsync_start(void) { if (nodraw()) { @@ -5645,6 +5660,13 @@ static void reset_decisions_hsync_start(void) thisline_decision.xor_seen = (bplcon4 & 0xff00) != 0; thisline_decision.nr_planes = toscr_nr_planes_agnus; + // workaround for glitches in faster modes + // update Denise state immediately if bitplane DMA is idle and shifters are empty + if (!bprun && !plane0 && !plane0p) { + bplcon0d = BPLCON0_Denise_mask(bplcon0); + toscr_nr_planes_shifter = GET_PLANES(bplcon0d); + } + toscr_nr_planes2 = GET_PLANES(bplcon0d); if (isocs7planes()) { if (toscr_nr_planes2 < 6) { @@ -8002,21 +8024,6 @@ static void BPLxPTL(int hpos, uae_u16 v, int num) //write_log (_T("%d:%d:BPL%dPTL %08X COP=%08x\n"), hpos, vpos, num, bplpt[num], cop_state.ip); } -static uae_u16 BPLCON0_Denise_mask(uae_u16 v) -{ - if (!ecs_denise) { - v &= ~0x00F1; - } else if (!aga_mode) { - v &= ~0x00B0; - } - - v &= ~((currprefs.cs_color_burst ? 0x0000 : 0x0200) | 0x0100 | 0x0080 | 0x0020); -#if SPRBORDER - v |= 1; -#endif - return v; -} - static void BPLCON0_Denise(int hpos, uae_u16 v) { v = BPLCON0_Denise_mask(v);