![]() |
Routines |
| Prev: 26661 | Up: Map | Next: 26708 |
|
Used by the routine at TestFlourCollision.
Plays a tone which rises in pitch. The more actors there are in play (ActorsInPlay), the longer the tone. The audio is for 4 actors in play.
|
||||
| PlayRisingTone | 26686 | LD A,(24347) | Fetch the number of actors in play. | |
| 26689 | RLCA | Multiply by 8 (rotating the bits). | ||
| 26690 | RLCA | |||
| 26691 | RLCA | |||
| 26692 | OR %00000111 | Set bits 0-2. | ||
| 26694 | LD C,A | Set the cycle counter; the more actors in play, the longer the tone. | ||
| PlayRisingTone_Loop | 26695 | LD A,C | Fetch the cycle counter. | |
| 26696 | XOR %01000000 | Flip bit 6. | ||
| 26698 | LD D,A | Use the result as the period. | ||
| 26699 | CALL PlaySquareWave | Play a cycle using PlaySquareWave. | ||
| 26702 | DEC C | Decrease the cycle counter by one. | ||
| 26703 | RET Z | Return if all of the cycles have been played. | ||
| 26704 | DEC C | Decrease the cycle counter by one. | ||
| 26705 | RET Z | Return if all of the cycles have been played. | ||
| 26706 | JR PlayRisingTone_Loop | Jump back to PlayRisingTone_Loop to play the next cycle. | ||
| Prev: 26661 | Up: Map | Next: 26708 |