From: kub Date: Fri, 22 May 2020 21:14:52 +0000 (+0200) Subject: vdp rendering, bugfix for overlapping high prio sprites X-Git-Tag: v2.00~734 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6badfabe35d626a2191db893542a3613101123d0;p=picodrive.git vdp rendering, bugfix for overlapping high prio sprites --- 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));