Sherlock: annotated disassembly

Routines

Prev: D113 Up: Map Next: D1B2
D182: Print a room's description
HL = the room's own description text (+7/+8 of its record); if it has none, the opening from D0DD with the room's name (D1C6) and a full stop. D1B2 is the brief version for a room already visited, adding 'IT IS TOO DARK TO SEE MUCH ELSE.' (68C1) when dark.
Input
HL The room's own text, or 0
DE The opening message
Output
The description printed
D182 LD A,H Copy H into A - The room has its own text: print that (A59F)
D183 OR L Set in A the bits that are set in L
D184 JP NZ,$A59F If the result is not zero, go back to the routine "Print the message at HL" (A59F)
This entry point is used by the routine at D1B2.
D187 EX DE,HL Swap DE and HL - Otherwise the opening line (D0DD's message at DE)...
D188 LD A,($A036) Read $A036 in "Game variables" into A
D18B PUSH AF Save AF on the stack
D18C LD A,($A036) Read $A036 in "Game variables" into A - ...as seen from inside whatever the actor is in (C863): a cab, say
D18F CALL $C863 Call the routine "Is thing number A here? (C86E)" (C863)
D192 EX AF,AF' Swap AF with the shadow copy
D193 INC A Add one to A
D194 JR Z,$D19F If A has become zero, skip ahead to D19F
D196 DEC A Subtract one from A
D197 LD ($A036),A Store A in $A036 in "Game variables"
D19A LD A,$01 Load A with $01 - (with THE for its name: A2AA)
D19C LD ($A2AA),A Store A in "Use THE: a flag for the article printer (A7F2)" (A2AA)
D19F CALL $A59F Call the routine "Print the message at HL" (A59F)
D1A2 POP AF Restore AF from the stack - Then the room's name (D1C6) and a full stop
D1A3 LD ($A036),A Store A in $A036 in "Game variables"
D1A6 XOR A Clear A to zero (and the carry flag)
D1A7 LD ($A2AA),A Store A in "Use THE: a flag for the article printer (A7F2)" (A2AA)
D1AA CALL $D1C6 Call the routine "Print room IX's name (its name words at +1)" (D1C6)
D1AD LD A,$2E Load A with $2E
D1AF JP $A9B7 Go back to the routine "Print character A, a word at a time (word wrap)" (A9B7)
Prev: D113 Up: Map Next: D1B2