Prev: C241 Up: Map Next: C25C
C24D: Sounds: Square Wave
Used by the routines at Sounds_PlaySquareWave_Loop and C263.
Input
E Duration
Sounds_SquareWave C24D LD B,E B=E.
C24E EI Enable interrupts.
Flip speaker on (set bit 4).
C24F LD A,%00010000 A=10 (speaker on = bit 4).
C251 OUT ($FE),A
Sounds_SquareWave_Loop C253 DJNZ Sounds_SquareWave_Loop Decrease counter by one and loop back to Sounds_SquareWave_Loop until counter is zero.
C255 LD B,E B=E.
Flip speaker off (unset bit 4).
C256 XOR A Speaker off.
C257 OUT ($FE),A
SquareWave_Silence_Loop C259 DJNZ SquareWave_Silence_Loop Decrease counter by one and loop back to SquareWave_Silence_Loop until counter is zero.
C25B RET Return.
Prev: C241 Up: Map Next: C25C