![]() |
Routines |
| Prev: C5CE | Up: Map | Next: C656 |
|
Used by the routine at GameMenu.
Plays a tune, but only if this routine has not played one before. Bit 0 of TunePlayedFlag is set the first time and nothing clears it. The tune stops when a key is pressed.
The tunes played by this routine are:
|
||||||||||||
|
Play only if TunePlayedFlag is clear.
|
||||||||||||
| PlayMusicOnce | C63D | LD HL,$BBC1 | Point HL at TunePlayedFlag. | |||||||||
| C640 | LD A,(HL) | Return if TunePlayedFlag is set. | ||||||||||
| C641 | AND A | |||||||||||
| C642 | RET NZ | |||||||||||
| C643 | SET 0,(HL) | Set bit 0 of TunePlayedFlag. | ||||||||||
|
Stop if a key is pressed.
|
||||||||||||
| PlayMusicOnce_Loop | C645 | XOR A | Select all of the keyboard rows. | |||||||||
| C646 | CALL ReadKeyboardPort | Call ReadKeyboardPort. | ||||||||||
| C649 | JR Z,PlayMusicOnce_Note | Jump to PlayMusicOnce_Note if no key is pressed. | ||||||||||
| C64B | RET | Return. | ||||||||||
|
Play the next note.
|
||||||||||||
| PlayMusicOnce_Note | C64C | LD A,(DE) | Fetch the next note. | |||||||||
| C64D | CP $FF | Jump to PlayMusic_Return if it is FF. | ||||||||||
| C64F | JR Z,PlayMusic_Return | |||||||||||
| C651 | CALL PlayNote | Call PlayNote. | ||||||||||
| C654 | JR PlayMusicOnce_Loop | Jump to PlayMusicOnce_Loop. | ||||||||||
|
View the equivalent code in;
|
||||||||||||
| Prev: C5CE | Up: Map | Next: C656 |