Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; =========================================================================
- ; -------------------------------------------------------------------------
- ; Main Routine to fade colors
- ; -------------------------------------------------------------------------
- ; Input: a0 - Source pallete start pointer
- ; a1 - Destination pallete start pointer
- ; -------------------------------------------------------------------------
- PalEngine_Fade moveq #0,d0
- move.b PalEngine_FadeFactor,d0 ; load Fade Factor
- moveq #0,d6
- move.b PalEngine_FadeLen,d6 ; load Fade Length
- @FadeColors move.w (a0)+,d1 ; load source color
- moveq #0,d3
- moveq #0,d5
- moveq #2,d4
- @FadeChannel move.w d1,d2
- lsr.w #4,d1
- andi.w #%1110,d2 ; d2 -> Current Channel
- mulu.w d0,d2 ; d2 -> Mutiply by Fade Factor
- lsr.w #4,d2
- andi.w #%1110,d2 ; d2 -> Channel with Fading
- lsl.w d3,d2 ; d2 -> Align Channel
- addq.b #4,d3
- or.w d2,d5
- dbf d4,@FadeChannel ; do for all channels
- move.w d5,(a1)+ ; save faded color
- dbf d6,@FadeColors ; do for all colors
- rts
Add Comment
Please, Sign In to add comment