Prev: 6973 Up: Map Next: 69A6
6985: Scan Menu Keys
Used by the routines at Read_Menu_Key and Highlight_Menu_Item.
Returns 00-03 for keys "0"-"3", 02 for Kempston fire, or FF if nothing is pressed.
Output
A Menu option, or FF if no key is pressed
Scan_Menu_Keys 6985 LD BC,$EFFE Read from the keyboard;
Port Number Bit
0 1 2 3 4
EF 0 9 8 7 6
6988 IN A,(C)
698A OR %11100000 Set bits 5-7.
698C ADD A,$02 Add 02 to the key bits.
698E RET Z Return if "0" is pressed.
698F RR B Read from the keyboard;
Port Number Bit
0 1 2 3 4
F7 1 2 3 4 5
6991 IN A,(C)
6993 LD C,A Store the key bits in C.
6994 LD B,$03 Set the key counter to 03 in B.
6996 XOR A Set the option index to 00.
Count which of keys "1"-"3" is pressed.
Scan_Menu_Keys_0 6997 INC A Increment the option index by one.
6998 RR C Return if this key is pressed.
699A RET NC
699B DJNZ Scan_Menu_Keys_0 Decrease the key counter by one and loop back to Scan_Menu_Keys_0 until all three keys have been tested.
699D CALL Read_Kempston Call Read_Kempston.
69A0 LD A,$FF Set the result to FF.
69A2 RET NC Return if fire was not pressed.
69A3 LD A,$02 Set the result to 02.
69A5 RET Return.
Prev: 6973 Up: Map Next: 69A6