Prev: 9B0C Up: Map Next: 9BCB
9BC3: Read Keyboard Port
Used by the routines at PlayMusic_WaitKey and ReadInputDevice.
Reads a row of keys, or all of them at once. The bits of the result that are set are the keys that are pressed.
Input
A Row selector (the high byte of the port address)
Output
A Keys pressed in the bottom five bits
F The zero flag is set if no key is pressed
ReadKeyboardPort 9BC3 OUT ($FD),A Output the selector to a port (this has no other effect).
9BC5 IN A,($FE) Read the row selected by A.
9BC7 CPL Invert the bits.
9BC8 AND %00011111 Keep the five bits for the keys.
9BCA RET Return.
View the equivalent code in;
Prev: 9B0C Up: Map Next: 9BCB