Prev: B200 Up: Map Next: B24E
B237: Handler: User Pressed "DELETE"
Used by the routine at HandlerUserInput.
Rub out the last character of the command when the player presses DELETE.
Input
HL Current position in the command buffer
HandlerUserPressedDELETE B237 EX DE,HL See whether the cursor is still on the first character.
B238 LD HL,$AEFC
B23B AND A
B23C SBC HL,DE
B23E EX DE,HL
B23F JR Z,Handler_UserInput_ReadKey Ignore DELETE at the start of the command.
Else delete the current character.
B241 PUSH HL Keep the pointer to the command buffer on the stack.
B242 LD HL,$AF50 Rub out the last character.
B245 CALL PrintString
B248 POP HL Restore the pointer to the command buffer from the stack.
Now adjust the command buffer pointer to match the new position.
B249 DEC HL Decrease the pointer to the command buffer by one.
B24A LD (HL),$20 Write an ASCII space (20) into the command buffer at the current position.
B24C JR Handler_UserInput_ReadKey Read the next key.
View the equivalent code in;
Prev: B200 Up: Map Next: B24E