From 6badfabe35d626a2191db893542a3613101123d0 Mon Sep 17 00:00:00 2001 From: kub Date: Fri, 22 May 2020 23:14:52 +0200 Subject: [PATCH] vdp rendering, bugfix for overlapping high prio sprites --- pico/draw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pico/draw.c b/pico/draw.c index 8bf73e79..668a1246 100644 --- a/pico/draw.c +++ b/pico/draw.c @@ -1011,12 +1011,12 @@ static void DrawSpritesHiAS(unsigned char *sprited, int sh) delta<<=4; // Delta of address if (entry+1 == cnt) width = p[entry+1]; // last sprite width limited? + while (sx <= 0 && width) width--, sx+=8, tile+=delta; // Offscreen mp = mb+(sx>>3); - for (m = *mp; width; width--, sx+=8, *mp++ = m, m >>= 8, tile+=delta) + for (m = *mp; width; width--, sx+=8, tile+=delta, *mp++ = m, m >>= 8) { unsigned int pack; - if(sx<=0) continue; if(sx>=328) break; // Offscreen pack = *(unsigned int *)(PicoMem.vram + (tile & 0x7fff)); @@ -1244,12 +1244,12 @@ static void DrawSpritesForced(unsigned char *sprited) delta<<=4; // Delta of address if (entry+1 == cnt) width = p[entry+1]; // last sprite width limited? + while (sx <= 0 && width) width--, sx+=8, tile+=delta; // Offscreen mp = mb+(sx>>3); - for (m = *mp; width; width--, sx+=8, *mp++ = m, m >>= 8, tile+=delta) + for (m = *mp; width; width--, sx+=8, tile+=delta, *mp++ = m, m >>= 8) { unsigned int pack; - if(sx<=0) continue; if(sx>=328) break; // Offscreen pack = *(unsigned int *)(PicoMem.vram + (tile & 0x7fff)); -- 2.39.5