Sherlock: annotated disassembly

Routines

Prev: CA76 Up: Map Next: CA9E
CA7F: If the player's own view changed, describe the room
When the room seen by the player ($A009) is no longer the player's room, the room is described as if the player were the actor (CA9E): in full the first time (D102, which also sets bit 6 of the room record: visited), briefly after that (D1B2).
Output
The room described if the player's view has changed
CA7F LD A,($9860) Read "The actor table: who acts, and where each is in..." (9860) into A - The player's room (+15) against $A009: equal, return
CA82 CALL $D237 Call the routine "Resolve an id (in A) to its full entity record" (D237)
CA85 LD A,($A009) Read the room the player is in, which decides what is shown ($A009) into A
CA88 CP (IX+$0F) Compare A with byte +15 of the record at IX
CA8B RET Z If A equals byte +15 of the record at IX, return
CA8C LD A,($A036) Read $A036 in "Game variables" into A - Otherwise, as the player (the first actor, 9860), describe the room (CA9E)
CA8F PUSH AF Save AF on the stack
CA90 LD A,($9860) Read "The actor table: who acts, and where each is in..." (9860) into A
CA93 LD ($A036),A Store A in $A036 in "Game variables"
CA96 CALL $CA9E Call the routine "Describe the player's room: in full the first time,..." (CA9E)
CA99 POP AF Restore AF from the stack
CA9A LD ($A036),A Store A in $A036 in "Game variables"
CA9D RET Return to the caller
Prev: CA76 Up: Map Next: CA9E