X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fmode4.c;h=a13c38b0d68d947726e274fd970be4551ab586e5;hb=1c25c32c114f8cb76674287d2c85ee5677bfacf7;hp=0f3d766b026d224384f545c840caa4e99b51c3ca;hpb=7669591e0876778fc4f3977b145c012f2e3a12e9;p=picodrive.git diff --git a/pico/mode4.c b/pico/mode4.c index 0f3d766..a13c38b 100644 --- a/pico/mode4.c +++ b/pico/mode4.c @@ -91,7 +91,7 @@ static void draw_sprites(int scanline) } sprite_base = (pv->reg[6] & 4) << (13-2-1); - for (i = s = 0; i < 64 && s < 8; i++) + for (i = s = 0; i < 64; i++) { int y; y = sat[i] + 1; @@ -99,6 +99,10 @@ static void draw_sprites(int scanline) break; if (y + h <= scanline || scanline < y) continue; // not on this line + if (s >= 8) { + pv->status |= SR_SOVR; + break; + } sprites_x[s] = xoff + sat[0x80 + i*2]; sprites_addr[s] = sprite_base + ((sat[0x80 + i*2 + 1] & addr_mask) << (5-1)) + @@ -106,6 +110,10 @@ static void draw_sprites(int scanline) s++; } + // really half-assed but better than nothing + if (s > 1) + pv->status |= SR_C; + // now draw all sprites backwards for (--s; s >= 0; s--) TileNormM4(sprites_x[s], sprites_addr[s], 0x10); @@ -300,3 +308,4 @@ void PicoDrawSetOutputMode4(pdso_t which) } } +// vim:shiftwidth=2:ts=2:expandtab