+.macro TileDoShGenPixel_noop shift ofs\r
+.if \shift\r
+ and r4, r12, r2, lsr #\shift\r
+.else\r
+ and 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
+.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
+.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
+.endm\r
+\r
+.macro TileDoShGenPixel_onlyop_lp shift ofs\r
+.if \shift\r
+ ands r7, r12, r2, lsr #\shift\r
+.else\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
+0:\r
+.endm\r
+\r
+.macro TileFlipSh_onlyop_lp\r
+ TileDoShGenPixel_onlyop_lp 16, 0 @ #0x000f0000\r
+ TileDoShGenPixel_onlyop_lp 20, 1 @ #0x00f00000\r
+ TileDoShGenPixel_onlyop_lp 24, 2 @ #0x0f000000\r
+ TileDoShGenPixel_onlyop_lp 28, 3 @ #0xf0000000\r
+ TileDoShGenPixel_onlyop_lp 0, 4 @ #0x0000000f\r
+ TileDoShGenPixel_onlyop_lp 4, 5 @ #0x000000f0\r
+ TileDoShGenPixel_onlyop_lp 8, 6 @ #0x00000f00\r
+ TileDoShGenPixel_onlyop_lp 12, 7 @ #0x0000f000\r
+.endm\r
+\r
+.macro TileNormSh_onlyop_lp\r
+ TileDoShGenPixel_onlyop_lp 12, 0 @ #0x0000f000\r
+ TileDoShGenPixel_onlyop_lp 8, 1 @ #0x00000f00\r
+ TileDoShGenPixel_onlyop_lp 4, 2 @ #0x000000f0\r
+ TileDoShGenPixel_onlyop_lp 0, 3 @ #0x0000000f\r
+ TileDoShGenPixel_onlyop_lp 28, 4 @ #0xf0000000\r
+ TileDoShGenPixel_onlyop_lp 24, 5 @ #0x0f000000\r
+ TileDoShGenPixel_onlyop_lp 20, 6 @ #0x00f00000\r
+ TileDoShGenPixel_onlyop_lp 16, 7 @ #0x000f0000\r
+.endm\r
+\r