* "sonic mode" is autodetected, shadow/hilight is enabled by emulated game.\r
* AS is enabled by user and takes priority over "sonic mode".\r
*\r
+ * since renderer always draws line in 8bit mode, there are 2 spare bits:\r
+ * b \ mode: s/h as sonic\r
+ * 00 normal - -\r
+ * 01 shadow - pal index\r
+ * 10 hilight+op spr spr pal index\r
+ * 11 shadow +op spr - pal index\r
+ *\r
* not handled properly:\r
* - hilight op on shadow tile\r
* - AS + s/h (s/h sprite flag interferes with and cleared by AS code)\r
\r
if (prio) {\r
int *zb = (int *)(HighCol+8+(tilex<<3));\r
- *zb++ &= 0x3f3f3f3f;\r
- *zb &= 0x3f3f3f3f;\r
+ *zb++ &= 0xbfbfbfbf;\r
+ *zb &= 0xbfbfbfbf;\r
} else {\r
pal |= 0x40;\r
}\r
\r
/* nasty 1: remove 'sprite' flags */\r
{\r
- int c = 320/4, *zb = (int *)(HighCol+8);\r
+ int c = 320/4/4, *zb = (int *)(HighCol+8);\r
while (c--)\r
{\r
- *zb++ &= 0x7f7f7f7f;\r
+ *zb++ &= 0x7f7f7f7f; *zb++ &= 0x7f7f7f7f;\r
+ *zb++ &= 0x7f7f7f7f; *zb++ &= 0x7f7f7f7f;\r
}\r
}\r
\r
.endif\r
ldreqb r4, [r1,#\offs]\r
orrne r4, r3, r4\r
- andeq r4, r4, #0x3f\r
+ andeq r4, r4, #0xbf\r
strb r4, [r1,#\offs]\r
.endm\r
\r
.endif\r
beq 0f\r
cmp r4, #0xe\r
- ldrgeb r4, [r1,#\ofs]\r
- orrlt r4, r3, r4 @ normal\r
-\r
- biceq r4, r4, #0xc0 @ hilight\r
- orreq r4, r4, #0x80\r
- orrgt r4, r4, #0xc0 @ shadow\r
+ ldrgeb r7, [r1,#\ofs]\r
+ orrlt r7, r3, r4 @ normal\r
\r
- strb r4, [r1,#\ofs]\r
+ bicge r7, r7, #0xc0\r
+ orrge r7, r7, r4, lsl #6\r
+ strb r7, [r1,#\ofs]\r
0:\r
.endm\r
\r
TileDoShGenPixel 16, 7 @ #0x000f0000\r
.endm\r
\r
-.macro TileDoShGenPixel_noop shift ofs\r
+.macro TileDoShGenPixel_markop shift ofs\r
.if \shift\r
- and r4, r12, r2, lsr #\shift\r
+ ands r4, r12, r2, lsr #\shift\r
.else\r
- and r4, r12, r2\r
+ ands r4, r12, r2\r
.endif\r
- sub r7, r4, #1\r
- cmp r7, #0xd\r
- orrcc r4, r3, r4 @ 0-0xc (was 1-0xd)\r
- strccb r4, [r1,#\ofs]\r
+ beq 0f\r
+ cmp r4, #0xe\r
+ ldrgeb r4, [r1,#\ofs]\r
+ orrlt r4, r3, r4\r
+ orrge r4, r3, 0x80\r
+ strb r4, [r1,#\ofs]\r
+0:\r
.endm\r
\r
.macro TileFlipSh_noop\r
- TileDoShGenPixel_noop 16, 0 @ #0x000f0000\r
- TileDoShGenPixel_noop 20, 1 @ #0x00f00000\r
- TileDoShGenPixel_noop 24, 2 @ #0x0f000000\r
- TileDoShGenPixel_noop 28, 3 @ #0xf0000000\r
- TileDoShGenPixel_noop 0, 4 @ #0x0000000f\r
- TileDoShGenPixel_noop 4, 5 @ #0x000000f0\r
- TileDoShGenPixel_noop 8, 6 @ #0x00000f00\r
- TileDoShGenPixel_noop 12, 7 @ #0x0000f000\r
+ TileDoShGenPixel_markop 16, 0 @ #0x000f0000\r
+ TileDoShGenPixel_markop 20, 1 @ #0x00f00000\r
+ TileDoShGenPixel_markop 24, 2 @ #0x0f000000\r
+ TileDoShGenPixel_markop 28, 3 @ #0xf0000000\r
+ TileDoShGenPixel_markop 0, 4 @ #0x0000000f\r
+ TileDoShGenPixel_markop 4, 5 @ #0x000000f0\r
+ TileDoShGenPixel_markop 8, 6 @ #0x00000f00\r
+ TileDoShGenPixel_markop 12, 7 @ #0x0000f000\r
.endm\r
\r
.macro TileNormSh_noop\r
- TileDoShGenPixel_noop 12, 0 @ #0x0000f000\r
- TileDoShGenPixel_noop 8, 1 @ #0x00000f00\r
- TileDoShGenPixel_noop 4, 2 @ #0x000000f0\r
- TileDoShGenPixel_noop 0, 3 @ #0x0000000f\r
- TileDoShGenPixel_noop 28, 4 @ #0xf0000000\r
- TileDoShGenPixel_noop 24, 5 @ #0x0f000000\r
- TileDoShGenPixel_noop 20, 6 @ #0x00f00000\r
- TileDoShGenPixel_noop 16, 7 @ #0x000f0000\r
+ TileDoShGenPixel_markop 12, 0 @ #0x0000f000\r
+ TileDoShGenPixel_markop 8, 1 @ #0x00000f00\r
+ TileDoShGenPixel_markop 4, 2 @ #0x000000f0\r
+ TileDoShGenPixel_markop 0, 3 @ #0x0000000f\r
+ TileDoShGenPixel_markop 28, 4 @ #0xf0000000\r
+ TileDoShGenPixel_markop 24, 5 @ #0x0f000000\r
+ TileDoShGenPixel_markop 20, 6 @ #0x00f00000\r
+ TileDoShGenPixel_markop 16, 7 @ #0x000f0000\r
.endm\r
\r
.macro TileDoShGenPixel_onlyop_lp shift ofs\r
ands r7, r12, r2\r
.endif\r
ldrneb r4, [r1,#\ofs]\r
- tstne r4, #0x40\r
- beq 0f\r
-\r
cmp r7, #0xe\r
- biceq r4, r4, #0xc0 @ hilight\r
- orreq r4, r4, #0x80\r
- orrgt r4, r4, #0xc0 @ shadow\r
- strgeb r4, [r1,#\ofs]\r
+ blt 0f\r
+\r
+ tst r4, #0xc0\r
+ bicne r4, r4, #0xc0\r
+ orrne r4, r4, r7, lsl #6\r
+ strneb r4, [r1,#\ofs]\r
0:\r
.endm\r
\r
.dtfc_shadow_blank:\r
tst r1, #1\r
ldrneb r4, [r1]\r
- mov r6, #0x3f\r
- and r4, r4, #0x3f\r
+ mov r6, #0xbf\r
+ and r4, r4, #0xbf\r
strneb r4, [r1], #1\r
ldrh r4, [r1]\r
orr r6, r6, r6, lsl #8\r
\r
add r1, r11,#8\r
mov r3, #320/4/4\r
- mov r6, #0x3f\r
+ mov r6, #0xbf\r
orr r6, r6, r6, lsl #8\r
orr r6, r6, r6, lsl #16\r
.dtfc_loop_shprep:\r