Sherlock: annotated disassembly

Routines

Prev: E5AD Up: Map Next: E5D8
E5C1: Action record: is the player in my room? (RUN at $E781)
Addresses named in the title: E781.
Compares the room of the first actor in the table (the player, 9860) with the current actor's and goes on to E5F0, which refuses if they differ (and if the actor is the direct object). It is used in Watson's script (actor 3, E72F, at E781).
Input
$A017 The thing to compare with
Output
F From $E5F0: NZ if the player is in the same room
E5C1 DEFB $00,$00 Action record header: flags $00; byte 1 $00
E5C3 LD A,($9860) The first actor in the table (9860, the player)...
E5C6 CALL $D237 Call the routine "Resolve an id (in A) to its full entity record" (D237) - ...its record (D237): its room (+15)
E5C9 LD A,(IX+$0F) Read byte +15 of the record at IX into A
E5CC LD IX,($A017) Read $A017 in "Game variables" into IX - Compare with the room of the thing at ($A017)
E5D0 CP (IX+$0F) Compare A with byte +15 of the record at IX
E5D3 LD A,($A036) Read $A036 in "Game variables" into A - The current actor into A; on to E5F0
E5D6 JR $E5F0 Skip ahead to E5F0
Prev: E5AD Up: Map Next: E5D8