Sherlock: annotated disassembly

Routines

Prev: AFE1 Up: Map Next: B01C
AFFA: Handlers for BECAUSE / THEREFORE, PRINT and NOPRINT
TAKE LAMP BECAUSE EXAMINE LAMP and DROP LAMP THEREFORE INVENTORY both give 'WHAT ?' - the guards at AFE1/AFE8 turn them away in a command - while TAKE LAMP, EXAMINE LAMP does both commands, the comma being the sentence break (ACCC).
Input
E Parse flags
Output
Carries on in the parser
AFFA LD D,$A0 Load D with $A0 - BECAUSE / THEREFORE: D = $A0 (the comma class), continue as a comma (ACCC)
AFFC JP $ACCC Go back to the routine "Note where this sentence started, so it can be..." (ACCC)
AFFF CALL $AFE1 PRINT: the sentence-start guard (AFE1)
B002 CALL $C03B Read the printer status (C03B)
B005 JR NZ,$B015 NZ: leave $A008 alone
B007 LD A,$01 Load A with $01 - Printer there: $A008 = 1 (printing on)
B009 JR $B012 Skip ahead to B012
B00B CALL $AFE1 NOPRINT: the same guard
B00E CALL $A296 Clear the text window (A296)
B011 XOR A Clear A to zero (and the carry flag) - $A008 = 0 (printing off)
B012 LD ($A008),A Store A in $A008 in "Game variables"
This entry point is used by the routines at B01C and B0C6.
B015 LD A,($A02D) Read $A02D in "Game variables" into A - Carry on with the sentence: D = $A02D, back into the parser (AAC4)
B018 LD D,A Copy A into D
B019 JP $AAC4 Go back to AAC4
Prev: AFE1 Up: Map Next: B01C