![]() |
Routines |
| Prev: BEC6 | Up: Map | Next: BEDE |
|
Used by the routine at HandlerFlame.
Plays sixteen cycles of a tone, with a half-period taken from the table at FlameSoundTable. The entry used depends on the low four bits of the frame counter, which gives the flame a crackling sound.
|
||||
| PlayFlameSound | BECC | LD BC,$BEDE | Point BC at the flame sound table at FlameSoundTable. | |
| BECF | LD A,($9693) | Fetch the low byte of the game timer from GameTimer. | ||
| BED2 | AND %00001111 | Keep only bits 0-3. | ||
| BED4 | LD L,A | Use it as the offset into the table. | ||
| BED5 | LD H,$00 | |||
| BED7 | ADD HL,BC | Add the table to find the half-period. | ||
| BED8 | LD B,(HL) | Fetch the half-period of the tone from the table into B. | ||
| BED9 | LD C,$10 | Set the number of cycles in C to 10. | ||
| BEDB | JP PlayWaveSequence | Jump to PlayWaveSequence to play the sound. | ||
| Prev: BEC6 | Up: Map | Next: BEDE |