Sherlock: annotated disassembly

Routines

Prev: A24D Up: Map Next: A277
A25D: Is thing B in the list at ($A0D8)? (only when $A011 is set)
Addresses named in the title: A0D8, $A011.
Z when $A011 is 0 or there is no list; otherwise searches it (D34E) and returns NZ if B is there. Used by $A27D.
Input
A The thing number
Output
F Z when $A011 is 0, there is no list, or the thing is not in it; NZ if it is
IX The list at ($A0D8) when there is one
A25D PUSH BC Save BC on the stack - B = thing A
A25E LD B,A Copy A into B
A25F LD A,($A011) Read $A011 in "Game variables" into A - Only when $A011 is set...
A262 AND A Test A for zero (this leaves A as it was and clears carry)
A263 JR Z,$A275 If A is zero, skip ahead to A275
A265 LD HL,($A0D8) Read A0D8 in "The main loop: one minute of game time per..." into HL - ...and there is a list at A0D8...
A268 LD A,H Copy H into A
A269 OR L Set in A the bits that are set in L
A26A JR Z,$A275 If the result is zero, skip ahead to A275
A26C PUSH HL Save HL on the stack
A26D POP IX Restore IX from the stack
A26F LD A,B Copy B into A
A270 CALL $D34E Call the routine "Find a 3-byte record by id, in a sentinel-terminated..." (D34E) - ...look A up in it (D34E): CP $FF gives Z if it is not there
A273 CP $FF Compare A with $FF
A275 POP BC Restore BC from the stack
A276 RET Return to the caller
Prev: A24D Up: Map Next: A277