Sherlock: annotated disassembly

Routines

Prev: A35D Up: Map Next: A37D
A360: Code $18: narrate the remembered command
Narrates the command at A35D (A37D) with the actor ($A036) set to 0 for the duration; if the actor was that command's direct object, the direct object is set to 0 as well. 0 is the player, YOU.
Output
F Z
IX Changed
A360 LD A,($A036) Read $A036 in "Game variables" into A - Keep the current actor; compare it with the remembered one (A35E)
A363 PUSH AF Save AF on the stack
A364 LD HL,$A35E Point HL at A35E in "A remembered command: verb, direct object,..."
A367 CP (HL) Compare A with the byte at A35E in "A remembered command: verb, direct object,..."
A368 LD A,$00 Load A with $00 - A = 0, the player: not the remembered actor - narrate as the player
A36A JR NZ,$A36D If A differs from the byte at A35E in "A remembered command: verb, direct object,...", skip ahead to A36D
A36C LD (HL),A The same: forget the remembered actor (A35E = 0)
A36D LD ($A036),A Store A in $A036 in "Game variables" - Either way the actor is 0 while the remembered command is narrated (A37D)
A370 PUSH IX Save IX on the stack
A372 CALL $A37D Call the routine "Print the rest of a narrated command: verb words,..." (A37D)
A375 POP IX Restore IX from the stack
A377 POP AF Restore AF from the stack - Restore the actor; return Z
A378 LD ($A036),A Store A in $A036 in "Game variables"
A37B XOR A Set A to zero, which sets the zero flag for the caller
A37C RET Return to the caller
Prev: A35D Up: Map Next: A37D