![]() |
Routines |
| Prev: C400 | Up: Map | Next: C455 |
|
Used by the routine at UpdateBurst.
Plays sixteen tones with pitches taken from a random place in the ROM, if the object at IX has been drawn in the view (bit 1 of its flags).
|
||||||||
| PlayRandomSound | C435 | BIT 1,(IX+$07) | Return if the object has not been drawn in the view, otherwise clear the flag. | |||||
| C439 | RES 1,(IX+$07) | |||||||
| C43D | RET Z | |||||||
| C43E | LD HL,($BBAA) | Fetch the random number. | ||||||
| C441 | LD A,H | Turn it into the address of a random place in the first 2000 bytes of the ROM. | ||||||
| C442 | AND $1F | |||||||
| C444 | LD H,A | |||||||
| C445 | LD E,$10 | Set a counter for sixteen tones. | ||||||
| PlayRandomSound_Loop | C447 | LD A,(HL) | Play a short tone, with a pitch taken from the ROM, and loop back until all sixteen tones have been played. | |||||
| C448 | INC HL | |||||||
| C449 | AND $7F | |||||||
| C44B | LD B,A | |||||||
| C44C | LD C,$01 | |||||||
| C44E | CALL PlayTone | |||||||
| C451 | DEC E | |||||||
| C452 | JR NZ,PlayRandomSound_Loop | |||||||
| C454 | RET | Return. | ||||||
| Prev: C400 | Up: Map | Next: C455 |