Prev: 6DD6 Up: Map Next: 6E8B
6E4F: Input: Map A Cursor Key
Used by the routine at ReadTheInputLine.
Turns a cursor key into the matching direction letter and plants ENTER after it.
Input_MapACursorKey 6E4F CP $09 Jump to Input_MapACursorKey_TurnTheRightKeyIntoE if the key is right.
6E51 JR Z,Input_MapACursorKey_TurnTheRightKeyIntoE
6E53 CP $08 Jump to Input_MapACursorKey_TurnTheLeftKeyIntoW if the key is left.
6E55 JR Z,Input_MapACursorKey_TurnTheLeftKeyIntoW
6E57 CP $0A Jump to Input_MapACursorKey_TurnTheDownKeyIntoS if the key is down.
6E59 JR Z,Input_MapACursorKey_TurnTheDownKeyIntoS
6E5B CP $5B Return if the key is not up. The up cursor is 5B.
6E5D RET NZ
6E5E LD A,$4E Turn the cursor key into the letter N.
Input_MapACursorKey_StoreTheDirectionLetter 6E60 LD (HL),A Store it at 6FF9 and step on.
6E61 INC HL
Print the character in A.
6E62 CALL Print_Character Call Print_Character to print one character.
6E65 DEC B One fewer byte of the line is free.
6E66 LD A,$0D Set the line being typed to ENTER.
6E68 LD (HL),A
6E69 INC HL Step to the next byte of the input buffer.
6E6A DEC B One fewer byte of the line is free.
6E6B OR $01 Clear the zero flag. The direction letter is followed by ENTER.
6E6D RET Return.
Input_MapACursorKey_TurnTheDownKeyIntoS 6E6E LD A,$53 Turn the cursor key into the letter S.
6E70 JR Input_MapACursorKey_StoreTheDirectionLetter Jump back to Input_MapACursorKey_StoreTheDirectionLetter to store the letter S.
Input_MapACursorKey_TurnTheRightKeyIntoE 6E72 LD A,$45 Turn the cursor key into the letter E.
6E74 JR Input_MapACursorKey_StoreTheDirectionLetter Jump back to Input_MapACursorKey_StoreTheDirectionLetter to store the letter E.
Input_MapACursorKey_TurnTheLeftKeyIntoW 6E76 LD A,$57 Turn the cursor key into the letter W.
6E78 JR Input_MapACursorKey_StoreTheDirectionLetter Jump back to Input_MapACursorKey_StoreTheDirectionLetter to store the letter W.
This entry point is used by the routine at ReadTheInputLine.
Test the fresh-game flag.
Input_MapACursorKey_ReadAnotherKeyWhenTheFlagIsSet 6E7A LD A,($B71A) Jump to ReadTheInputLine_WaitForAKey if *B71A is not zero.
6E7D AND A
6E7E JP NZ,ReadTheInputLine_WaitForAKey
Print character 08.
6E81 LD A,$08 Print a backspace.
6E83 CALL Print_Character
Print the character in A.
6E86 CALL Print_Character Call Print_Character to print one character.
6E89 XOR A Return zero.
6E8A RET Return.
View the equivalent code in;
Prev: 6DD6 Up: Map Next: 6E8B