![]() |
Routines |
| Prev: 41090 | Up: Map | Next: 41117 |
|
Used by the routine at Handle_Sabreman_Walking.
Plays a short tone on one call in every four. Each call adds one to the sound counter (see Sound_Counter) and it returns at once unless the two low bits of the counter are zero. When it does play, it uses a half period of 64 if bit 2 of the counter is set and 96 if it is clear, and plays four cycles.
|
||||
| Play_Alternating_Tone | 41095 | LD HL,36598 | Point at the sound counter (Sound_Counter). | |
| 41098 | INC (HL) | Add one to the counter. | ||
| 41099 | LD A,(HL) | Fetch the counter. | ||
| 41100 | AND %00000011 | Keep only the two low bits of the sound counter. | ||
| 41102 | RET NZ | Return unless the sound counter is a multiple of four. | ||
| 41103 | BIT 2,(HL) | Jump to Play_Alternating_Tone_Lower if bit 2 of the counter is clear. | ||
| 41105 | JR Z,Play_Alternating_Tone_Lower | |||
| 41107 | LD BC,16388 | BC=16388 (half period 64 four cycles). | ||
| 41110 | JR SoundsBeep | Jump to SoundsBeep to play the tone. | ||
| Play_Alternating_Tone_Lower | 41112 | LD BC,24580 | BC=24580 (half period 96 four cycles). | |
| 41115 | JR SoundsBeep | Jump to SoundsBeep to play the tone. | ||
| Prev: 41090 | Up: Map | Next: 41117 |