![]() |
Routines |
| Prev: BF08 | Up: Map | Next: BF25 |
|
Used by the routines at HandlerSleepingHippoWarthog, HandlerGuardian, HandlerTribesman and KnockBackRhino.
Plays 30 tones, using PlaySquareWave. The pitch of each one is worked out from a counter which counts down from 30 which gives a warbling sound.
|
||||
| PlayWarbleSound | BF17 | LD C,$30 | Set the number of tones in C to 30. | |
| PlayWarbleSound_Loop | BF19 | LD A,C | Fetch the tone counter. | |
| BF1A | OR %00011000 | Set bits 3-4. | ||
| BF1C | DAA | Decimal adjust the result, so the pitch jumps about. | ||
| BF1D | LD B,A | Store the result in B (the half-period). | ||
| BF1E | CALL PlaySquareWave | Play the tone. | ||
| BF21 | DEC C | Decrease the tone counter by one and loop back to PlayWarbleSound_Loop until all of the tones have been played. | ||
| BF22 | JR NZ,PlayWarbleSound_Loop | |||
| BF24 | RET | Return. | ||
| Prev: BF08 | Up: Map | Next: BF25 |