Prev: A0C0 Up: Map Next: A0D8
A0C5: Sound Effect Next Note
Handler for the object type 8A a sound object. Byte 01 of the object is a count, which it decreases. When the count reaches zero the object is removed. Until then it plays a tone of as many cycles as the count, with a half period that is made from the count rotated left three times, inverted and exclusive ORed with 40. No object of this type is ever created (see Unused_Start_Sound_Object_8A), so the game never plays this sound.
Input
IX Object record
SoundEffectNext A0C5 DEC (IX+$01) Decrease the count of the sound and jump to ClearSound if it has run out.
A0C8 JR Z,ClearSound
A0CA LD A,(IX+$01) Fetch the count of the sound.
A0CD LD C,A Use it as the number of cycles.
A0CE RLCA Rotate the count left three times.
A0CF RLCA
A0D0 RLCA
A0D1 CPL Invert the bits.
A0D2 XOR %01000000 Flip bit 6 to make the half period.
A0D4 LD B,A Store the half period in B.
A0D5 JP SoundsBeep Jump to SoundsBeep to play the tone.
View the equivalent code in;
Prev: A0C0 Up: Map Next: A0D8