Prev: D20C Up: Map Next: D22B
D20D: Print User-Defined Key
Used by the routine at SetUserDefinedKeys.
Input
A The key position
DE Pointer to the key position messaging
PrintUserDefinedKey D20D PUSH DE Stash the key position messaging pointer on the stack.
D20E LD E,A Store the current position in an offset...
D20F LD A,($D20C) Call InverseOn to highlight this key if it's the one currently in focus (i.e. if *Current_UserDefinedKey is equal to the position currently being printed).
D212 CP E
D213 CALL Z,InverseOn
D216 LD D,$00 D=00 (to finish creating the offset for the current key position using DE).
Point to the key in the user-defined key table relating to the requested key position.
D218 LD HL,$5BEB HL=UserDefinedKeys_Left+DE.
D21B ADD HL,DE
D21C EX DE,HL Exchange the DE and HL registers.
D21D LD A,(DE) Fetch the key for this position and store it in DE as an offset.
D21E LD E,A
D21F LD D,$00
Point to the relevant key in the keymap table.
D221 LD HL,$D22C HL=Table_UserDefinedKeyMap+DE.
D224 ADD HL,DE
D225 LD A,(HL) Fetch the key value from the keymap table and store it in A.
D226 RST $10 Print it to the screen using RST 10.
Print the "action" messaging to signify what this key is for, e.g. "LEFT", "RIGHT", etc...
D227 POP DE Restore the key position messaging pointer from the stack.
D228 JP PrintString Jump to PrintString.
Prev: D20C Up: Map Next: D22B