Prev: B1F9 Up: Map Next: B237
B200: Handler: User Input
Used by the routines at HandlerUnknownWord and GameLoop.
Read a command, tokenise it, and reject words the game does not know.
HandlerUserInput B200 CALL SetDefaultScreenPosition Call SetDefaultScreenPosition to park the cursor on the default line.
B203 LD HL,$AEFC Point HL at the command buffer.
B206 LD A,$20 Fill the command buffer with spaces.
B208 LD B,$32
HandlerUserInput_Loop B20A LD (HL),A Store A at the buffer pointer.
B20B INC HL Advance HL to the next byte.
B20C DJNZ HandlerUserInput_Loop Count down B and repeat from HandlerUserInput_Loop until the count is exhausted.
B20E CALL PrintInputPrompt Call PrintInputPrompt to print the input prompt.
B211 LD HL,$AEFC Point HL at the command buffer.
This entry point is used by the routine at HandlerUserPressedDELETE.
Handler_UserInput_ReadKey B214 CALL GetUserInput Call GetUserInput to read the player's key.
B217 CP $0C Branch to HandlerUserPressedDELETE when the player pressed DELETE.
B219 JR Z,HandlerUserPressedDELETE
B21B CP $0D Branch to HandlerUserPressedENTER when the player pressed ENTER.
B21D JR Z,HandlerUserPressedENTER
B21F CP $20 Branch to Handler_UserInput_ReadKey unless the player pressed SPACE.
B221 JR C,Handler_UserInput_ReadKey
B223 EX DE,HL Move the buffer position into DE so it can be checked against the end of the command buffer.
B224 LD HL,$AF2D Ignore a space once the command fills the buffer.
B227 AND A
B228 SBC HL,DE
B22A EX DE,HL
B22B JR Z,Handler_UserInput_ReadKey
B22D LD (HL),A Store A at the buffer pointer.
B22E CALL SwitchToNormalScreenOutput Call SwitchToNormalScreenOutput to switch to the normal screen output.
B231 CALL PrintCharacter Call PrintCharacter to print the character.
B234 INC HL Advance HL to the next byte.
B235 JR Handler_UserInput_ReadKey Read the next key at Handler_UserInput_ReadKey.
Prev: B1F9 Up: Map Next: B237