Prev: 41960 Up: Map Next: 41982
41967: 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 67 so the pitch changes as the count falls.
Input
IX The sound entity
SoundEffect 41967 DEC (IX+1) Decrease the count of notes, and jump to ClearSound if there are none left.
41970 JR Z,ClearSound
41972 LD A,(IX+1) Fetch the count and keep the number of cycles in C.
41975 LD C,A
41976 XOR %01000011 Combine the count with 67 to make the half period.
41978 LD B,A Keep the half period in B.
41979 JP SoundsBeep Jump to SoundsBeep to play the tone.
View the equivalent code in;
Prev: 41960 Up: Map Next: 41982