Skip to content

Instantly share code, notes, and snippets.

@Cyanne
Created January 11, 2023 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cyanne/02eb7c634b57ff113394c59914b68e0e to your computer and use it in GitHub Desktop.
Save Cyanne/02eb7c634b57ff113394c59914b68e0e to your computer and use it in GitHub Desktop.
; A: Timer, X: Heart color, Y: Color counter
LDY #$ff ; Pulse offset
STY $0010
LDX #$06 ; Color 1
STX $0001
LDX #$0e ; Color 2
STX $0002
LDX #$03 ; Color 3
STX $0003
LDX #$01 ; Color 4
STX $0004
LDX #$0b ; Color 0
STX $0000
draw:
STX $03ce
STX $03d0
STX $03ed
STX $03ee
STX $03ef
STX $03f0
STX $03f1
STX $040e
STX $040f
STX $0410
STX $042f
wait:
ADC #$01
BCC wait ; Exercise objective
INY
CPY #$00
BEQ y00
CPY #$03
BEQ y03
CPY #$04
BEQ y04
CPY #$06
BEQ y06
CPY #$08
BEQ y08
CPY #$0a
BEQ y0a
CPY #$0c
BEQ y0c
CPY #$0e
BEQ y0e
CPY #$11
BEQ y11
JMP wait ; Wait more
;Set next colors
y00:
LDX $0000
JMP draw
y03:
LDX $0001
JMP draw
y04:
LDX $0002
JMP draw
y06:
LDX $0003
JMP draw
y08:
LDX $0004
JMP draw
y0a:
LDX $0003
JMP draw
y0c:
LDX $0002
JMP draw
y0e:
LDX $0001
JMP draw
y11:
LDX $0000
LDY $0010 ; Re-init color counter
JMP draw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment