Prev: A3E8 Up: Map Next: A3FE
A3EF: Sound Effect
The handler of the sound entity for the sound set up by SoundsTouching. The count in the second byte of the entity is decreased on each pass of the main loop. When the count reaches zero the entity is cleared. Until then it plays a tone of as many cycles as the count, with a half period of the count exclusive ORed with 43 so the pitch changes as the count falls.
Input
IX The sound entity
SoundEffect A3EF DEC (IX+$01) Decrease the count of notes, and jump to ClearSound if there are none left.
A3F2 JR Z,ClearSound
A3F4 LD A,(IX+$01) Fetch the count and keep the number of cycles in C.
A3F7 LD C,A
A3F8 XOR %01000011 Combine the count with 43 to make the half period.
A3FA LD B,A Keep the half period in B.
A3FB JP SoundsBeep Jump to SoundsBeep to play the tone.
View the equivalent code in;
Prev: A3E8 Up: Map Next: A3FE