orr \reg, \reg, r3 @ add blue back\r
.endm\r
\r
-.global vidConvCpyRGB565\r
-\r
-vidConvCpyRGB565: @ void *to, void *from, int pixels\r
- stmfd sp!, {r4-r9,lr}\r
-\r
+@ trashes: r2-r9,r12,lr; r0,r1 are advanced\r
+.macro vidConvCpyRGB565_local\r
mov r12, r2, lsr #3 @ repeats\r
mov lr, #0x001c0000\r
orr lr, lr, #0x01c @ lr == pattern 0x001c001c\r
mov r8, #0x00030000\r
orr r8, r8, #0x003\r
\r
-.loopRGB565:\r
+0:\r
ldmia r1!, {r4-r7}\r
subs r12, r12, #1\r
convRGB565 r4\r
convRGB565 r7\r
str r7, [r0], #4\r
\r
- bgt .loopRGB565\r
+ bgt 0b\r
+.endm\r
+\r
+\r
+.global vidConvCpyRGB565\r
\r
+vidConvCpyRGB565: @ void *to, void *from, int pixels\r
+ stmfd sp!, {r4-r9,lr}\r
+ vidConvCpyRGB565_local\r
ldmfd sp!, {r4-r9,lr}\r
bx lr\r
\r
\r
+.global PicoDoHighPal555 @ int sh\r
\r
-.global FinalizeLineRGB555 @ int sh\r
-\r
-FinalizeLineRGB555:\r
- stmfd sp!, {r4-r8,lr}\r
+PicoDoHighPal555:\r
+ stmfd sp!, {r4-r9,lr}\r
+ mov r1, #0\r
ldr r8, =(Pico+0x22228) @ Pico.video\r
- ldr r4, =HighPal\r
\r
- ldrb r7, [r8, #-0x1a] @ 0x2220e ~ dirtyPal\r
- mov r6, r0\r
+PicoDoHighPal555_nopush:\r
+ str r1, [sp, #-8] @ is called from FinalizeLineRGB555?\r
+\r
+ str r0, [sp, #-4]\r
+ ldr r0, =HighPal\r
+\r
mov r1, #0\r
- tst r7, r7\r
- beq .fl_noconvRGB555\r
- strb r1, [r8, #-0x1a]\r
+ strb r1, [r8, #-0x1a] @ 0x2220e ~ dirtyPal\r
+\r
sub r1, r8, #0x128 @ r1=Pico.cram\r
- mov r0, r4\r
mov r2, #0x40\r
- bl vidConvCpyRGB565\r
+ vidConvCpyRGB565_local\r
\r
-.fl_noconvRGB555:\r
- mov r3, r4\r
- tst r6, r6\r
- beq .fl_noshRGB555\r
- tst r7, r7\r
- beq .fl_noshRGB555\r
+ ldr r0, [sp, #-4]\r
+ tst r0, r0\r
+ beq PicoDoHighPal555_end\r
+\r
+ ldr r3, =HighPal\r
\r
@ shadowed pixels:\r
mov r12, #0x008e\r
- orr r12,r12,#0x7300\r
- orr r12,r12,r12,lsl #16\r
add r4, r3, #0x40*2\r
+ orr r12,r12,#0x7300\r
add r5, r3, #0xc0*2\r
+ orr r12,r12,r12,lsl #16\r
mov lr, #0x40/4\r
.fl_loopcpRGB555_sh:\r
ldmia r3!, {r1,r6}\r
str r1, [r4], #4\r
subs lr, lr, #1\r
bne .fl_loopcpRGB555_hi\r
+ mov r0, #1\r
\r
- sub r3, r3, #0x40*2\r
- mov r6, #1\r
+PicoDoHighPal555_end:\r
+ ldr r1, [sp, #-8]\r
+ tst r1, r1\r
+ ldmeqfd sp!, {r4-r9,pc}\r
+\r
+ ldr r8, =(Pico+0x22228) @ Pico.video\r
+ b FinalizeLineRGB555_pal_done\r
+\r
+\r
+.global FinalizeLineRGB555 @ int sh\r
+\r
+FinalizeLineRGB555:\r
+ stmfd sp!, {r4-r9,lr}\r
+ ldr r8, =(Pico+0x22228) @ Pico.video\r
+\r
+ ldrb r2, [r8, #-0x1a] @ 0x2220e ~ dirtyPal\r
+ mov r1, #1\r
+ tst r2, r2\r
+ bne PicoDoHighPal555_nopush\r
+\r
+FinalizeLineRGB555_pal_done:\r
+ ldr r3, =HighPal\r
\r
-.fl_noshRGB555:\r
ldr r12,=rendstatus\r
- eors r6, r6, #1 @ sh is 0\r
+ eors r0, r0, #1 @ sh is 0\r
ldr r12,[r12]\r
mov lr, #0xff\r
tstne r12,#PDRAW_ACC_SPRITES\r
stmia r0!, {r4,r5,r8,r12}\r
bne .fl_loopRGB555\r
\r
- ldmfd sp!, {r4-r8,lr}\r
+ ldmfd sp!, {r4-r9,lr}\r
bx lr\r
\r
\r
.fl_32scale_RGB555:\r
- stmfd sp!, {r9,r10}\r
+ stmfd sp!, {r10}\r
mov r9, #0x3900 @ f800 07e0 001f | e000 0780 001c | 3800 01e0 0007\r
orr r9, r9, #0x00e7\r
\r
stmia r0!, {r4,r5,r6,r8,r10}\r
bne .fl_loop32scale_RGB555\r
\r
- ldmfd sp!, {r9,r10}\r
- ldmfd sp!, {r4-r8,lr}\r
+ ldmfd sp!, {r10}\r
+ ldmfd sp!, {r4-r9,lr}\r
bx lr\r
\r
.if UNALIGNED_DRAWLINEDEST\r
\r
strh r8, [r0], #2\r
\r
- ldmfd sp!, {r4-r8,lr}\r
+ ldmfd sp!, {r4-r9,lr}\r
bx lr\r
\r
\r
\r
strh r4, [r0], #2\r
\r
- ldmfd sp!, {r9,r10}\r
- ldmfd sp!, {r4-r8,lr}\r
+ ldmfd sp!, {r10}\r
+ ldmfd sp!, {r4-r9,lr}\r
bx lr\r
\r
.endif @ UNALIGNED_DRAWLINEDEST\r