← B78F Play the second-ball spawn sound Map B7D2 → Sound effect: inhabitant spawns
B79B: Sound effect: death burst
The sound when an inhabitant dies or the bat explodes on a lost ball. It also plays when the missile shot bursts on a wall, or the ball gem's flight runs out.
death_burst_counter B79B DEFB $00 Step counter: 0 when the effect is disarmed, otherwise the step it has reached, 1 to 15
death_burst_periods B79C DEFB $64,$6E Never read
B79E DEFB $8C,$5A,$50,$32,$C8,$E6,$28,$3C Pitch period for each step
B7A6 DEFB $64,$96,$64,$32,$32,$32
B7AC DEFB $32,$02 Never read
sfx_death_burst B7AE LD A,(death_burst_counter) Read the step counter; a disarmed effect has nothing to play.
B7B1 OR A
B7B2 RET Z
B7B3 CP $0F The counter past its last step: clear it and return. That disarms the effect.
B7B5 JR NZ,death_burst_step
B7B7 XOR A
B7B8 LD (death_burst_counter),A
B7BB RET
death_burst_step B7BC INC A Advance to the next step and save the counter.
B7BD LD (death_burst_counter),A
Each step's pitch comes from the death-burst table.
B7C0 LD E,A Take this step's period byte into D.
B7C1 LD D,$00
B7C3 LD HL,death_burst_periods
B7C6 ADD HL,DE
B7C7 LD D,(HL)
B7C8 LD C,$02 Two cycles make up each step of the sweep.
death_burst_emit B7CA CALL sound_blip Emit one cycle at the current period.
B7CD INC D Lower the pitch between the two cycles, then repeat until both are done.
B7CE DEC C
B7CF JR NZ,death_burst_emit
B7D1 RET
← B78F Play the second-ball spawn sound Map B7D2 → Sound effect: inhabitant spawns
Fork me on GitHub