![]() |
Routines |
| Prev: 29194 | Up: Map | Next: 29236 |
|
Used by the routine at PlayExplosionSound.
Makes a warble of four beeps that alternate between two notes. Nothing is played if the stage is 16 or more or is 7 or 8.
|
||||||||
| PlayWarble | 29207 | CP 16 | Return if A is 16 or more. | |||||
| 29209 | RET NC | |||||||
| 29210 | CP 7 | Jump to PlayWarble_Play if A is less than 7. | ||||||
| 29212 | JR C,PlayWarble_Play | |||||||
| 29214 | CP 9 | Return if A is less than 9. | ||||||
| 29216 | RET C | |||||||
| PlayWarble_Play | 29217 | AND %00001111 | Keep the bits of A that are set in 15. | |||||
| 29219 | ADD A,A | Double the stage to spread the two notes. | ||||||
| 29220 | ADD A,72 | Add the base pitch of the warble. | ||||||
| 29222 | LD B,A | That is the first half-period. | ||||||
| 29223 | LD C,4 | The warble is four beeps. | ||||||
| PlayWarble_Loop | 29225 | LD A,B | Start from the current half-period. | |||||
| 29226 | XOR %00101010 | Flip the bits of A that are set in 42. | ||||||
| 29228 | LD B,A | Keep the note for the next beep. | ||||||
| 29229 | CALL PlaySquareWave | Call PlaySquareWave. | ||||||
| 29232 | DEC C | One beep of the warble has been played. | ||||||
| 29233 | JR NZ,PlayWarble_Loop | Jump to PlayWarble_Loop if the zero flag is clear. | ||||||
| 29235 | RET | Return. | ||||||
| Prev: 29194 | Up: Map | Next: 29236 |