Prev: D968 Up: Map Next: D99E
D978: Map The Cursor Keys
Used by the routine at ReadCommandLine_CommandLinePrints.
Turns a cursor key into a compass letter: right (09) to E, left (08) to W, down (0A) to S and up (5B) to N.
MapCursorKeys D978 CP $09 Jump ahead to MapCursorKeys_East if the key is cursor right (09).
D97A JR Z,MapCursorKeys_East
D97C CP $08 Jump ahead to MapCursorKeys_West if the key is cursor left (08).
D97E JR Z,MapCursorKeys_West
D980 CP $0A Jump ahead to MapCursorKeys_South if the key is cursor down (0A).
D982 JR Z,MapCursorKeys_South
D984 CP $5B Return unless the key is cursor up (5B).
D986 RET NZ
D987 LD A,$4E Take N for cursor up.
MapCursorKeys_0 D989 LD (HL),A Store it at the line buffer and step to the next entry, then call Print_Character to print character.
D98A INC HL
D98B CALL Print_Character
D98E DEC B Count down the remaining steps.
D98F LD A,$0D Leave 0D as the result.
D991 RET Return.
Cursor down selects the letter S.
MapCursorKeys_South D992 LD A,$53 Take the direction letter S and go to MapCursorKeys_0 to store it in the line buffer and print it.
D994 JR MapCursorKeys_0
Cursor right selects the letter E.
MapCursorKeys_East D996 LD A,$45 Take the direction letter E and go to MapCursorKeys_0 to store it in the line buffer and print it.
D998 JR MapCursorKeys_0
Cursor left selects the letter W.
MapCursorKeys_West D99A LD A,$57 Take the direction letter W and go to MapCursorKeys_0 to store it in the line buffer and print it.
D99C JR MapCursorKeys_0
View the equivalent code in;
Prev: D968 Up: Map Next: D99E