void PicoDrawSync(int to, int off, int on)\r
{\r
struct PicoEState *est = &Pico.est;\r
- int line, offs = 0;\r
+ int line, offs;\r
int sh = (est->Pico->video.reg[0xC] & 8) >> 3; // shadow/hilight?\r
int bgc = est->Pico->video.reg[7] & 0x3f;\r
\r
pprof_start(draw);\r
\r
- if (rendlines != 240) {\r
- offs = 8;\r
- if (to > 223)\r
- to = 223;\r
- }\r
+ offs = (240-rendlines) >> 1;\r
+ if (to >= rendlines)\r
+ to = rendlines-1;\r
+\r
if (est->DrawScanline <= to &&\r
(est->rendstatus & (PDRAW_DIRTY_SPRITES|PDRAW_PARSE_SPRITES)))\r
ParseSprites(to + 1, on);\r
// reset slot to start of scanline\r
vf->fifo_slot = 0;\r
// only need to refresh sprite position if we are synced\r
- if (Pico.est.DrawScanline == Pico.m.scanline)\r
+ if (Pico.est.DrawScanline == Pico.m.scanline && !(pv->status & SR_VB))\r
PicoDrawRefreshSprites();\r
\r
// if CPU is waiting for the bus, advance CPU and FIFO until bus is free\r