![]() |
Routines |
| Prev: BFCD | Up: Map | Next: BFF4 |
|
Used by the routine at MainLoop.
Called once a frame. If a sound effect is playing, one tone of it is made and the counter is counted down. An effect is started by storing a length and an effect number at SoundEffect.
|
|||||||||||||||||||
| PlaySoundStep | BFDA | LD HL,$9688 | Point at the tone counter. | ||||||||||||||||
| BFDD | LD A,(HL) | Return if no sound effect is playing. | |||||||||||||||||
| BFDE | AND A | ||||||||||||||||||
| BFDF | RET Z | ||||||||||||||||||
| BFE0 | DEC (HL) | Count it down. | |||||||||||||||||
| BFE1 | EX AF,AF' | Keep the old counter in A'. | |||||||||||||||||
| BFE2 | INC HL | Point at the effect number, which is not loaded. | |||||||||||||||||
| BFE3 | LD BC,$BFF4 | Point at the table of pitch lists. | |||||||||||||||||
| BFE6 | CALL GetTableEntry | Choose a pitch list with GetTableEntry, using A' as the index. | |||||||||||||||||
| BFE9 | EX AF,AF' | Fetch the old counter. | |||||||||||||||||
| BFEA | LD C,A | Use the old counter as the offset... | |||||||||||||||||
| BFEB | LD B,$00 | ||||||||||||||||||
| BFED | ADD HL,BC | ...and add it to the address. | |||||||||||||||||
| BFEE | LD B,(HL) | Fetch the pitch. | |||||||||||||||||
| BFEF | LD C,$0C | The tone is made of 0C cycles. | |||||||||||||||||
| BFF1 | JP PlayWaveSequence | Make the tone using PlayWaveSequence. | |||||||||||||||||
|
View the equivalent code in;
|
|||||||||||||||||||
| Prev: BFCD | Up: Map | Next: BFF4 |