mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-10-27 21:48:50 +01:00
asm for PicoDoHighPal555
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@561 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
e55f0cbba1
commit
b2305d080d
2 changed files with 67 additions and 43 deletions
|
|
@ -1138,6 +1138,7 @@ static void BackFill(int reg7, int sh)
|
||||||
|
|
||||||
unsigned short HighPal[0x100];
|
unsigned short HighPal[0x100];
|
||||||
|
|
||||||
|
#ifndef _ASM_DRAW_C
|
||||||
void PicoDoHighPal555(int sh)
|
void PicoDoHighPal555(int sh)
|
||||||
{
|
{
|
||||||
unsigned short *pal=HighPal;
|
unsigned short *pal=HighPal;
|
||||||
|
|
@ -1169,7 +1170,6 @@ void PicoDoHighPal555(int sh)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _ASM_DRAW_C
|
|
||||||
static void FinalizeLineBGR444(int sh)
|
static void FinalizeLineBGR444(int sh)
|
||||||
{
|
{
|
||||||
unsigned short *pd=DrawLineDest;
|
unsigned short *pd=DrawLineDest;
|
||||||
|
|
|
||||||
108
Pico/Draw.s
108
Pico/Draw.s
|
|
@ -1633,18 +1633,15 @@ FinalizeLineBGR444:
|
||||||
orr \reg, \reg, r3 @ add blue back
|
orr \reg, \reg, r3 @ add blue back
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.global vidConvCpyRGB565
|
@ trashes: r2-r9,r12,lr; r0,r1 are advanced
|
||||||
|
.macro vidConvCpyRGB565_local
|
||||||
vidConvCpyRGB565: @ void *to, void *from, int pixels
|
|
||||||
stmfd sp!, {r4-r9,lr}
|
|
||||||
|
|
||||||
mov r12, r2, lsr #3 @ repeats
|
mov r12, r2, lsr #3 @ repeats
|
||||||
mov lr, #0x001c0000
|
mov lr, #0x001c0000
|
||||||
orr lr, lr, #0x01c @ lr == pattern 0x001c001c
|
orr lr, lr, #0x01c @ lr == pattern 0x001c001c
|
||||||
mov r8, #0x00030000
|
mov r8, #0x00030000
|
||||||
orr r8, r8, #0x003
|
orr r8, r8, #0x003
|
||||||
|
|
||||||
.loopRGB565:
|
0:
|
||||||
ldmia r1!, {r4-r7}
|
ldmia r1!, {r4-r7}
|
||||||
subs r12, r12, #1
|
subs r12, r12, #1
|
||||||
convRGB565 r4
|
convRGB565 r4
|
||||||
|
|
@ -1656,44 +1653,51 @@ vidConvCpyRGB565: @ void *to, void *from, int pixels
|
||||||
convRGB565 r7
|
convRGB565 r7
|
||||||
str r7, [r0], #4
|
str r7, [r0], #4
|
||||||
|
|
||||||
bgt .loopRGB565
|
bgt 0b
|
||||||
|
.endm
|
||||||
|
|
||||||
|
|
||||||
|
.global vidConvCpyRGB565
|
||||||
|
|
||||||
|
vidConvCpyRGB565: @ void *to, void *from, int pixels
|
||||||
|
stmfd sp!, {r4-r9,lr}
|
||||||
|
vidConvCpyRGB565_local
|
||||||
ldmfd sp!, {r4-r9,lr}
|
ldmfd sp!, {r4-r9,lr}
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
|
|
||||||
|
.global PicoDoHighPal555 @ int sh
|
||||||
|
|
||||||
.global FinalizeLineRGB555 @ int sh
|
PicoDoHighPal555:
|
||||||
|
stmfd sp!, {r4-r9,lr}
|
||||||
FinalizeLineRGB555:
|
|
||||||
stmfd sp!, {r4-r8,lr}
|
|
||||||
ldr r8, =(Pico+0x22228) @ Pico.video
|
|
||||||
ldr r4, =HighPal
|
|
||||||
|
|
||||||
ldrb r7, [r8, #-0x1a] @ 0x2220e ~ dirtyPal
|
|
||||||
mov r6, r0
|
|
||||||
mov r1, #0
|
mov r1, #0
|
||||||
tst r7, r7
|
ldr r8, =(Pico+0x22228) @ Pico.video
|
||||||
beq .fl_noconvRGB555
|
|
||||||
strb r1, [r8, #-0x1a]
|
|
||||||
sub r1, r8, #0x128 @ r1=Pico.cram
|
|
||||||
mov r0, r4
|
|
||||||
mov r2, #0x40
|
|
||||||
bl vidConvCpyRGB565
|
|
||||||
|
|
||||||
.fl_noconvRGB555:
|
PicoDoHighPal555_nopush:
|
||||||
mov r3, r4
|
str r1, [sp, #-8] @ is called from FinalizeLineRGB555?
|
||||||
tst r6, r6
|
|
||||||
beq .fl_noshRGB555
|
str r0, [sp, #-4]
|
||||||
tst r7, r7
|
ldr r0, =HighPal
|
||||||
beq .fl_noshRGB555
|
|
||||||
|
mov r1, #0
|
||||||
|
strb r1, [r8, #-0x1a] @ 0x2220e ~ dirtyPal
|
||||||
|
|
||||||
|
sub r1, r8, #0x128 @ r1=Pico.cram
|
||||||
|
mov r2, #0x40
|
||||||
|
vidConvCpyRGB565_local
|
||||||
|
|
||||||
|
ldr r0, [sp, #-4]
|
||||||
|
tst r0, r0
|
||||||
|
beq PicoDoHighPal555_end
|
||||||
|
|
||||||
|
ldr r3, =HighPal
|
||||||
|
|
||||||
@ shadowed pixels:
|
@ shadowed pixels:
|
||||||
mov r12, #0x008e
|
mov r12, #0x008e
|
||||||
orr r12,r12,#0x7300
|
|
||||||
orr r12,r12,r12,lsl #16
|
|
||||||
add r4, r3, #0x40*2
|
add r4, r3, #0x40*2
|
||||||
|
orr r12,r12,#0x7300
|
||||||
add r5, r3, #0xc0*2
|
add r5, r3, #0xc0*2
|
||||||
|
orr r12,r12,r12,lsl #16
|
||||||
mov lr, #0x40/4
|
mov lr, #0x40/4
|
||||||
.fl_loopcpRGB555_sh:
|
.fl_loopcpRGB555_sh:
|
||||||
ldmia r3!, {r1,r6}
|
ldmia r3!, {r1,r6}
|
||||||
|
|
@ -1713,13 +1717,33 @@ FinalizeLineRGB555:
|
||||||
str r1, [r4], #4
|
str r1, [r4], #4
|
||||||
subs lr, lr, #1
|
subs lr, lr, #1
|
||||||
bne .fl_loopcpRGB555_hi
|
bne .fl_loopcpRGB555_hi
|
||||||
|
mov r0, #1
|
||||||
|
|
||||||
sub r3, r3, #0x40*2
|
PicoDoHighPal555_end:
|
||||||
mov r6, #1
|
ldr r1, [sp, #-8]
|
||||||
|
tst r1, r1
|
||||||
|
ldmeqfd sp!, {r4-r9,pc}
|
||||||
|
|
||||||
|
ldr r8, =(Pico+0x22228) @ Pico.video
|
||||||
|
b FinalizeLineRGB555_pal_done
|
||||||
|
|
||||||
|
|
||||||
|
.global FinalizeLineRGB555 @ int sh
|
||||||
|
|
||||||
|
FinalizeLineRGB555:
|
||||||
|
stmfd sp!, {r4-r9,lr}
|
||||||
|
ldr r8, =(Pico+0x22228) @ Pico.video
|
||||||
|
|
||||||
|
ldrb r2, [r8, #-0x1a] @ 0x2220e ~ dirtyPal
|
||||||
|
mov r1, #1
|
||||||
|
tst r2, r2
|
||||||
|
bne PicoDoHighPal555_nopush
|
||||||
|
|
||||||
|
FinalizeLineRGB555_pal_done:
|
||||||
|
ldr r3, =HighPal
|
||||||
|
|
||||||
.fl_noshRGB555:
|
|
||||||
ldr r12,=rendstatus
|
ldr r12,=rendstatus
|
||||||
eors r6, r6, #1 @ sh is 0
|
eors r0, r0, #1 @ sh is 0
|
||||||
ldr r12,[r12]
|
ldr r12,[r12]
|
||||||
mov lr, #0xff
|
mov lr, #0xff
|
||||||
tstne r12,#PDRAW_ACC_SPRITES
|
tstne r12,#PDRAW_ACC_SPRITES
|
||||||
|
|
@ -1791,12 +1815,12 @@ FinalizeLineRGB555:
|
||||||
stmia r0!, {r4,r5,r8,r12}
|
stmia r0!, {r4,r5,r8,r12}
|
||||||
bne .fl_loopRGB555
|
bne .fl_loopRGB555
|
||||||
|
|
||||||
ldmfd sp!, {r4-r8,lr}
|
ldmfd sp!, {r4-r9,lr}
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
|
|
||||||
.fl_32scale_RGB555:
|
.fl_32scale_RGB555:
|
||||||
stmfd sp!, {r9,r10}
|
stmfd sp!, {r10}
|
||||||
mov r9, #0x3900 @ f800 07e0 001f | e000 0780 001c | 3800 01e0 0007
|
mov r9, #0x3900 @ f800 07e0 001f | e000 0780 001c | 3800 01e0 0007
|
||||||
orr r9, r9, #0x00e7
|
orr r9, r9, #0x00e7
|
||||||
|
|
||||||
|
|
@ -1857,8 +1881,8 @@ FinalizeLineRGB555:
|
||||||
stmia r0!, {r4,r5,r6,r8,r10}
|
stmia r0!, {r4,r5,r6,r8,r10}
|
||||||
bne .fl_loop32scale_RGB555
|
bne .fl_loop32scale_RGB555
|
||||||
|
|
||||||
ldmfd sp!, {r9,r10}
|
ldmfd sp!, {r10}
|
||||||
ldmfd sp!, {r4-r8,lr}
|
ldmfd sp!, {r4-r9,lr}
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
.if UNALIGNED_DRAWLINEDEST
|
.if UNALIGNED_DRAWLINEDEST
|
||||||
|
|
@ -1904,7 +1928,7 @@ FinalizeLineRGB555:
|
||||||
|
|
||||||
strh r8, [r0], #2
|
strh r8, [r0], #2
|
||||||
|
|
||||||
ldmfd sp!, {r4-r8,lr}
|
ldmfd sp!, {r4-r9,lr}
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1970,8 +1994,8 @@ FinalizeLineRGB555:
|
||||||
|
|
||||||
strh r4, [r0], #2
|
strh r4, [r0], #2
|
||||||
|
|
||||||
ldmfd sp!, {r9,r10}
|
ldmfd sp!, {r10}
|
||||||
ldmfd sp!, {r4-r8,lr}
|
ldmfd sp!, {r4-r9,lr}
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
.endif @ UNALIGNED_DRAWLINEDEST
|
.endif @ UNALIGNED_DRAWLINEDEST
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue