Guest User

Untitled

a guest
May 5th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ; =========================================================================
  3. ; -------------------------------------------------------------------------
  4. ; Main Routine to fade colors
  5. ; -------------------------------------------------------------------------
  6. ; Input:    a0 - Source pallete start pointer
  7. ;       a1 - Destination pallete start pointer
  8. ; -------------------------------------------------------------------------
  9.  
  10. PalEngine_Fade  moveq   #0,d0
  11.         move.b  PalEngine_FadeFactor,d0 ; load Fade Factor
  12.         moveq   #0,d6
  13.         move.b  PalEngine_FadeLen,d6    ; load Fade Length
  14.  
  15. @FadeColors move.w  (a0)+,d1        ; load source color
  16.         moveq   #0,d3
  17.         moveq   #0,d5
  18.         moveq   #2,d4
  19.  
  20. @FadeChannel    move.w  d1,d2
  21.         lsr.w   #4,d1
  22.         andi.w  #%1110,d2       ; d2 -> Current Channel
  23.         mulu.w  d0,d2           ; d2 -> Mutiply by Fade Factor
  24.         lsr.w   #4,d2
  25.         andi.w  #%1110,d2       ; d2 -> Channel with Fading
  26.         lsl.w   d3,d2           ; d2 -> Align Channel
  27.         addq.b  #4,d3
  28.         or.w    d2,d5
  29.         dbf d4,@FadeChannel     ; do for all channels
  30.        
  31.         move.w  d5,(a1)+        ; save faded color
  32.         dbf d6,@FadeColors      ; do for all colors
  33.  
  34.         rts
Add Comment
Please, Sign In to add comment