← B915 Sound effect: bat grows Map B991 → Sound effect: safety net flash
B953: Sound effect: bat shrinks
The expanded bat shrinks back to its normal size.
bat_shrinks_pitches B953 DEFB $14,$3C Never read
B955 DEFB $1E,$23,$28,$2D,$32,$37,$3C,$41 The played periods, in even steps upward
B95D DEFB $46,$4B,$50,$55,$5A,$5F,$64
B964 DEFB $69,$6E,$7D,$C8 Never read
sfx_bat_shrinks B968 LD A,(sfx_shrink) Read the step counter; a disarmed effect has nothing to play.
B96B OR A
B96C RET Z
B96D CP $10 The counter past its last step: clear it and return. That disarms the effect.
B96F JR NZ,bat_shrinks_step
B971 XOR A
B972 LD (sfx_shrink),A
B975 RET
bat_shrinks_step B976 INC A Advance to the next step and save the counter.
B977 LD (sfx_shrink),A
B97A PUSH HL Preserve HL, DE and BC across the burst.
B97B PUSH DE
B97C PUSH BC
B97D LD E,A Index the pitch table by the new counter value; D takes this step's period byte.
B97E LD D,$00
B980 LD HL,bat_shrinks_pitches
B983 ADD HL,DE
B984 LD D,(HL)
B985 LD C,$02 Play this step's burst at its one fixed period.
bat_shrinks_emit B987 CALL sound_blip
B98A DEC C
B98B JR NZ,bat_shrinks_emit
B98D POP BC Restore HL, DE and BC and return.
B98E POP DE
B98F POP HL
B990 RET
← B915 Sound effect: bat grows Map B991 → Sound effect: safety net flash
Fork me on GitHub