}\r
}\r
\r
-#if 0\r
-static void FinalizeLineBGR444(int sh, int line)\r
-{\r
- unsigned short *pd=DrawLineDest;\r
- unsigned char *ps=HighCol+8;\r
- unsigned short *pal=Pico.cram;\r
- int len, i, t, mask=0xff;\r
-\r
- if (Pico.video.reg[12]&1) {\r
- len = 320;\r
- } else {\r
- if(!(PicoOpt&POPT_DIS_32C_BORDER)) pd+=32;\r
- len = 256;\r
- }\r
-\r
- if(sh) {\r
- pal=HighPal;\r
- if(Pico.m.dirtyPal) {\r
- blockcpy(pal, Pico.cram, 0x40*2);\r
- // shadowed pixels\r
- for(i = 0x3f; i >= 0; i--)\r
- pal[0x40|i] = pal[0xc0|i] = (unsigned short)((pal[i]>>1)&0x0777);\r
- // hilighted pixels\r
- for(i = 0x3f; i >= 0; i--) {\r
- t=pal[i]&0xeee;t+=0x444;if(t&0x10)t|=0xe;if(t&0x100)t|=0xe0;if(t&0x1000)t|=0xe00;t&=0xeee;\r
- pal[0x80|i]=(unsigned short)t;\r
- }\r
- Pico.m.dirtyPal = 0;\r
- }\r
- }\r
-\r
- if (!sh && (rendstatus & PDRAW_SPR_LO_ON_HI))\r
- mask=0x3f; // accurate sprites\r
-\r
- for(i = 0; i < len; i++)\r
- pd[i] = pal[ps[i] & mask];\r
-}\r
-#endif\r
-\r
-\r
void FinalizeLine555(int sh, int line)\r
{\r
unsigned short *pd=DrawLineDest;\r
.endm\r
\r
\r
-.global FinalizeLineBGR444 @ int sh\r
-\r
-FinalizeLineBGR444:\r
- stmfd sp!, {r4-r6,lr}\r
- mov r6, r0\r
- ldr lr, =(Pico+0x22228) @ Pico.video\r
- ldr r0, =DrawLineDest\r
- ldrb r12, [lr, #12]\r
- ldr r0, [r0]\r
- sub r3, lr, #0x128 @ r3=Pico.cram\r
-\r
- tst r12, #1\r
- movne r2, #320/4 @ len\r
- bne .fl_no32colBGR444\r
- ldr r4, =PicoOpt\r
- mov r2, #256/4\r
- ldr r4, [r4]\r
- tst r4, #0x100\r
- addeq r0, r0, #32*2\r
-\r
-.fl_no32colBGR444:\r
- tst r6, r6\r
- beq .fl_noshBGR444\r
-\r
- ldr r4, =HighPal\r
-\r
- ldrb r12, [lr, #-0x1a] @ 0x2220e ~ dirtyPal\r
- tst r12, r12\r
- moveq r3, r4\r
- beq .fl_noshBGR444\r
- mov r12, #0\r
- strb r12, [lr, #-0x1a]\r
-\r
- mov lr, #0x40/8\r
- @ copy pal:\r
-.fl_loopcpBGR444:\r
- ldmia r3!, {r1,r5,r6,r12}\r
- subs lr, lr, #1\r
- stmia r4!, {r1,r5,r6,r12}\r
- bne .fl_loopcpBGR444\r
-\r
- @ shadowed pixels:\r
- mov r12, #0x0077\r
- orr r12,r12,#0x0700\r
- orr r12,r12,r12,lsl #16\r
- sub r3, r3, #0x40*2\r
- add r5, r4, #0x80*2\r
- mov lr, #0x40/4\r
-.fl_loopcpBGR444_sh:\r
- ldmia r3!, {r1,r6}\r
- subs lr, lr, #1\r
- and r1, r12, r1, lsr #1\r
- and r6, r12, r6, lsr #1\r
- stmia r4!, {r1,r6}\r
- stmia r5!, {r1,r6}\r
- bne .fl_loopcpBGR444_sh\r
-\r
- @ hilighted pixels:\r
- sub r3, r3, #0x40*2\r
- mov lr, #0x40/2\r
-.fl_loopcpBGR444_hi:\r
- ldr r1, [r3], #4\r
- TileDoShHi2Pixels444 r1\r
- str r1, [r4], #4\r
- subs lr, lr, #1\r
- bne .fl_loopcpBGR444_hi\r
-\r
- sub r3, r4, #0x40*3*2\r
- mov r6, #1\r
-\r
-\r
-.fl_noshBGR444:\r
- ldr r12,=rendstatus\r
- eors r6, r6, #1 @ sh is 0\r
- ldr r12,[r12]\r
- mov lr, #0xff\r
- tstne r12,#PDRAW_ACC_SPRITES\r
-\r
-.if OVERRIDE_HIGHCOL\r
- ldr r1, =HighCol\r
- movne lr, #0x3f\r
- ldr r1, [r1]\r
- mov lr, lr, lsl #1\r
- add r1, r1, #8\r
-.else\r
- ldr r1, =(HighCol+8)\r
- movne lr, #0x3f\r
- mov lr, lr, lsl #1\r
-.endif\r
-\r
-.fl_loopBGR444:\r
- ldr r12, [r1], #4\r
- subs r2, r2, #1\r
-\r
- and r4, lr, r12, lsl #1\r
- ldrh r4, [r3, r4]\r
- and r5, lr, r12, lsr #7\r
- ldrh r5, [r3, r5]\r
- and r6, lr, r12, lsr #15\r
- ldrh r6, [r3, r6]\r
- and r12,lr, r12, lsr #23\r
- ldrh r12,[r3, r12] @ 1c.i.\r
- orr r4, r4, r5, lsl #16\r
- orr r5, r6, r12,lsl #16\r
-\r
- stmia r0!, {r4,r5}\r
- bne .fl_loopBGR444\r
-\r
-\r
- ldmfd sp!, {r4-r6,lr}\r
- bx lr\r
-\r
-\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
\r
\r