![]() |
Routines |
| Prev: C00A | Up: Map | Next: C058 |
|
Used by the routine at Handler_UserInput.
Handles the user pressing delete.
|
||||||||
|
Test if the current position in the command buffer is at the start (BD34) of the buffer.
|
||||||||
| UserInput_Delete | C041 | EX DE,HL | Jump back to UserInput_Loop if the user is already at the beginning of the command buffer. | |||||
| C042 | LD HL,$BD34 | |||||||
| C045 | AND A | |||||||
| C046 | SBC HL,DE | |||||||
| C048 | EX DE,HL | |||||||
| C049 | JR Z,UserInput_Loop | |||||||
|
Else delete the current character.
|
||||||||
| C04B | PUSH HL | Stash the pointer to the command buffer on the stack. | ||||||
|
Print "BACKSPACE SPACE BACKSPACE" to move the current print position on the screen to the previous character, and to delete the charactr present using a space.
|
||||||||
| C04C | LD HL,$BD88 | HL=Messaging_BackspaceSpaceBackspace. | ||||||
| C04F | CALL PrintString | Call PrintString. | ||||||
| C052 | POP HL | Restore the pointer to the command buffer from the stack. | ||||||
|
Now adjust the command buffer pointer to match the new position.
|
||||||||
| C053 | DEC HL | Decrease the pointer to the command buffer by one. | ||||||
| C054 | LD (HL),$20 | Write an ASCII space (20) into the command buffer at the current position. | ||||||
| C056 | JR UserInput_Loop | Jump to UserInput_Loop. | ||||||
| Prev: C00A | Up: Map | Next: C058 |