\r
#ifndef _ASM_DRAW_C\r
\r
+// draw low prio sprite non-s/h pixels in s/h mode\r
+#define pix_nonsh(x) \\r
+ if (t == 0xe) pd[x]=(pal|t)&~0x80; /* disable shadow for color 14 (hw bug?) */ \\r
+ else if (t) pd[x]=pal|t\r
+\r
+TileNormMaker(TileNormNonSH, pix_nonsh)\r
+TileFlipMaker(TileFlipNonSH, pix_nonsh)\r
+\r
// draw sprite pixels, process operator colors\r
#define pix_sh(x) \\r
if (t) { \\r
if (sh && (code&0x6000) == 0x6000) {\r
if(code&0x0800) fTileFunc=TileFlipSH_markop;\r
else fTileFunc=TileNormSH_markop;\r
+ } else if (sh) {\r
+ if(code&0x0800) fTileFunc=TileFlipNonSH;\r
+ else fTileFunc=TileNormNonSH;\r
} else {\r
if(code&0x0800) fTileFunc=TileFlip;\r
else fTileFunc=TileNorm;\r
// otherwise intensity difference between this and s/h will be wrong\r
t = PXCONV(t);\r
t |= (t >> 4) & PXMASKL;\r
- dpal[i] = dpal[0xc0/2 + i] = t;\r
+ dpal[i] = t;\r
}\r
\r
// norm: xxx0, sh: 0xxx, hi: 0xxx + 7\r
if (sh)\r
{\r
// shadowed pixels\r
- for (i = 0; i < 0x40 / 2; i++)\r
+ for (i = 0; i < 0x40 / 2; i++) {\r
+ dpal[0xc0/2 + i] = dpal[i];\r
dpal[0x80/2 + i] = (dpal[i] >> 1) & PXMASKH;\r
+ }\r
// hilighted pixels\r
for (i = 0; i < 0x40 / 2; i++) {\r
t = ((dpal[i] >> 1) & PXMASKH) + PXMASKH;\r
t |= (t >> 4) & PXMASKL;\r
dpal[0x40/2 + i] = t;\r
}\r
- // shadowed pixels in color 14 always appear normal (hw bug?)\r
- unsigned short *hpal = est->HighPal;\r
- hpal[0x80 + 0x0e] = hpal[0x0e];\r
- hpal[0x80 + 0x1e] = hpal[0x1e];\r
- hpal[0x80 + 0x2e] = hpal[0x2e];\r
}\r
}\r
\r
t |= (t >> 4) & PXMASKL;\r
dpal[0x40/2 + i] = t;\r
}\r
- // shadowed pixels in color 14 always appear normal (hw bug?)\r
- unsigned short *hpal = est->HighPal;\r
- hpal[0x80 + 0x0e] = hpal[0x0e];\r
- hpal[0x80 + 0x1e] = hpal[0x1e];\r
- hpal[0x80 + 0x2e] = hpal[0x2e];\r
}\r
}\r
\r
\r
@ shadow/hilight mode\r
\r
+@ \r
+.macro TilePixelNonSH pat lsrr offs\r
+.if !\lsrr\r
+ ands r4, \pat, r2\r
+.else\r
+ ands r4, \pat, r2, lsr #\lsrr\r
+.endif\r
+ beq 0f\r
+ cmp r4, #0xe\r
+ orr r4, r3, r4\r
+ biceq r4, #0x80\r
+ strb r4, [r1,#\offs]\r
+0:\r
+.endm\r
+\r
+@ TileNormNonSH (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
+.macro TileNormNonSH pat\r
+ TilePixelNonSH \pat, 12, 0 @ #0x0000f000\r
+ TilePixelNonSH \pat, 8, 1 @ #0x00000f00\r
+ TilePixelNonSH \pat, 4, 2 @ #0x000000f0\r
+ TilePixelNonSH \pat, 0, 3 @ #0x0000000f\r
+ TilePixelNonSH \pat, 28, 4 @ #0xf0000000\r
+ TilePixelNonSH \pat, 24, 5 @ #0x0f000000\r
+ TilePixelNonSH \pat, 20, 6 @ #0x00f00000\r
+ TilePixelNonSH \pat, 16, 7 @ #0x000f0000\r
+.endm\r
+\r
+@ TileFlipNonSH (r1=pdest, r2=pixels8, r3=pal) r4: scratch, pat: register with helper pattern 0xf\r
+.macro TileFlipNonSH pat\r
+ TilePixelNonSH \pat, 16, 0 @ #0x000f0000\r
+ TilePixelNonSH \pat, 20, 1 @ #0x00f00000\r
+ TilePixelNonSH \pat, 24, 2 @ #0x0f000000\r
+ TilePixelNonSH \pat, 28, 3 @ #0xf0000000\r
+ TilePixelNonSH \pat, 0, 4 @ #0x0000000f\r
+ TilePixelNonSH \pat, 4, 5 @ #0x000000f0\r
+ TilePixelNonSH \pat, 8, 6 @ #0x00000f00\r
+ TilePixelNonSH \pat, 12, 7 @ #0x0000f000\r
+.endm\r
+\r
@ this one is for hi priority layer\r
.macro TilePixelShHP lsrr offs\r
.if !\lsrr\r
cmp r12, r9, lsr #28\r
beq .dspr_shadow\r
\r
+ tst r9, #0x80000000\r
+ bne .dspr_shnonsh\r
+\r
cmp r2, r2, ror #4\r
beq .dspr_SingleColor @ tileline singlecolor \r
\r
strneb r4, [r1], #1\r
b .dspr_loop\r
\r
+.dspr_shnonsh:\r
+ tst r9, #0x0800\r
+ bne .dspr_TileFlipNonSH\r
+\r
+ @ (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r12: helper pattern\r
+@ scratch: r4, r7\r
+.dspr_TileNormNonSH:\r
+ TileNormNonSH r12\r
+ b .dspr_loop\r
+\r
+.dspr_TileFlipNonSH:\r
+ TileFlipNonSH r12\r
+ b .dspr_loop\r
+\r
.dspr_shadow:\r
cmp r2, r2, ror #4\r
beq .dspr_singlec_sh\r
stmia r4!, {r1,r6}\r
bne .fl_loopcpRGB555_sh\r
\r
- @ fixup shadowed color 14 in palette 0,1,2 (always normal)\r
- sub r4, r3, #0x40*2\r
- ldrh r1, [r4, #0x0e*2] @ 0x0e, 0x1e, 0x2e\r
- ldrh r5, [r4, #0x1e*2]\r
- ldrh r6, [r4, #0x2e*2]\r
- strh r1, [r3, #0x4e*2] @ 0x8e, 0x9e, 0xae\r
- strh r5, [r3, #0x5e*2]\r
- strh r6, [r3, #0x6e*2]\r
-\r
mov r0, #1\r
PicoDoHighPal555_end:\r
ldmfd sp!, {r4-r10,pc}\r