← B8A7 Sound effect: brick hit Map B8DC → Sound effect: brick survives the hit
B8B7: Sound effect: brick destroyed
The sound of a brick hit that shatters the brick to an empty slot.
sfx_brick_destroyed B8B7 PUSH DE
B8B8 PUSH BC
B8B9 LD D,$14 The first pass's base period; each pass steps it down from here.
B8BB LD B,$07 One pass per step of the run
sfx_brick_destroyed_pass B8BD PUSH DE Save the current pass's base period and the pass counter.
B8BE PUSH BC
B8BF LD C,$03 The pass's first burst, at the base period
sfx_brick_destroyed_lo B8C1 CALL sound_blip
B8C4 DEC C
B8C5 JR NZ,sfx_brick_destroyed_lo
B8C7 LD A,D Shorten the period for the pass's second burst.
B8C8 SUB $05
B8CA LD D,A
B8CB LD C,$03 The pass's second burst, at the shortened period
sfx_brick_destroyed_hi B8CD CALL sound_blip
B8D0 DEC C
B8D1 JR NZ,sfx_brick_destroyed_hi
B8D3 POP BC Restore the current pass's base period and counter.
B8D4 POP DE
B8D5 DEC D Step the base period down for the next pass.
B8D6 DEC D
B8D7 DJNZ sfx_brick_destroyed_pass Loop back for the next pass.
B8D9 POP BC Hand the caller's registers back.
B8DA POP DE
B8DB RET
← B8A7 Sound effect: brick hit Map B8DC → Sound effect: brick survives the hit
Fork me on GitHub