← 8D9C Quit-confirmation handler (per-frame) Map 8E09 → Quit confirmation prompt
8DF9: Poll the quit key (Q)
Reads the Q key for the quit handler. That handler uses it both to raise the prompt and to wait for the key's release.
Output
A 1 if the Q key is held, 0 otherwise
poll_quit_key 8DF9 LD BC,KBD_ROW_Q_T Read the Q-T keyboard half-row and keep the 5 key bits.
8DFC IN A,(C)
8DFE AND $1F
8E00 BIT 0,A Bit 0 is the Q key (0 when pressed).
8E02 JR NZ,quit_key_up Q up: return 0.
8E04 LD A,$01 Q held: report it pressed.
8E06 RET
quit_key_up 8E07 XOR A Q not held: return 0.
8E08 RET
← 8D9C Quit-confirmation handler (per-frame) Map 8E09 → Quit confirmation prompt
Fork me on GitHub