| Routines

673A: Get the ASCII code of the last key pressed

Used by the routines at B6E8, B7E8, F533, F5DA and F778. Returns with the zero flag set if no key of interest was pressed. Otherwise returns with A holding the ASCII code of the last key pressed.
673A | CALL $67D8 | Get input from the Kempston joystick if it's in use
This entry point is used by the routines at 68A0 and FA49.
673D | BIT 5,(HL) | Check bit 5 of 5C3B, which will be set if a key was pressed; reset bit 5 afterwards
673F | RES 5,(HL)
6741 | RET Z | Return with the zero flag set if no key was pressed
6742 | LD A,($5C08) | Get the code of the last key pressed
6745 | CP $0D | Was it ENTER?
6747 | JR Z,$674D | Jump if so
6749 | CP $20 | Return with the zero flag reset if the last key pressed had an ASCII code between 0x20 and 0x7F inclusive (or it was ENTER)
674B | JR C,$6750
674D | CP $80
674F | RET C
6750 | XOR A | Set the zero flag to indicate that no key of interest was pressed
The address of this entry point appears in the table of keypress handling routines at 6800. It is called from the main loop at 6767 whenever a non-game key is pressed.
6751 | RET |