sb: work on color cycle

This commit is contained in:
Vince Weaver 2023-06-02 17:07:04 -04:00
parent 34401d1dac
commit 4eb8cd5ab8
4 changed files with 93 additions and 2 deletions

View File

@ -61,7 +61,7 @@ asplode.o: asplode.s zx02_optim.s \
asplode_graphics/sb_title.hgr.zx02 \
asplode_graphics/sb_zone.hgr.zx02 \
asplode_graphics/sb_sprites.inc \
hgr_sprite_big.s \
hgr_sprite_big.s cycle_colors.s \
zp.inc hardware.inc
ca65 -o asplode.o asplode.s -l asplode.lst

View File

@ -43,7 +43,28 @@ load_title:
jsr full_decomp
jsr wait_until_keypress
; load to page2 for color cycle
lda #<title_data
sta ZX0_src
lda #>title_data
sta ZX0_src+1
lda #$40
jsr full_decomp
title_cycle_loop:
jsr cycle_colors
inc FRAME
lda KEYPRESS
bpl title_cycle_loop
bit KEYRESET
;===================
; setup game
@ -166,6 +187,7 @@ wait_until_keypress:
.include "hgr_tables.s"
.include "zx02_optim.s"
.include "hgr_sprite_big.s"
.include "cycle_colors.s"
.include "asplode_graphics/sb_sprites.inc"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 19 KiB

69
games/sb/cycle_colors.s Normal file
View File

@ -0,0 +1,69 @@
; used for title of strongbadzone
cycle_colors:
lda FRAME
lsr
lsr
lsr
and #$3
tax
lda color_opcodes,X
sta color_change1_smc
sta color_change2_smc
lda color_mask_odd,X
sta color_change1_smc+1
lda color_mask_even,X
sta color_change2_smc+1
ldx #50
color_loop:
lda hposn_high,X
sta OUTH
eor #$60
sta INH
lda hposn_low,X
sta OUTL
sta INL
ldy #39
color_inner_loop:
lda (INL),Y
color_change1_smc:
and #$AA
sta (OUTL),Y
dey
lda (INL),Y
color_change2_smc:
and #$55
sta (OUTL),Y
dey
bpl color_inner_loop
dex
bne color_loop
rts
color_opcodes:
.byte $29,$29,$09,$29 ; and = $29 ora=$09
color_mask_odd:
.byte $AA,$7f,$00,$D5
color_mask_even:
.byte $D5,$7f,$00,$AA