![]() |
Routines |
| Prev: B74D | Up: Map | Next: B761 |
|
Used by the routines at SCENE_TOOL, PLAY_TUNE_ONCE, GAME_ENDED, WAIT_KEY_OR_TIME, MENU, READ_CONTROLS and HANDLE_PAUSE.
Knight Lore's routine, byte for byte. The IN does the selecting on its own: IN A,($FE) puts A on the top half of the address bus, so each 0 bit in A selects a half-row, and A = 0 reads all eight at once. The CPL turns the keys' active-low bits the right way up.
The OUT before it is not needed for the read. It writes A to port A*256+$FD, which nothing on a 48K Spectrum answers; a 128K machine's paging port would decode it whenever A has bit 7 clear (see Pentagram's READ_KEYS, where that was tried). Not tried with Alien 8.
|
||||||||||||||
| READ_KEYS | B759 | OUT ($FD),A | not what selects the row: see above | |||||||||||
| B75B | IN A,($FE) | reads port A*256+$FE | ||||||||||||
| B75D | CPL | set bits now mean pressed keys; keep the five | ||||||||||||
| B75E | AND $1F | |||||||||||||
| B760 | RET | |||||||||||||
| Prev: B74D | Up: Map | Next: B761 |