| Routines

26426: Get the ASCII code of the last key pressed

Used by the routines at 46824, 47080, 62771, 62938 and 63352. 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.
26426 | CALL 26584 | Get input from the Kempston joystick if it's in use
This entry point is used by the routines at 26784 and 64073.
26429 | BIT 5,(HL) | Check bit 5 of 23611, which will be set if a key was pressed; reset bit 5 afterwards
26431 | RES 5,(HL)
26433 | RET Z | Return with the zero flag set if no key was pressed
26434 | LD A,(23560) | Get the code of the last key pressed
26437 | CP 13 | Was it ENTER?
26439 | JR Z,26445 | Jump if so
26441 | CP 32 | Return with the zero flag reset if the last key pressed had an ASCII code between 32 and 127 inclusive (or it was ENTER)
26443 | JR C,26448
26445 | CP 128
26447 | RET C
26448 | 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 26624. It is called from the main loop at 26471 whenever a non-game key is pressed.
26449 | RET |