![]() |
Routines |
| Prev: 24827 | Up: Map | Next: 24859 |
|
Used by the routine at HandlerCar.
Steps through the first 1024 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 | 24838 | LD HL,0 | Point HL at the start of the ROM, which is the source of the noise. | |
| 24841 | LD BC,1024 | Set the byte counter to 1024. | ||
| PlayNoise_Loop | 24844 | LD A,(HL) | Fetch the next ROM byte. | |
| 24845 | INC HL | Move on to the next ROM byte. | ||
| 24846 | AND %00010000 | Keep only bit 4. | ||
| 24848 | JR Z,PlayNoise_Next | Jump to PlayNoise_Next if bit 4 is not set. | ||
| 24850 | CALL PlaySound | Flip the speaker using PlaySound. | ||
| PlayNoise_Next | 24853 | DEC BC | Decrease the byte counter by one. | |
| 24854 | LD A,B | Loop back to PlayNoise_Loop until all 1024 bytes have been used. | ||
| 24855 | OR C | |||
| 24856 | JR NZ,PlayNoise_Loop | |||
| 24858 | RET | Return. | ||
| Prev: 24827 | Up: Map | Next: 24859 |