← B8DC Sound effect: brick survives the hit Map B915 → Sound effect: bat grows
B8EC: Sound effect: bomb detonation (one step)
The sound when the bomb prize detonates, a 4-step sequence.
sfx_bomb_detonate B8EC LD A,(sfx_bomb) Read the step counter; a disarmed effect has nothing to play.
B8EF OR A
B8F0 RET Z
B8F1 CP $05 The effect over: clear the counter and stay silent this frame.
B8F3 JR NZ,sfx_bomb_detonate_step
B8F5 XOR A
B8F6 LD (sfx_bomb),A
B8F9 RET
sfx_bomb_detonate_step B8FA PUSH BC Preserve BC and DE for the caller.
B8FB PUSH DE
B8FC INC A Advance to the next step and store the counter back.
B8FD LD (sfx_bomb),A
B900 ADD A,A Each step of the detonation raises the base pitch.
B901 ADD A,A
B902 ADD A,A
B903 LD D,A
B904 LD A,$C8
B906 SUB D
B907 LD D,A
B908 LD C,$0A The frame's cycle count
sfx_bomb_detonate_cycle B90A CALL sound_blip Emit one cycle at the current period.
B90D RLC D Rotate the period left one bit each cycle, then loop, so the frame's burst walks eight values.
B90F DEC C
B910 JR NZ,sfx_bomb_detonate_cycle
B912 POP DE
B913 POP BC
B914 RET
← B8DC Sound effect: brick survives the hit Map B915 → Sound effect: bat grows
Fork me on GitHub