![]() |
Routines |
| Prev: C5CE | Up: Map | Next: C656 |
|
Used by the routine at MENU.
The menu (MENU) calls this every time round its loop. TUNE_PLAYED remembers that the tune has been played, so it plays only the first time; a new game clears it with the rest of the variables, so it plays again when the menu comes back. Before each note the whole keyboard is read, and any key stops the tune at once. The same routine as Alien 8's and Pentagram's.
|
||||||||
| PLAY_TUNE_ONCE | C63D | LD HL,TUNE_PLAYED | played already: done | |||||
| C640 | LD A,(HL) | |||||||
| C641 | AND A | |||||||
| C642 | RET NZ | |||||||
| C643 | SET 0,(HL) | not again | ||||||
| PLAY_TUNE_ONCE_0 | C645 | XOR A | A = 0 reads every half-row at once: any key stops it | |||||
| C646 | CALL READ_KEYS | |||||||
| C649 | JR Z,PLAY_TUNE_ONCE_1 | |||||||
| C64B | RET | |||||||
| PLAY_TUNE_ONCE_1 | C64C | LD A,(DE) | $FF ends the tune; play a note, and look at the keys again | |||||
| C64D | CP $FF | |||||||
| C64F | JR Z,PLAY_TUNE_0 | |||||||
| C651 | CALL PLAY_NOTE | |||||||
| C654 | JR PLAY_TUNE_ONCE_0 | |||||||
| Prev: C5CE | Up: Map | Next: C656 |