Prev: C08D Up: Map Next: C0B6
C0AB: Read Keys
Input
A High byte of the port (zero reads every half row)
Output
A The keys that are pressed, in bits 0 to 4
F Zero flag set if no keys are pressed
ReadKeys C0AB PUSH BC Save BC.
C0AC LD C,$FE Set up the port.
C0AE LD B,A
C0AF IN A,(C) Read the keys.
C0B1 POP BC Restore BC.
C0B2 CPL Make a set bit mean that a key is pressed...
C0B3 AND $1F ...and keep only the bits of the five keys.
C0B5 RET Return.
Prev: C08D Up: Map Next: C0B6