Sherlock: annotated disassembly

Routines

Prev: DCC1 Up: Map Next: DD03
DCD2: Pre-check for moving in a direction (verbs 1-10)
Refuses (via DC15, "YOU CANNOT GO ...") when there is no usable exit that way, when the actor is inside something (sitting in an armchair - GET OUT first), or when the thing in the way stops them (DD35).
Input
$A033 The direction verb
Output
F NZ if the actor can go; otherwise the move is refused through $DC15
IX The exit
DCD2 LD A,($A033) The direction is the verb number
DCD5 CALL $D448 Call the routine "Find the actor's exit in a direction" (D448) - Find the exit
DCD8 CP $FF Compare A with $FF
DCDA JP Z,$DC15 None: "YOU CANNOT GO ..."
This entry point is used by the routine at DC19.
DCDD CALL $CBA7 Refuse if B934 bit 6 is set ("SORRY, I CANNOT DO THAT NOW")
DCE0 LD IY,($A017) The actor
DCE4 LD A,(IY+$01) Read byte +1 of the record at IY into A - Inside something?
DCE7 CP $FF Compare A with $FF
DCE9 JP NZ,$DC15 ...then they cannot walk off
DCEC LD A,(IX+$02) Read byte +2 of the record at IX into A - Destination
DCEF AND A Test A for zero (this leaves A as it was and clears carry)
DCF0 JP Z,$DC15 (0: refuse)
DCF3 LD A,(IX+$01) The thing in the way
DCF6 CALL $DD35 ...lets the actor through?
DCF9 JP NZ,$DC15 No: refuse
DCFC OR $01 Make A non-zero, which clears the zero flag, and hand that back to the caller - Yes
DCFE RET Return to the caller
DCFF NOP Do nothing (padding)
DD00 NOP Do nothing (padding)
DD01 NOP Do nothing (padding)
DD02 NOP Do nothing (padding)
Prev: DCC1 Up: Map Next: DD03