
Code: Select all
.play_losing_a_life_tune
STX L0076
STY L0077 ; 77:76 points to tune data
LDY #$00
STY L0089
LDA (L0076),Y
STA L008A ; get number of notes to play (pairs of pitch+duration)
.play_next_note
LDY L0089
INY
LDA (L0076),Y
STA sound_param_block2+4 ; set pitch
INY
LDA (L0076),Y
STA sound_param_block2+6 ; set duration
STY L0089
LDX #lo(sound_param_block2)
LDY #hi(sound_param_block2)
LDA #$07
JSR osword ; SOUND
DEC L008A ; still notes left to play in this tune?
BNE play_next_note
RTS
.losing_a_life_tune
; tune of 16 notes, each note is pair of pitch+duration
EQUB (end_losing_a_life_tune-losing_a_life_tune)/2
EQUB $21,$04,$29,$02,$21,$04,$19,$02
EQUB $15,$04,$05,$02,$0D,$04,$01,$02
EQUB $05,$0C,$05,$01,$0D,$01,$15,$01
EQUB $19,$01,$21,$01,$31,$01,$35,$01
.end_losing_a_life_tune