![]() |
Routines |
| Prev: 720A | Up: Map | Next: 7234 |
|
Used by the routine at PlayExplosionSound.
Makes a warble of four beeps that alternate between two notes. Nothing is played if the stage is 10 or more or is 07 or 08.
|
||||||||
| PlayWarble | 7217 | CP $10 | Return if A is 10 or more. | |||||
| 7219 | RET NC | |||||||
| 721A | CP $07 | Jump to PlayWarble_Play if A is less than 07. | ||||||
| 721C | JR C,PlayWarble_Play | |||||||
| 721E | CP $09 | Return if A is less than 09. | ||||||
| 7220 | RET C | |||||||
| PlayWarble_Play | 7221 | AND %00001111 | Keep the bits of A that are set in 0F. | |||||
| 7223 | ADD A,A | Double the stage to spread the two notes. | ||||||
| 7224 | ADD A,$48 | Add the base pitch of the warble. | ||||||
| 7226 | LD B,A | That is the first half-period. | ||||||
| 7227 | LD C,$04 | The warble is four beeps. | ||||||
| PlayWarble_Loop | 7229 | LD A,B | Start from the current half-period. | |||||
| 722A | XOR %00101010 | Flip the bits of A that are set in 2A. | ||||||
| 722C | LD B,A | Keep the note for the next beep. | ||||||
| 722D | CALL PlaySquareWave | Call PlaySquareWave. | ||||||
| 7230 | DEC C | One beep of the warble has been played. | ||||||
| 7231 | JR NZ,PlayWarble_Loop | Jump to PlayWarble_Loop if the zero flag is clear. | ||||||
| 7233 | RET | Return. | ||||||
| Prev: 720A | Up: Map | Next: 7234 |