From: Toni Wilen Date: Tue, 9 Dec 2025 15:17:13 +0000 (+0200) Subject: Replace old sprite hack with correct fix X-Git-Tag: 6020~21 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=a781a89c1e54b99b9f52803ed37b72b110b47d11;p=francis%2Fwinuae.git Replace old sprite hack with correct fix --- diff --git a/custom.cpp b/custom.cpp index 2caf13a8..a526fd53 100644 --- a/custom.cpp +++ b/custom.cpp @@ -4130,7 +4130,8 @@ static void sprstartstop(struct sprite *s) if (vpos == s->vstart) { s->dmastate = 1; } - if (vpos == s->vstop) { + // DMA can't get enabled during last line of VB (sprite reset line) + if (vpos == s->vstop || agnus_vb_active_end_line) { s->dmastate = 0; s->dmacycle = 0; } @@ -4165,20 +4166,7 @@ static void SPRxCTL(uae_u16 v, int num) SPRxCTLPOS(num); sprstartstop(s); } -static void SPRxCTL_DMA(uae_u16 v, int num) -{ - struct sprite *s = &spr[num]; - s->ctl = v; - sprstartstop(s); - SPRxCTLPOS(num); - // This is needed to disarm previous field's sprite. - // It can be seen on OCS Agnus + ECS Denise combination where - // this cycle is disabled due to weird DDFTSTR=$18 copper list - // which causes corrupted sprite to "wrap around" the display. - s->dmastate = 0; - sprstartstop(s); -} static void SPRxPOS(uae_u16 v, int num) { struct sprite *s = &spr[num]; @@ -12153,7 +12141,7 @@ static void handle_rga_out(void) if (!dmastate) { if (slot) { - SPRxCTL_DMA(sdat, num); + SPRxCTL(sdat, num); } else { SPRxPOS(sdat, num); }