Prev: 46241 Up: Map Next: 46266
46249: Play Music Until Key Pressed
Used by the routine at GameOver.
Plays a tune, which stops when a key is pressed. A tune is a list of notes (see PlayNote) which ends with 255.
Input
DE Address of the tune
Stop if a key is pressed.
PlayMusic_WaitKey 46249 XOR A Select all of the keyboard rows.
46250 CALL ReadKeyboardPort Call ReadKeyboardPort.
46253 JR Z,PlayMusic_WaitKey_TestEnd Jump to PlayMusic_WaitKey_TestEnd if no key is pressed.
46255 RET Return.
Play the next note.
PlayMusic_WaitKey_TestEnd 46256 LD A,(DE) Fetch the next note.
46257 CP 255 Jump to PlayMusic_End if it is 255.
46259 JR Z,PlayMusic_End
46261 CALL PlayNote Call PlayNote.
46264 JR PlayMusic_WaitKey Jump to PlayMusic_WaitKey.
View the equivalent code in;
Prev: 46241 Up: Map Next: 46266