Prev: FD9E Up: Map Next: FDDE
FDC4: Sounds: Annoying Telecast Beeping
Used by the routine at Handler_TickerNews.
Sounds_Telecast FDC4 LD B,$0A B=0A (counter).
Sounds_Telecast_Loop FDC6 CALL RandomNumber Get a random number which is either 00 or 01.
FDC9 AND %00000001
There's a 50/50 chance of playing either melody 03 or melody 07.
FDCB LD A,$07 A=melody 07.
FDCD JR Z,Sounds_Telecast_Write Jump to Sounds_Telecast_Write if the random number was 00.
FDCF LD A,$03 A=melody 03.
Sounds_Telecast_Write FDD1 LD ($FF8D),A Write melody ID to MelodyID.
FDD4 PUSH BC Stash the note counter on the stack.
FDD5 CALL PlaySounds Call PlaySounds.
FDD8 POP BC Restore the note counter from the stack.
FDD9 HALT Halt operation (suspend CPU until the next interrupt, and do this twice).
FDDA HALT
FDDB DJNZ Sounds_Telecast_Loop Decrease counter by one and loop back to Sounds_Telecast_Loop until counter is zero.
FDDD RET Return.
Prev: FD9E Up: Map Next: FDDE