![]() |
Routines |
| Prev: 47405 | Up: Map | Next: 47435 |
|
Actor handler for type 161. Plays one note of a sound whose pitches are held in a table, so the sound moves on by one note each time the main loop reaches the slot.
The slot is filled by InitialiseExplosion_Copy from a template such as Explosion_Template_2, and holds:
The counter is also the index into the pitch table, and it counts down, so the table is played backwards: the last pitch is the first one heard. The pitch is the half-wave delay used by PlaySquareWave, so the larger the value the lower the note. When the counter reaches zero the sound ends and the slot is freed by EndSound.
|
||||||||||||||||||||||||||||||||||||||||
|
Count down, and end the sound when the table has been played.
|
||||||||||||||||||||||||||||||||||||||||
| TickWaveTable | 47412 | DEC (IX+1) | Decrease the counter in *IX+1 by one. | |||||||||||||||||||||||||||||||||||||
| 47415 | JR Z,EndSound | Jump to EndSound if the counter is now zero. | ||||||||||||||||||||||||||||||||||||||
|
Use the counter as an index into the pitch table to find this note. The table address is stored minus one, so that an index of 1 picks the first byte.
|
||||||||||||||||||||||||||||||||||||||||
| 47417 | LD C,(IX+1) | Set BC to the counter, to use as the index. | ||||||||||||||||||||||||||||||||||||||
| 47420 | LD B,0 | |||||||||||||||||||||||||||||||||||||||
| 47422 | LD L,(IX+2) | Fetch the pitch table address from *IX+2 into HL. | ||||||||||||||||||||||||||||||||||||||
| 47425 | LD H,(IX+3) | |||||||||||||||||||||||||||||||||||||||
| 47428 | ADD HL,BC | Add the index to find the pitch for this note. | ||||||||||||||||||||||||||||||||||||||
| 47429 | LD C,(HL) | Fetch the pitch into C. | ||||||||||||||||||||||||||||||||||||||
|
Play the note, repeated for the number of times held in the slot.
|
||||||||||||||||||||||||||||||||||||||||
| 47430 | LD D,(IX+4) | Fetch the repeat count from *IX+4 into D. | ||||||||||||||||||||||||||||||||||||||
| 47433 | JR PlayWaveSequence | Jump to PlayWaveSequence to play the note D times. | ||||||||||||||||||||||||||||||||||||||
| Prev: 47405 | Up: Map | Next: 47435 |