}\r
}\r
}\r
-#endif\r
+#endif // !_ASM_DRAW_C\r
\r
static void DrawSpritesHiAS(unsigned char *sprited, int sh)\r
{\r
cnt = sprited[0] & 0x7f;\r
if (cnt == 0) return;\r
\r
+ rendstatus |= PDRAW_SPR_LO_ON_HI;\r
+\r
p = &sprited[3];\r
\r
// Go through sprites:\r
\r
unsigned short HighPal[0x100];\r
\r
+#ifndef _ASM_DRAW_C\r
void PicoDoHighPal555(int sh)\r
{\r
unsigned short *pal=HighPal;\r
}\r
}\r
\r
-#ifndef _ASM_DRAW_C\r
static void FinalizeLineBGR444(int sh)\r
{\r
unsigned short *pd=DrawLineDest;\r
}\r
}\r
\r
- if (!sh && (rendstatus & PDRAW_ACC_SPRITES))\r
+ if (!sh && (rendstatus & PDRAW_SPR_LO_ON_HI))\r
mask=0x3f; // accurate sprites\r
\r
for(i = 0; i < len; i++)\r
{\r
#ifndef PSP\r
int i, mask=0xff;\r
- if (!sh && (rendstatus & PDRAW_ACC_SPRITES))\r
+ if (!sh && (rendstatus & PDRAW_SPR_LO_ON_HI))\r
mask=0x3f; // accurate sprites, upper bits are priority stuff\r
\r
for (i = 0; i < len; i++)\r
#else\r
extern void amips_clut(unsigned short *dst, unsigned char *src, unsigned short *pal, int count);\r
extern void amips_clut_6bit(unsigned short *dst, unsigned char *src, unsigned short *pal, int count);\r
- if (!sh && (rendstatus & PDRAW_ACC_SPRITES))\r
+ if (!sh && (rendstatus & PDRAW_SPR_LO_ON_HI))\r
amips_clut_6bit(pd, ps, pal, len);\r
else amips_clut(pd, ps, pal, len);\r
#endif\r
int len, rs = rendstatus;\r
static int dirty_count;\r
\r
- if (!sh && !(rs & PDRAW_ACC_SPRITES) && Pico.m.dirtyPal == 1 && DrawScanline < 222)\r
+ if (!sh && Pico.m.dirtyPal == 1 && DrawScanline < 222)\r
{\r
// a hack for mid-frame palette changes\r
if (!(rs & PDRAW_SONIC_MODE))\r
if (!(PicoDrawMask & PDRAW_SPRITES_HI_ON));\r
else if (rendstatus & PDRAW_INTERLACE)\r
DrawAllSpritesInterlace(1, sh);\r
- // AS on and have both lo/hi sprites and lo before hi sprites?\r
- else if ((sprited[1] & 0xd0) == 0xd0 && (rendstatus & PDRAW_ACC_SPRITES))\r
+ // have sprites without layer pri bit ontop of sprites with that bit\r
+ else if ((sprited[1] & 0xd0) == 0xd0 && (PicoOpt & POPT_ACC_SPRITES))\r
DrawSpritesHiAS(sprited, sh);\r
else if (sh && (sprited[1] & SPRL_MAY_HAVE_OP))\r
DrawSpritesSHi(sprited);\r
return 0;\r
}\r
\r
-\r
+// MUST be called every frame\r
PICO_INTERNAL void PicoFrameStart(void)\r
{\r
// prepare to do this frame\r
rendstatus = 0;\r
- if (PicoOpt & POPT_ACC_SPRITES)\r
- rendstatus |= PDRAW_ACC_SPRITES;\r
if ((Pico.video.reg[12]&6) == 6)\r
rendstatus |= PDRAW_INTERLACE; // interlace mode\r
\r
FinalizeLine(sh);\r
\r
if (PicoScanEnd != NULL)\r
- PicoScanEnd(DrawScanline);\r
+ skip_next_line = PicoScanEnd(DrawScanline);\r
}\r
\r
void PicoDrawSync(int to, int blank_last_line)\r
}\r
\r
#if !CAN_HANDLE_240_LINES\r
- if (DrawScanline >= 224) DrawScanline = 240, return;\r
+ if (DrawScanline >= 224) { DrawScanline = 240; return; }\r
#endif\r
\r
// last line\r