dos33fsprogs/games/sb/cycle_colors.s

86 lines
1.0 KiB
ArmAsm
Raw Normal View History

2023-06-02 21:07:04 +00:00
; used for title of strongbadzone
cycle_colors:
lda FRAME
lsr
lsr
2023-06-03 03:46:25 +00:00
; lsr
2023-06-02 21:07:04 +00:00
and #$3
tax
2023-06-03 03:46:25 +00:00
; lda color_opcodes,X
; sta color_change1_smc
; sta color_change2_smc
2023-06-02 21:07:04 +00:00
lda color_mask_odd,X
sta color_change1_smc+1
lda color_mask_even,X
sta color_change2_smc+1
2023-06-03 03:46:25 +00:00
ldx #77
2023-06-02 21:07:04 +00:00
color_loop:
lda hposn_high,X
sta OUTH
2023-06-11 06:33:52 +00:00
eor #$80
2023-06-02 21:07:04 +00:00
sta INH
lda hposn_low,X
sta OUTL
sta INL
ldy #39
color_inner_loop:
2023-06-03 03:46:25 +00:00
cpx #59
bcc no_were_good
cpy #10
bcc no_were_good
cpy #24
bcc skip_area
no_were_good:
2023-06-02 21:07:04 +00:00
lda (INL),Y
color_change1_smc:
and #$AA
sta (OUTL),Y
dey
lda (INL),Y
color_change2_smc:
and #$55
sta (OUTL),Y
2023-06-03 03:46:25 +00:00
skip_area:
2023-06-02 21:07:04 +00:00
dey
bpl color_inner_loop
dex
bne color_loop
rts
2023-06-03 03:46:25 +00:00
; green = 1 (10) and $29/$55/$2A
; purple= 2 (01) and $29/$2A/$55
; white1= 3 and $29/$7f/$7f
; orange= 5 (10) and $29/$D5/$AA
; blue= 6 (01) and $29/$AA/$D5
; white2= 7 and $29/$FF/$FF
2023-06-02 21:07:04 +00:00
2023-06-03 03:46:25 +00:00
;color_opcodes:
; .byte $29,$29,$29,$29 ; and = $29 ora=$09
2023-06-02 21:07:04 +00:00
color_mask_odd:
2023-06-03 03:46:25 +00:00
.byte $55,$D5,$FF,$7F
2023-06-02 21:07:04 +00:00
color_mask_even:
2023-06-03 03:46:25 +00:00
.byte $2A,$AA,$FF,$7F