![]() |
Routines |
| Prev: 49250 | Up: Map | Next: 49293 |
|
Used by the routine at PrintMessage.
Makes a burst of noise, made of four short tones with pitches that come from bytes of the ROM picked at random.
|
||||
| MakeExplosionSound | 49266 | LD A,R | Pick a random page of the ROM... | |
| 49268 | AND 31 | |||
| 49270 | LD H,A | |||
| 49271 | LD A,(38423) | ...and a random place in it. | ||
| 49274 | LD L,A | |||
| 49275 | LD E,4 | There are four tones. | ||
| MakeExplosionSound_Loop | 49277 | LD A,(HL) | Fetch a byte of the ROM, and move on to the next one. | |
| 49278 | INC HL | |||
| 49279 | AND 127 | Keep the lower seven bits of it. | ||
| 49281 | OR 143 | Make sure that the pitch is at least 143. | ||
| 49283 | LD B,A | Use it as the pitch. | ||
| 49284 | LD C,1 | Each tone is made of one cycle. | ||
| 49286 | CALL PlayWaveSequence | Make the tone using PlayWaveSequence. | ||
| 49289 | DEC E | Loop back until all four tones have been made. | ||
| 49290 | JR NZ,MakeExplosionSound_Loop | |||
| 49292 | RET | Return. | ||
| Prev: 49250 | Up: Map | Next: 49293 |