Prev: 6099 Up: Map Next: 60FB
60E3: Sounds: Bounce
Used by the routines at BounceY and BounceX.
Plays eight groups of four square waves using PlaySquareWave. The period of each group comes from one of the first eight bytes of the ROM, with bit 7 set (so the period is never less than 80). This is the sound made when the car reaches the edge of the map.
SoundsBounce 60E3 LD HL,$0000 Point HL at the start of the ROM, which supplies the periods of the waves.
60E6 LD C,$08 Set the group counter to 08 one for each group of waves.
SoundsBounce_Loop 60E8 LD E,$04 Set the wave counter to 04 for the waves in each group.
60EA LD A,(HL) Fetch the next ROM byte.
60EB INC HL Move on to the next ROM byte.
60EC AND %01111111 Keep only bits 0-6.
60EE OR %10000000 Set bit 7.
60F0 LD D,A Set the period of the waves in this group.
SoundsBounce_Play 60F1 CALL PlaySquareWave Play a square wave using PlaySquareWave.
60F4 DEC E Decrease the wave counter by one and loop back to SoundsBounce_Play until all of the waves in the group have been played.
60F5 JR NZ,SoundsBounce_Play
60F7 DEC C Decrease the group counter by one and loop back to SoundsBounce_Loop until all of the groups have been played.
60F8 JR NZ,SoundsBounce_Loop
60FA RET Return.
View the equivalent code in;
Prev: 6099 Up: Map Next: 60FB