Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; How to use:
- jsr (Create_New_Sprite).l
- bne.s +
- move.l #Obj_SmoothPalette,(a1)
- move.w #4,subtype(a1)
- move.l #Pal_FDZ3_Rain,$30(a1)
- move.w #Normal_palette_line_3,$34(a1)
- move.w #16-1,$38(a1)
- ; =============== S U B R O U T I N E =======================================
- Obj_SmoothPalette:
- subq.w #1,$2E(a0)
- bpl.s SmoothPalette_Return
- move.w subtype(a0),$2E(a0)
- movea.l $30(a0),a1 ; palette pointer
- movea.w $34(a0),a2 ; palette ram
- move.w $38(a0),d6 ; palette size
- jsr (Pal_FadeToPal).l
- bne.s SmoothPalette_Return
- move.l #Delete_Current_Sprite,address(a0)
- SmoothPalette_Return:
- rts
- ; ---------------------------------------------------------------------------
- ; Smooth palette change
- ; Inputs:
- ; a1 = current palette
- ; a2 = current palette line
- ; d7 = number of colors
- ; ---------------------------------------------------------------------------
- ; =============== S U B R O U T I N E =======================================
- Pal_FadeToPal:
- tst.b (Palette_refade_count).w
- bne.s Pal_FadeToPal_Loop
- move.b #7,(Palette_refade_count).w
- Pal_FadeToPal_Loop:
- moveq #0,d5
- move.w (a1)+,d2
- move.w (a2),d3
- cmp.w d2,d3
- beq.s Pal_FadeToPal_Next
- move.w d2,d0
- move.w d3,d1
- andi.w #$E,d0
- andi.w #$E,d1
- move.w #2,d4
- cmp.w d1,d0
- beq.s ++
- bhi.s +
- neg.w d4
- + add.w d4,d1
- + or.w d1,d5
- move.w d2,d0
- move.w d3,d1
- andi.w #$E0,d0
- andi.w #$E0,d1
- move.w #$20,d4
- cmp.w d1,d0
- beq.s ++
- bhi.s +
- neg.w d4
- + add.w d4,d1
- + or.w d1,d5
- move.w d2,d0
- move.w d3,d1
- andi.w #$E00,d0
- andi.w #$E00,d1
- move.w #$200,d4
- cmp.w d1,d0
- beq.s ++
- bhi.s +
- neg.w d4
- + add.w d4,d1
- + or.w d1,d5
- move.w d5,(a2)
- Pal_FadeToPal_Next:
- addq.w #2,a2
- dbf d7,Pal_FadeToPal_Loop
- subq.b #1,(Palette_refade_count).w
- rts
- ; End of function Pal_FadeToPal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement