Sherlock: annotated disassembly

Routines

Prev: D897 Up: Map Next: D8AD
D898: Read a line from the keyboard, with a time limit
The pre-check of the player's first script step (D6BF). Sets the limit ($A03B = 3,000 polls), switches quoted printing on while the line is typed, and runs the line editor (D8AD). If the player stops typing for too long the editor gives up, the step fails, and the player's script does WAIT HERE instead (9948) - so the clock and the other characters carry on while the player thinks.
Leaving the prompt with no key pressed gives '> You wait.' and the clock runs on from 8:02 to 8:05, then again to 8:10, with no command typed.
Output
F Z if nothing was typed in time; NZ if a line was typed
D898 LD HL,$0BB8 Load HL with $0BB8 - The time limit ($A03B) = $0BB8 = 3000
D89B LD ($A03B),HL Store HL in $A03B in "Game variables"
D89E LD A,$01 Load A with $01 - $A027 = 1 while the line is read (D8AD)...
D8A0 LD ($A027),A Store A in $A027 in "Game variables"
D8A3 CALL $D8AD Call the routine "The line editor" (D8AD)
D8A6 PUSH AF Save AF on the stack
D8A7 XOR A Clear A to zero (and the carry flag)
D8A8 LD ($A027),A Store A in $A027 in "Game variables" - ...and 0 afterwards, keeping the result
D8AB POP AF Restore AF from the stack
D8AC RET Return to the caller
Prev: D897 Up: Map Next: D8AD