static int HighCacheB[41+1];\r
int HighPreSpr[80*2+1]; // slightly preprocessed sprites\r
\r
-#define MAX_LINE_SPRITES 30\r
-unsigned char HighLnSpr[240][2 + MAX_LINE_SPRITES]; // sprite_count, tile_count, [spritep]...\r
+#define MAX_LINE_SPRITES 29\r
+#define SPRL_HAVE_HI 0x80 // have hi priority sprites\r
+#define SPRL_HAVE_LO 0x40 // *lo*\r
+#define SPRL_MAY_HAVE_OP 0x20 // may have operator sprites on the line\r
+#define SPRL_LO_ABOVE_HI 0x10 // low priority sprites may be on top of hi\r
+unsigned char HighLnSpr[240][3 + MAX_LINE_SPRITES]; // sprite_count, ^flags, tile_count, [spritep]...\r
\r
int rendstatus = 0;\r
int DrawScanline = 0;\r
+int PicoDrawMask = -1;\r
\r
static int skip_next_line=0;\r
\r
//unsigned short ppt[] = { 0x0f11, 0x0ff1, 0x01f1, 0x011f, 0x01ff, 0x0f1f, 0x0f0e, 0x0e7c };\r
\r
-static void (*DrawAllSpritesLoPri)(int prio, int sh) = NULL;\r
-static void (*DrawAllSpritesHiPri)(int prio, int sh) = NULL;\r
-\r
struct TileStrip\r
{\r
int nametab; // Position in VRAM of name table (for this tile line)\r
void BackFill(int reg7, int sh);\r
void DrawAllSprites(int prio, int sh);\r
void DrawTilesFromCache(int *hc, int sh, int rlim);\r
-void DrawSpritesSHi(int prio, int sh);\r
+void DrawSpritesSHi(unsigned short *sprited);\r
void DrawLayer(int plane_sh, int *hcache, int cellskip, int maxcells);\r
void FinalizeLineBGR444(int sh);\r
void FinalizeLineRGB555(int sh);\r
#ifndef _ASM_DRAW_C\r
// Index + 0 : hhhhvvvv ----hhvv yyyyyyyy yyyyyyyy // v, h: vert./horiz. size\r
// Index + 4 : xxxxxxxx xxxxxxxx pccvhnnn nnnnnnnn // x: x coord + 8\r
-static void DrawSpritesSHi(int prio, int sh)\r
+static void DrawSpritesSHi(unsigned char *sprited)\r
{\r
int (*fTileFunc)(int sx,int addr,int pal);\r
unsigned char *p;\r
int cnt;\r
\r
- cnt = HighLnSpr[DrawScanline][0] & 0x7f;\r
+ cnt = sprited[0] & 0x7f;\r
if (cnt == 0) return;\r
\r
- p = &HighLnSpr[DrawScanline][2];\r
+ p = &sprited[3];\r
\r
// Go through sprites backwards:\r
for (cnt--; cnt >= 0; cnt--)\r
code = sprite[1];\r
pal = (code>>9)&0x30;\r
\r
- if (sh && pal == 0x30)\r
+ if (pal == 0x30)\r
{\r
if (code & 0x8000) // hi priority\r
{\r
}\r
#endif\r
\r
-static void DrawSpritesHiAS(int prio, int sh)\r
+static void DrawSpritesHiAS(unsigned char *sprited, int sh)\r
{\r
int (*fTileFunc)(int sx,int addr,int pal);\r
unsigned char *p;\r
int entry, cnt, sh_cnt = 0;\r
\r
- cnt = HighLnSpr[DrawScanline][0] & 0x7f;\r
+ cnt = sprited[0] & 0x7f;\r
if (cnt == 0) return;\r
\r
- p = &HighLnSpr[DrawScanline][2];\r
+ p = &sprited[3];\r
\r
// Go through sprites:\r
for (entry = 0; entry < cnt; entry++)\r
}\r
}\r
\r
- if (!sh) return;\r
+ if (!sh || !(sprited[1]&SPRL_MAY_HAVE_OP)) return;\r
\r
/* nasty 1: remove 'sprite' flags */\r
{\r
}\r
\r
/* nasty 2: sh operator pass */\r
- HighLnSpr[DrawScanline][0] = sh_cnt;\r
- DrawSpritesSHi(1, 1);\r
+ sprited[0] = sh_cnt;\r
+ DrawSpritesSHi(sprited);\r
}\r
\r
\r
void PrepareSprites(int full)\r
{\r
struct PicoVideo *pvid=&Pico.video;\r
- int u,link=0;\r
+ int u,link=0,sh;\r
int table=0;\r
int *pd = HighPreSpr;\r
int max_lines = 224, max_sprites = 80, max_width = 328;\r
max_line_sprites = MAX_LINE_SPRITES;\r
\r
if (pvid->reg[1]&8) max_lines = 240;\r
+ sh = Pico.video.reg[0xC]&8; // shadow/hilight?\r
\r
table=pvid->reg[5]&0x7f;\r
if (pvid->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode\r
if (cnt >= max_line_sprites) continue; // sprite limit?\r
\r
for (i = 0; i < cnt; i++)\r
- if (((HighLnSpr[y][2+i] ^ entry) & 0x7f) == 0) goto found;\r
+ if (((HighLnSpr[y][3+i] ^ entry) & 0x7f) == 0) goto found;\r
\r
// this sprite was previously missing\r
- HighLnSpr[y][2+cnt] = entry;\r
+ HighLnSpr[y][3+cnt] = entry;\r
HighLnSpr[y][0] = cnt + 1;\r
found:;\r
if (entry & 0x80)\r
- rendstatus |= PDRAW_HAVE_HI_SPR;\r
- else rendstatus |= PDRAW_HAVE_LO_SPR;\r
+ HighLnSpr[y][1] |= SPRL_HAVE_HI;\r
+ else HighLnSpr[y][1] |= SPRL_HAVE_LO;\r
}\r
}\r
\r
}\r
else\r
{\r
+ int old_prio = 0x8000, lo_above_hi = 0;\r
+\r
for (u = 0; u < max_lines; u++)\r
*((int *)&HighLnSpr[u][0]) = 0;\r
\r
{\r
unsigned int *sprite;\r
int code, code2, sx, sy, hv, height, width;\r
- int sx_min;\r
\r
sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
\r
code2 = sprite[1];\r
sx = (code2>>16)&0x1ff;\r
sx -= 0x78; // Get X coordinate + 8\r
- sx_min = 8-(width<<3);\r
\r
if (sy < max_lines && sy + (height<<3) > DrawScanline) // sprite onscreen (y)?\r
{\r
- int y = (sy >= DrawScanline) ? sy : DrawScanline;\r
- int entry = ((pd - HighPreSpr) / 2) | ((code2>>8)&0x80);\r
+ int entry, y, sx_min, onscr_x, maybe_op = 0;\r
+\r
+ sx_min = 8-(width<<3);\r
+ onscr_x = sx_min < sx && sx < max_width;\r
+ if (sh && (code2 & 0x6000) == 0x6000)\r
+ maybe_op = SPRL_MAY_HAVE_OP;\r
+\r
+ if (onscr_x && !old_prio && (code2 & 0x8000))\r
+ lo_above_hi = SPRL_LO_ABOVE_HI;\r
+ old_prio = code2 & 0x8000;\r
+\r
+ entry = ((pd - HighPreSpr) / 2) | ((code2>>8)&0x80);\r
+ y = (sy >= DrawScanline) ? sy : DrawScanline;\r
for (; y < sy + (height<<3) && y < max_lines; y++)\r
{\r
int cnt = HighLnSpr[y][0];\r
if (cnt >= max_line_sprites) continue; // sprite limit?\r
\r
- if (HighLnSpr[y][1] >= max_line_sprites*2) { // tile limit?\r
+ if (HighLnSpr[y][2] >= max_line_sprites*2) { // tile limit?\r
HighLnSpr[y][0] |= 0x80;\r
continue;\r
}\r
- HighLnSpr[y][1] += width;\r
+ HighLnSpr[y][2] += width;\r
\r
if (sx == -0x78) {\r
if (cnt > 0)\r
continue;\r
}\r
// must keep the first sprite even if it's offscreen, for masking\r
- if (cnt > 0 && (sx <= sx_min || sx >= max_width)) continue; // offscreen x\r
+ if (cnt > 0 && !onscr_x) continue; // offscreen x\r
\r
- HighLnSpr[y][2+cnt] = entry;\r
+ HighLnSpr[y][3+cnt] = entry;\r
HighLnSpr[y][0] = cnt + 1;\r
if (entry & 0x80)\r
- rendstatus |= PDRAW_HAVE_HI_SPR;\r
- else rendstatus |= PDRAW_HAVE_LO_SPR;\r
+ HighLnSpr[y][1] |= SPRL_HAVE_HI;\r
+ else HighLnSpr[y][1] |= SPRL_HAVE_LO;\r
+ HighLnSpr[y][1] |= maybe_op|lo_above_hi; // there might be op sprites or priority mess on this line\r
}\r
}\r
\r
for (u = 0; u < max_lines; u++)\r
{\r
int y;\r
- printf("c%03i: %2i, %2i: ", u, HighLnSpr[u][0] & 0x7f, HighLnSpr[u][1]);\r
+ printf("c%03i: %2i, %2i: ", u, HighLnSpr[u][0] & 0x7f, HighLnSpr[u][2]);\r
for (y = 0; y < HighLnSpr[u][0] & 0x7f; y++)\r
- printf(" %i", HighLnSpr[u][y+2]);\r
+ printf(" %i", HighLnSpr[u][y+3]);\r
printf("\n");\r
}\r
#endif\r
}\r
\r
#ifndef _ASM_DRAW_C\r
-static void DrawAllSprites(int prio, int sh)\r
+static void DrawAllSprites(unsigned char *sprited, int prio, int sh)\r
{\r
- int rs = rendstatus, scan = DrawScanline;\r
+ int rs = rendstatus;\r
unsigned char *p;\r
int cnt;\r
\r
rendstatus = rs & ~(PDRAW_SPRITES_MOVED|PDRAW_DIRTY_SPRITES);\r
}\r
\r
- cnt = HighLnSpr[scan][0] & 0x7f;\r
+ cnt = sprited[0] & 0x7f;\r
if (cnt == 0) return;\r
\r
- p = &HighLnSpr[scan][2];\r
+ p = &sprited[3];\r
\r
// Go through sprites backwards:\r
for (cnt--; cnt >= 0; cnt--)\r
\r
static int DrawDisplay(int sh, int as)\r
{\r
+ unsigned char *sprited = &HighLnSpr[DrawScanline][0];\r
struct PicoVideo *pvid=&Pico.video;\r
int win=0,edge=0,hvwind=0;\r
- int maxw, maxcells;\r
+ int maxw,maxcells;\r
\r
rendstatus &= ~(PDRAW_SHHI_DONE|PDRAW_PLANE_HI_PRIO);\r
\r
- if(pvid->reg[12]&1) {\r
+ if (pvid->reg[12]&1) {\r
maxw = 328; maxcells = 40;\r
} else {\r
maxw = 264; maxcells = 32;\r
if (win&0x80) { if (DrawScanline>=edge) hvwind=1; }\r
else { if (DrawScanline< edge) hvwind=1; }\r
\r
- if (!hvwind) { // we might have a vertical window here\r
+ if (!hvwind) // we might have a vertical window here\r
+ {\r
win=pvid->reg[0x11];\r
edge=win&0x1f;\r
if (win&0x80) {\r
}\r
}\r
\r
- DrawLayer(1|((sh|as)<<1), HighCacheB, 0, maxcells);\r
- if (hvwind == 1)\r
- DrawWindow(0, maxcells>>1, 0, sh|as);\r
+ /* - layer B low - */\r
+ if (PicoDrawMask & PDRAW_LAYERB_ON)\r
+ DrawLayer(1|(sh<<1), HighCacheB, 0, maxcells);\r
+ /* - layer A low - */\r
+ if (!(PicoDrawMask & PDRAW_LAYERA_ON));\r
+ else if (hvwind == 1)\r
+ DrawWindow(0, maxcells>>1, 0, sh);\r
else if (hvwind == 2) {\r
- // ahh, we have vertical window\r
- DrawLayer(0|((sh|as)<<1), HighCacheA, (win&0x80) ? 0 : edge<<1, (win&0x80) ? edge<<1 : maxcells);\r
- DrawWindow( (win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 0, sh|as);\r
+ DrawLayer(0|(sh<<1), HighCacheA, (win&0x80) ? 0 : edge<<1, (win&0x80) ? edge<<1 : maxcells);\r
+ DrawWindow( (win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 0, sh);\r
} else\r
- DrawLayer(0|((sh|as)<<1), HighCacheA, 0, maxcells);\r
- if (rendstatus & PDRAW_HAVE_LO_SPR)\r
- DrawAllSpritesLoPri(0, sh);\r
-\r
- if (HighCacheB[0]) DrawTilesFromCache(HighCacheB, sh, maxw);\r
- if (hvwind == 1)\r
+ DrawLayer(0|(sh<<1), HighCacheA, 0, maxcells);\r
+ /* - sprites low - */\r
+ if (!(PicoDrawMask & PDRAW_SPRITES_LOW_ON));\r
+ else if (rendstatus & PDRAW_INTERLACE)\r
+ DrawAllSpritesInterlace(0, sh);\r
+ else if (sprited[1] & SPRL_HAVE_LO)\r
+ DrawAllSprites(sprited, 0, sh);\r
+\r
+ /* - layer B hi - */\r
+ if ((PicoDrawMask & PDRAW_LAYERB_ON) && HighCacheB[0])\r
+ DrawTilesFromCache(HighCacheB, sh, maxw);\r
+ /* - layer A hi - */\r
+ if (!(PicoDrawMask & PDRAW_LAYERA_ON));\r
+ else if (hvwind == 1)\r
DrawWindow(0, maxcells>>1, 1, sh);\r
else if (hvwind == 2) {\r
- if(HighCacheA[0]) DrawTilesFromCache(HighCacheA, sh, (win&0x80) ? edge<<4 : maxw);\r
+ if (HighCacheA[0]) DrawTilesFromCache(HighCacheA, sh, (win&0x80) ? edge<<4 : maxw);\r
DrawWindow((win&0x80) ? edge : 0, (win&0x80) ? maxcells>>1 : edge, 1, sh);\r
} else\r
if (HighCacheA[0]) DrawTilesFromCache(HighCacheA, sh, maxw);\r
- if ((rendstatus & PDRAW_HAVE_HI_SPR) || sh)\r
- DrawAllSpritesHiPri(1, sh);\r
+ /* - sprites hi - */\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 (as && (sprited[1] & 0xd0) == 0xd0)\r
+ DrawSpritesHiAS(sprited, sh);\r
+ else if (sh && (sprited[1] & SPRL_MAY_HAVE_OP))\r
+ DrawSpritesSHi(sprited);\r
+ else if (sprited[1] & SPRL_HAVE_HI)\r
+ DrawAllSprites(sprited, 1, 0);\r
\r
#if 0\r
{\r
PICO_INTERNAL void PicoFrameStart(void)\r
{\r
// prepare to do this frame\r
- int sh = Pico.video.reg[0xC] & 8; // shadow/hilight?\r
rendstatus = 0;\r
if (PicoOpt & POPT_ACC_SPRITES)\r
rendstatus |= PDRAW_ACC_SPRITES;\r
-\r
- if (sh)\r
- {\r
- DrawAllSpritesLoPri = DrawAllSprites;\r
- DrawAllSpritesHiPri = DrawSpritesSHi;\r
- }\r
- else\r
- {\r
- DrawAllSpritesLoPri =\r
- DrawAllSpritesHiPri = DrawAllSprites;\r
- }\r
- if (rendstatus & PDRAW_ACC_SPRITES)\r
- DrawAllSpritesHiPri = DrawSpritesHiAS;\r
- if ((Pico.video.reg[12]&6) == 6) {\r
+ if ((Pico.video.reg[12]&6) == 6)\r
rendstatus |= PDRAW_INTERLACE; // interlace mode\r
- DrawAllSpritesLoPri =\r
- DrawAllSpritesHiPri = DrawAllSpritesInterlace;\r
- }\r
\r
if (Pico.m.dirtyPal) Pico.m.dirtyPal = 2; // reset dirty if needed\r
\r
#endif\r
}\r
\r
+/* debug and fun */\r
+static void set16(unsigned short *p, unsigned short d, int cnt)\r
+{\r
+ while (cnt-- > 0)\r
+ *p++ = d;\r
+}\r
+\r
+void PicoDrawShowSpriteStats(unsigned short *screen)\r
+{\r
+ int lines, i, u, step;\r
+ unsigned short *dest;\r
+ unsigned char *p;\r
+\r
+ memset(screen, 0, 320*240*2);\r
+ step = (320-4*4-1) / MAX_LINE_SPRITES;\r
+ lines = 240;\r
+ if (!Pico.m.pal || !(Pico.video.reg[1]&8))\r
+ lines = 224, screen += 320*8;\r
+\r
+ for (i = 0; i < lines; i++)\r
+ {\r
+ dest = screen + 320*i;\r
+ p = &HighLnSpr[i][0];\r
+\r
+ // sprite graphs\r
+ for (u = 0; u < (p[0] & 0x7f); u++) {\r
+ set16(dest, (p[3+u] & 0x80) ? 0xe700 : 0x0700, step);\r
+ dest += step;\r
+ }\r
+\r
+ // flags\r
+ dest = screen + 320*i + 320-4*4;\r
+ if (p[1] & SPRL_HAVE_LO) set16(dest+4*0, 0x0700, 4);\r
+ if (p[1] & SPRL_HAVE_HI) set16(dest+4*1, 0xe700, 4);\r
+ if (p[1] & SPRL_MAY_HAVE_OP) set16(dest+4*2, 0x001e, 4);\r
+ if (p[1] & SPRL_LO_ABOVE_HI) set16(dest+4*3, 0xf000, 4);\r
+ }\r
+\r
+ // draw grid\r
+ for (i = step*5; i <= 320-4*4-1; i += step*5) {\r
+ for (u = 0; u < lines; u++)\r
+ screen[i + u*320] = 0x182;\r
+ }\r
+}\r
+\r
+void PicoDrawShowPalette(unsigned short *screen)\r
+{\r
+ unsigned int *spal=(void *)Pico.cram;\r
+ unsigned int *dpal=(void *)HighPal;\r
+ int x, y, i;\r
+\r
+ memset(screen, 0, 320*240*2);\r
+\r
+ for (i = 0x3f/2; i >= 0; i--)\r
+#ifdef USE_BGR555\r
+ dpal[i] = ((spal[i]&0x000f000f)<< 1)|((spal[i]&0x00f000f0)<<3)|((spal[i]&0x0f000f00)<<4);\r
+#else\r
+ dpal[i] = ((spal[i]&0x000f000f)<<12)|((spal[i]&0x00f000f0)<<3)|((spal[i]&0x0f000f00)>>7);\r
+#endif\r
+ for (i = 0x3f; i >= 0; i--)\r
+ HighPal[0x40|i] = (unsigned short)((HighPal[i]>>1)&0x738e);\r
+ for (i = 0x3f; i >= 0; i--) {\r
+ int t=HighPal[i]&0xe71c;t+=0x4208;if(t&0x20)t|=0x1c;if(t&0x800)t|=0x700;if(t&0x10000)t|=0xe000;t&=0xe71c;\r
+ HighPal[0x80|i]=(unsigned short)t;\r
+ }\r
+\r
+ screen += 16*320+8;\r
+ for (y = 0; y < 8*4; y++)\r
+ for (x = 0; x < 8*16; x++)\r
+ screen[x + y*320] = HighPal[x/8 + (y/8)*16];\r
+\r
+ screen += 160;\r
+ for (y = 0; y < 8*4; y++)\r
+ for (x = 0; x < 8*16; x++)\r
+ screen[x + y*320] = HighPal[(x/8 + (y/8)*16) | 0x40];\r
+\r
+ screen += 320*48;\r
+ for (y = 0; y < 8*4; y++)\r
+ for (x = 0; x < 8*16; x++)\r
+ screen[x + y*320] = HighPal[(x/8 + (y/8)*16) | 0x80];\r
+\r
+ Pico.m.dirtyPal = 1;\r
+}\r
+\r
.equ PDRAW_DIRTY_SPRITES, (1<<4)\r
.equ PDRAW_PLANE_HI_PRIO, (1<<6)\r
.equ PDRAW_SHHI_DONE, (1<<7)\r
-.equ MAX_LINE_SPRITES, 30\r
\r
@ helper\r
.macro TilePixel pat lsrr offs\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
\r
\r
-.global DrawSpritesSHi @ int prio_unused, int sh\r
+.global DrawSpritesSHi @ unsigned char *sprited\r
\r
DrawSpritesSHi:\r
- ldr r3, =DrawScanline\r
- ldr r2, =HighLnSpr\r
- ldr r12,[r3]\r
- mov r3, #(MAX_LINE_SPRITES+2)\r
- mla r2, r12, r3, r2\r
- ldr r3, [r2]\r
+ ldr r3, [r0]\r
+ mov r12,#0xff\r
ands r3, r3, #0x7f\r
bxeq lr\r
\r
stmfd sp!, {r4-r11,lr}\r
- mov r12,#0xff\r
- strb r12,[r2,#1] @ set end marker\r
- add r10,r2, #2\r
+ strb r12,[r0,#2] @ set end marker\r
+ add r10,r0, #3 @ r10=HighLnSpr end\r
add r10,r10,r3 @ r10=HighLnSpr end\r
\r
- str r1, [sp, #-4] @ no calls after this point\r
-\r
.if OVERRIDE_HIGHCOL\r
ldr r11,=HighCol\r
mov r12,#0xf\r
@ draw next sprite\r
ldrb r0, [r10,#-1]!\r
ldr r1, =HighPreSpr\r
- ldr r8, [sp, #-4]\r
+@ ldr r8, [sp, #-4]\r
cmp r0, #0xff\r
ldmeqfd sp!, {r4-r11,pc} @ end of list\r
and r0, r0, #0x7f\r
mov r9, r9, lsl #16\r
mov r3, r9, lsr #31 @ priority\r
mov r9, r9, lsr #16\r
- orr r9, r9, r8, lsl #31 @ r9=code|sh[31]\r
+@ orr r9, r9, r8, lsl #31 @ r9=code|sh[31] @@ sh is always on here now\r
and r4, r9, #0x6000\r
orr r9, r9, r4, lsl #16\r
- orr r9, r9, #0x10000000 @ r9=scc1 ???? ... <code> (s=shadow/hilight, cc=pal)\r
+ orr r9, r9, #0x90000000 @ r9=scc1 ???? ... <code> (s=shadow/hilight, cc=pal)\r
cmp r12,r9, lsr #28 @ sh/hi with pal3?\r
- cmpne r3, #1 @ if not, is hi prio\r
+ cmpne r3, #1 @ if not, is ir hi prio?\r
bne DrawSpriteSHi @ non-operator low sprite, already drawn\r
\r
ldr r3, [r0] @ sprite[0]\r
add r8, r8, r7, lsl #1 @ tile+=(row&7)<<1; // Tile address\r
\r
mov r5, r5, lsl #4 @ delta<<=4; // Delta of address\r
-\r
- orrs r3, r9, r9, lsl #4\r
mov r3, r4, lsr #9 @ r3=pal=((code>>9)&0x30);\r
\r
add r6, r6, #1 @ inc now\r
\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
\r
-.global DrawAllSprites @ int prio, int sh\r
+.global DrawAllSprites @ unsigned char *sprited, int prio, int sh\r
\r
DrawAllSprites:\r
ldr r3, =rendstatus\r
- orr r1, r1, r0, lsl #1\r
+ orr r1, r2, r1, lsl #1\r
ldr r12,[r3]\r
tst r12,#(PDRAW_ACC_SPRITES|PDRAW_SPRITES_MOVED)\r
beq das_no_prep\r
- stmfd sp!, {r1,lr}\r
+ stmfd sp!, {r0,r1,lr}\r
and r0, r12,#PDRAW_DIRTY_SPRITES\r
bic r12,r12,#(PDRAW_ACC_SPRITES|PDRAW_SPRITES_MOVED)\r
str r12,[r3]\r
bl PrepareSprites\r
- ldmfd sp!, {r1,lr}\r
+ ldmfd sp!, {r0,r1,lr}\r
\r
das_no_prep:\r
- ldr r3, =DrawScanline\r
- ldr r2, =HighLnSpr\r
- ldr r12,[r3]\r
- mov r3, #(MAX_LINE_SPRITES+2)\r
- mla r2, r12, r3, r2\r
- ldr r3, [r2]\r
+ ldr r3, [r0]\r
ands r3, r3, #0x7f\r
bxeq lr\r
\r
@ time to do some real work\r
stmfd sp!, {r4-r11,lr}\r
mov r12,#0xff\r
- strb r12,[r2,#1] @ set end marker\r
- add r10,r2, #2\r
+ strb r12,[r0,#2] @ set end marker\r
+ add r10,r0, #3\r
add r10,r10,r3 @ r10=HighLnSpr end\r
\r
str r1, [sp, #-4] @ no calls after this point\r