![]() |
Routines |
| Prev: B92D | Up: Map | Next: B94B |
|
Actor handler for type A1. 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 | B934 | DEC (IX+$01) | Decrease the counter in *IX+01 by one. | |||||||||||||||||||||||||||||||||||||
| B937 | 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 01 picks the first byte.
|
||||||||||||||||||||||||||||||||||||||||
| B939 | LD C,(IX+$01) | Set BC to the counter, to use as the index. | ||||||||||||||||||||||||||||||||||||||
| B93C | LD B,$00 | |||||||||||||||||||||||||||||||||||||||
| B93E | LD L,(IX+$02) | Fetch the pitch table address from *IX+02 into HL. | ||||||||||||||||||||||||||||||||||||||
| B941 | LD H,(IX+$03) | |||||||||||||||||||||||||||||||||||||||
| B944 | ADD HL,BC | Add the index to find the pitch for this note. | ||||||||||||||||||||||||||||||||||||||
| B945 | LD C,(HL) | Fetch the pitch into C. | ||||||||||||||||||||||||||||||||||||||
|
Play the note, repeated for the number of times held in the slot.
|
||||||||||||||||||||||||||||||||||||||||
| B946 | LD D,(IX+$04) | Fetch the repeat count from *IX+04 into D. | ||||||||||||||||||||||||||||||||||||||
| B949 | JR PlayWaveSequence | Jump to PlayWaveSequence to play the note D times. | ||||||||||||||||||||||||||||||||||||||
| Prev: B92D | Up: Map | Next: B94B |