Advertisement
Guest User

Untitled

a guest
Sep 29th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.        Filter_Darken_Color:
  2.     {
  3.         STA $00 ;Original Color
  4.         AND.w #$001F : !SUB $06 : INC;Red Mask on original color and add value of brightness onto original color
  5.  
  6.         CMP.w #$0002 : !BGE .red_not_zero ;If red <= 2
  7.             LDA.w #$0002 ;red = 0
  8.     .red_not_zero
  9.        
  10.         STA $02 ;Store new Red
  11.        
  12.         LDA $00 : LSR #05 : AND.w #$001F : !SUB $06 ;Load original color with Green Mask and add value of brightness
  13.        
  14.         CMP.w #$0002 : !BGE .green_not_zero ;If green <= 2
  15.             LDA.w #$0002 ;green = 2
  16.     .green_not_zero
  17.         ASL #05
  18.         STA $04 ;Store new Green
  19.  
  20.         LDA $00 : AND.w #$7C00 : LSR #10 : !SUB $06 ;Load original color with Blue Mask and add value of brightness
  21.  
  22.         CMP.w #$0002 : !BGE .blue_not_zero ;If blue <= 2
  23.             LDA.w #$0002 ;blue = 2
  24.     .blue_not_zero
  25.         ASL #10
  26.         ORA $02 : ORA $04 ; Load Blue, ORA Red, ORA Green
  27.         RTS
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement