Prev: 60FB Up: Map Next: 611B
6106: Play Noise
Used by the routine at HandlerCar.
Steps through the first 0400 bytes of the ROM and flips the speaker, using PlaySound, for every byte which has bit 4 set. The ROM contents are used as a source of noise. This is the sound made when an opponent car hits an obstacle.
PlayNoise 6106 LD HL,$0000 Point HL at the start of the ROM, which is the source of the noise.
6109 LD BC,$0400 Set the byte counter to 0400.
PlayNoise_Loop 610C LD A,(HL) Fetch the next ROM byte.
610D INC HL Move on to the next ROM byte.
610E AND %00010000 Keep only bit 4.
6110 JR Z,PlayNoise_Next Jump to PlayNoise_Next if bit 4 is not set.
6112 CALL PlaySound Flip the speaker using PlaySound.
PlayNoise_Next 6115 DEC BC Decrease the byte counter by one.
6116 LD A,B Loop back to PlayNoise_Loop until all 0400 bytes have been used.
6117 OR C
6118 JR NZ,PlayNoise_Loop
611A RET Return.
Prev: 60FB Up: Map Next: 611B