mirror of
https://frontier.innolan.net/github/amigaos-cross-toolchain6.git
synced 2024-10-19 10:29:55 +00:00
166 lines
2.2 KiB
ArmAsm
166 lines
2.2 KiB
ArmAsm
#NO_APP
|
|
.text
|
|
.align 2
|
|
.globl _palette_fadeTo
|
|
_palette_fadeTo:
|
|
subq.l #8,sp
|
|
movem.l #16190,-(sp)
|
|
move.l a0,48(sp)
|
|
and.l #65535,d0
|
|
move.l d0,a5
|
|
move.w d1,d0
|
|
lsr.w #8,d0
|
|
moveq #12,d2
|
|
lsl.l d2,d0
|
|
and.l #61440,d0
|
|
move.l d0,a4
|
|
move.w d1,d7
|
|
lsr.w #4,d7
|
|
lsl.l d2,d7
|
|
and.l #61440,d7
|
|
lsl.l d2,d1
|
|
move.l d1,d6
|
|
and.l #61440,d6
|
|
moveq #0,d5
|
|
lea ___mulsi3,a2
|
|
.L2:
|
|
cmp.w #0,a5
|
|
jeq .L8
|
|
move.l _custom,a6
|
|
move.l 48(sp),a3
|
|
moveq #0,d4
|
|
.L6:
|
|
move.w (a3)+,d2
|
|
move.w d2,d0
|
|
lsr.w #8,d0
|
|
moveq #15,d1
|
|
and.l d1,d0
|
|
lsl.l #8,d0
|
|
sub.l a4,d0
|
|
jmi .L20
|
|
asr.l #4,d0
|
|
move.l d5,-(sp)
|
|
move.l d0,-(sp)
|
|
jsr (a2)
|
|
addq.l #8,sp
|
|
add.l a4,d0
|
|
moveq #-1,d1
|
|
not.b d1
|
|
and.l d0,d1
|
|
move.l d1,44(sp)
|
|
moveq #15,d0
|
|
and.l d2,d0
|
|
lsl.l #8,d0
|
|
sub.l d6,d0
|
|
jmi .L21
|
|
.L4:
|
|
asr.l #4,d0
|
|
move.l d5,-(sp)
|
|
move.l d0,-(sp)
|
|
jsr (a2)
|
|
addq.l #8,sp
|
|
move.l d0,d3
|
|
add.l d6,d3
|
|
asr.l #8,d3
|
|
or.w 46(sp),d3
|
|
lsr.w #4,d2
|
|
moveq #15,d0
|
|
and.l d0,d2
|
|
lsl.l #8,d2
|
|
sub.l d7,d2
|
|
jmi .L22
|
|
.L5:
|
|
asr.l #4,d2
|
|
move.l d5,-(sp)
|
|
move.l d2,-(sp)
|
|
jsr (a2)
|
|
addq.l #8,sp
|
|
add.l d7,d0
|
|
asr.l #8,d0
|
|
lsl.l #4,d0
|
|
or.w d0,d3
|
|
move.l d4,d0
|
|
add.l d4,d0
|
|
move.w d3,(a6,d0.l)
|
|
addq.l #1,d4
|
|
cmp.l d4,a5
|
|
jne .L6
|
|
.L8:
|
|
jsr _hw_waitVerticalBlank
|
|
addq.l #1,d5
|
|
moveq #16,d1
|
|
cmp.l d5,d1
|
|
jne .L2
|
|
cmp.w #0,a5
|
|
jeq .L10
|
|
move.l _custom,a2
|
|
move.l 48(sp),a0
|
|
moveq #0,d0
|
|
.L9:
|
|
move.w (a0)+,a1
|
|
move.l d0,d1
|
|
add.l d0,d1
|
|
move.w a1,(a2,d1.l)
|
|
addq.l #1,d0
|
|
cmp.l d0,a5
|
|
jne .L9
|
|
.L10:
|
|
move.l 48(sp),a0
|
|
move.w (a0),_palette_background
|
|
movem.l (sp)+,#31996
|
|
addq.l #8,sp
|
|
rts
|
|
.L20:
|
|
add.l d1,d0
|
|
asr.l #4,d0
|
|
move.l d5,-(sp)
|
|
move.l d0,-(sp)
|
|
jsr (a2)
|
|
addq.l #8,sp
|
|
add.l a4,d0
|
|
moveq #-1,d1
|
|
not.b d1
|
|
and.l d0,d1
|
|
move.l d1,44(sp)
|
|
moveq #15,d0
|
|
and.l d2,d0
|
|
lsl.l #8,d0
|
|
sub.l d6,d0
|
|
jpl .L4
|
|
.L21:
|
|
moveq #15,d1
|
|
add.l d1,d0
|
|
asr.l #4,d0
|
|
move.l d5,-(sp)
|
|
move.l d0,-(sp)
|
|
jsr (a2)
|
|
addq.l #8,sp
|
|
move.l d0,d3
|
|
add.l d6,d3
|
|
asr.l #8,d3
|
|
or.w 46(sp),d3
|
|
lsr.w #4,d2
|
|
moveq #15,d0
|
|
and.l d0,d2
|
|
lsl.l #8,d2
|
|
sub.l d7,d2
|
|
jpl .L5
|
|
.L22:
|
|
add.l d0,d2
|
|
asr.l #4,d2
|
|
move.l d5,-(sp)
|
|
move.l d2,-(sp)
|
|
jsr (a2)
|
|
addq.l #8,sp
|
|
add.l d7,d0
|
|
asr.l #8,d0
|
|
lsl.l #4,d0
|
|
or.w d0,d3
|
|
move.l d4,d0
|
|
add.l d4,d0
|
|
move.w d3,(a6,d0.l)
|
|
addq.l #1,d4
|
|
cmp.l d4,a5
|
|
jne .L6
|
|
jra .L8
|