Prev: 54564 Up: Map Next: 54598
54575: If key-press was enqueued then return index of last key pressed, else wait for key-press and return index
Used by the routines at 31468 and 54647.
Output
A Index of key pressed
The operand of the instruction at 54575 represents an enqueued key-press. This is modified by the instructions at 54593 and 54656.
54575 LD A,0 Load A with enqueued key index...
54577 OR A ...and if not zero...
54578 JR NZ,54584 ...then skip ahead to 54584
54580 XOR A Clear last pressed key...
54581 LD (23560),A ...
54584 HALT Wait for interrupt
54585 LD A,(23560) Load last pressed key into A...
54588 OR A ...and if this is zero (i.e. no key pressed)...
54589 JR Z,54584 ...then loop back to 54584
54591 EX AF,AF' Switch AF and AF'
54592 XOR A Set enqueued key index to zero...
54593 LD (54576),A ...
54596 EX AF,AF' Switch AF and AF'
54597 RET Return
Prev: 54564 Up: Map Next: 54598