Prev: 46105 Up: Map Next: 46145
46126: Play Bump Sound
Plays four short bursts of a tone, whose pitches come from the first four bytes of the ROM, for a ball hitting the floor.
Play four bursts of three beeps.
PlayBumpSound 46126 LD HL,0 Point HL at the start of the ROM.
46129 LD E,4 Set the number of bursts to play.
PlayBumpSound_NextBurst 46131 LD C,3 Set the number of cycles of each burst.
46133 LD A,(HL) Fetch the next byte of the ROM.
46134 INC HL Move on to the next one.
46135 OR %11000000 Make it a high pitch by setting its top two bits.
46137 LD B,A Set B to the pitch.
46138 CALL PlayWaveSequence Play the tone.
46141 DEC E Decrease the burst counter and loop back to PlayBumpSound_NextBurst until all of the bursts have been played.
46142 JR NZ,PlayBumpSound_NextBurst
46144 RET Return.
View the equivalent code in;
Prev: 46105 Up: Map Next: 46145