![]() |
Routines |
| Prev: 49101 | Up: Map | Next: 49140 |
|
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 | 49114 | LD HL,38536 | Point at the tone counter. | ||||||||||||||||
| 49117 | LD A,(HL) | Return if no sound effect is playing. | |||||||||||||||||
| 49118 | AND A | ||||||||||||||||||
| 49119 | RET Z | ||||||||||||||||||
| 49120 | DEC (HL) | Count it down. | |||||||||||||||||
| 49121 | EX AF,AF' | Keep the old counter in A'. | |||||||||||||||||
| 49122 | INC HL | Point at the effect number, which is not loaded. | |||||||||||||||||
| 49123 | LD BC,49140 | Point at the table of pitch lists. | |||||||||||||||||
| 49126 | CALL GetTableEntry | Choose a pitch list with GetTableEntry, using A' as the index. | |||||||||||||||||
| 49129 | EX AF,AF' | Fetch the old counter. | |||||||||||||||||
| 49130 | LD C,A | Use the old counter as the offset... | |||||||||||||||||
| 49131 | LD B,0 | ||||||||||||||||||
| 49133 | ADD HL,BC | ...and add it to the address. | |||||||||||||||||
| 49134 | LD B,(HL) | Fetch the pitch. | |||||||||||||||||
| 49135 | LD C,12 | The tone is made of 12 cycles. | |||||||||||||||||
| 49137 | JP PlayWaveSequence | Make the tone using PlayWaveSequence. | |||||||||||||||||
|
View the equivalent code in;
|
|||||||||||||||||||
| Prev: 49101 | Up: Map | Next: 49140 |