Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Filter_Darken_Color:
- {
- STA $00 ;Original Color
- AND.w #$001F : !SUB $06 : INC;Red Mask on original color and add value of brightness onto original color
- CMP.w #$0002 : !BGE .red_not_zero ;If red <= 2
- LDA.w #$0002 ;red = 0
- .red_not_zero
- STA $02 ;Store new Red
- LDA $00 : LSR #05 : AND.w #$001F : !SUB $06 ;Load original color with Green Mask and add value of brightness
- CMP.w #$0002 : !BGE .green_not_zero ;If green <= 2
- LDA.w #$0002 ;green = 2
- .green_not_zero
- ASL #05
- STA $04 ;Store new Green
- LDA $00 : AND.w #$7C00 : LSR #10 : !SUB $06 ;Load original color with Blue Mask and add value of brightness
- CMP.w #$0002 : !BGE .blue_not_zero ;If blue <= 2
- LDA.w #$0002 ;blue = 2
- .blue_not_zero
- ASL #10
- ORA $02 : ORA $04 ; Load Blue, ORA Red, ORA Green
- RTS
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement