![]() |
Routines |
| Prev: 48904 | Up: Map | Next: 48933 |
|
Used by the routines at HandlerSleepingHippoWarthog, HandlerGuardian, HandlerTribesman and KnockBackRhino.
Plays 48 tones, using PlaySquareWave. The pitch of each one is worked out from a counter which counts down from 48 which gives a warbling sound.
|
||||
| PlayWarbleSound | 48919 | LD C,48 | Set the number of tones in C to 48. | |
| PlayWarbleSound_Loop | 48921 | LD A,C | Fetch the tone counter. | |
| 48922 | OR %00011000 | Set bits 3-4. | ||
| 48924 | DAA | Decimal adjust the result, so the pitch jumps about. | ||
| 48925 | LD B,A | Store the result in B (the half-period). | ||
| 48926 | CALL PlaySquareWave | Play the tone. | ||
| 48929 | DEC C | Decrease the tone counter by one and loop back to PlayWarbleSound_Loop until all of the tones have been played. | ||
| 48930 | JR NZ,PlayWarbleSound_Loop | |||
| 48932 | RET | Return. | ||
| Prev: 48904 | Up: Map | Next: 48933 |