int win=0, edge=0, hvwind=0, lflags;\r
int maxw, maxcells;\r
\r
- est->rendstatus &= ~(PDRAW_SPRITES_MOVED|PDRAW_DIRTY_SPRITES);\r
est->rendstatus &= ~(PDRAW_SHHI_DONE|PDRAW_PLANE_HI_PRIO);\r
\r
if (pvid->reg[12]&1) {\r
{\r
int offs = 8, lines = 224;\r
int dirty = ((Pico.est.rendstatus & PDRAW_SONIC_MODE) || Pico.m.dirtyPal);\r
+ int sprep = Pico.est.rendstatus & (PDRAW_SPRITES_MOVED|PDRAW_DIRTY_SPRITES);\r
\r
// prepare to do this frame\r
Pico.est.rendstatus = 0;\r
lines, (Pico.video.reg[12] & 1) ? 0 : 1);\r
rendstatus_old = Pico.est.rendstatus;\r
}\r
+ if (sprep)\r
+ Pico.est.rendstatus |= PDRAW_PARSE_SPRITES;\r
\r
Pico.est.HighCol = HighColBase + offs * HighColIncrement;\r
Pico.est.DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;\r
\r
void PicoDrawSync(int to, int blank_last_line)\r
{\r
+ struct PicoEState *est = &Pico.est;\r
int line, offs = 0;\r
int sh = (Pico.video.reg[0xC] & 8) >> 3; // shadow/hilight?\r
int bgc = Pico.video.reg[7];\r
if (to > 223)\r
to = 223;\r
}\r
- if (Pico.est.DrawScanline <= to - blank_last_line)\r
+ if (est->DrawScanline <= to - blank_last_line && (est->rendstatus &\r
+ (PDRAW_SPRITES_MOVED|PDRAW_DIRTY_SPRITES|PDRAW_PARSE_SPRITES)))\r
PrepareSprites(to - blank_last_line + 1);\r
\r
- for (line = Pico.est.DrawScanline; line < to; line++)\r
+ for (line = est->DrawScanline; line < to; line++)\r
PicoLine(line, offs, sh, bgc);\r
\r
// last line\r
else PicoLine(line, offs, sh, bgc);\r
line++;\r
}\r
- Pico.est.DrawScanline = line;\r
+ est->DrawScanline = line;\r
\r
pprof_end(draw);\r
}\r
\r
.equ PDRAW_SPRITES_MOVED, (1<<0)\r
.equ PDRAW_WND_DIFF_PRIO, (1<<1)\r
-.equ PDRAW_ACC_SPRITES, (1<<2)\r
+.equ PDRAW_PARSE_SPRITES, (1<<2)\r
.equ PDRAW_DIRTY_SPRITES, (1<<4)\r
.equ PDRAW_PLANE_HI_PRIO, (1<<6)\r
.equ PDRAW_SHHI_DONE, (1<<7)\r
#endif\r
void PicoDoHighPal555(int sh, int line, struct PicoEState *est);\r
// internals\r
-#define PDRAW_SPRITES_MOVED (1<<0) // (asm)\r
+#define PDRAW_SPRITES_MOVED (1<<0) // SAT address modified\r
#define PDRAW_WND_DIFF_PRIO (1<<1) // not all window tiles use same priority\r
+#define PDRAW_PARSE_SPRITES (1<<2) // SAT needs parsing\r
#define PDRAW_INTERLACE (1<<3)\r
-#define PDRAW_DIRTY_SPRITES (1<<4) // (asm)\r
+#define PDRAW_DIRTY_SPRITES (1<<4) // SAT modified\r
#define PDRAW_SONIC_MODE (1<<5) // mid-frame palette changes for 8bit renderer\r
#define PDRAW_PLANE_HI_PRIO (1<<6) // have layer with all hi prio tiles (mk3)\r
#define PDRAW_SHHI_DONE (1<<7) // layer sh/hi already processed\r