Prev: 6DD6 Up: Map Next: 6E7A
6E4F: The cursor keys, pressed first on a line, are whole moves
Used by the routine at READ_LINE.
On an empty line, 7 is N, 6 is S, 8 is E and 5 -- or 0 -- is W: the letter and a carriage return go straight into the line, so a single key moves the player. Later in the line the same code from 0 or 5 is a backspace.
Input
A The key
Output
F NZ if it was one, with the line finished
ONE_KEY_MOVES 6E4F CP $09 Which way? Anything else is an ordinary key
6E51 JR Z,ONE_KEY_MOVES_2
6E53 CP $08
6E55 JR Z,ONE_KEY_MOVES_3
6E57 CP $0A
6E59 JR Z,ONE_KEY_MOVES_1
6E5B CP $5B
6E5D RET NZ
6E5E LD A,$4E N: the letter and a carriage return, echoed
ONE_KEY_MOVES_0 6E60 LD (HL),A
6E61 INC HL
6E62 CALL PRINT_CHAR
6E65 DEC B
6E66 LD A,$0D
6E68 LD (HL),A
6E69 INC HL
6E6A DEC B
6E6B OR $01
6E6D RET
ONE_KEY_MOVES_1 6E6E LD A,$53 S, E and W
6E70 JR ONE_KEY_MOVES_0
ONE_KEY_MOVES_2 6E72 LD A,$45
6E74 JR ONE_KEY_MOVES_0
ONE_KEY_MOVES_3 6E76 LD A,$57
6E78 JR ONE_KEY_MOVES_0
Prev: 6DD6 Up: Map Next: 6E7A