}
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;
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)) +
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);
}
}
+// vim:shiftwidth=2:ts=2:expandtab
static unsigned char vdp_ctl_read(void)
{
- unsigned char d = Pico.video.pending_ints << 7;
- Pico.video.pending = 0;
- Pico.video.pending_ints = 0;
+ struct PicoVideo *pv = &Pico.video;
+ unsigned char d;
+
+ d = pv->status | (pv->pending_ints << 7);
+ pv->pending = pv->pending_ints = 0;
+ pv->status = 0;
elprintf(EL_SR, "VDP sr: %02x", d);
return d;