| ← B873 | Map | B898 → |
B883: Sound effect: the orb spits the ball
|
The sound when the orb spits out the ball it chewed.
|
||||
| orb_spit_timer | B883 | DEFB $00 | Orb-spit sound delay: 0 when idle, otherwise one more than the ticks left before the sound, 2 to 5 | |
|
|
||||
| sfx_orb_spit | B884 | PUSH DE | Preserve the caller's BC and DE. | |
| B885 | PUSH BC | |||
| B886 | LD D,$64 | The first period doubles as the cycle count. | ||
| B888 | LD C,D | |||
| orb_spit_loop | B889 | CALL sound_blip | Emit one square-wave cycle at the current period. | |
| B88C | DEC D | Step the period down; halfway through the run it underflows past 0 and carries on from the top. | ||
| B88D | DEC D | |||
| B88E | DEC C | |||
| B88F | JR NZ,orb_spit_loop | |||
| B891 | POP BC | |||
| B892 | POP DE | |||
| B893 | XOR A | Return the delay timer to idle. | ||
| B894 | LD (orb_spit_timer),A | |||
| B897 | RET | |||
| ← B873 | Map | B898 → |
