Sherlock: annotated disassembly

Routines

Prev: B549 Up: Map Next: B568
B54A: The indirect object is a number: use it once
As B4A3, for the second slot (B549, $B179, $A035, $A031).
Output
F NZ with $A035 = $FE and $A031 the number the first time
A $FF if there is nothing to search
B54A LD A,($B549) Read "B568: $FF until the number in the..." (B549) into A - The same for the indirect object: B549 = $FF means the number is unused; otherwise the thing search (B576)
B54D INC A Add one to A
B54E JR NZ,$B576 If A is not zero, skip ahead to B576
B550 LD ($B549),A Used now
B553 LD A,($B179) Read $B179 in "Parser variables" into A - The slot's first word ($B179): bit 7 set means a number
B556 BIT 7,A Test bit 7 of A
B558 JR Z,$B576 If bit 7 of A is clear, skip ahead to B576
B55A LD A,$FE Load A with $FE - The indirect object is $FE: a number...
B55C LD ($A035),A Store A in $A035 in "Game variables"
B55F LD HL,($B178) Read $B178 in "Parser variables" into HL - ...with its value, from $B178, in $A031
B562 LD ($A031),HL Store HL in $A031 in "Game variables"
B565 OR $01 Make A non-zero, which clears the zero flag, and hand that back to the caller - NZ: a candidate
B567 RET Return to the caller
Prev: B549 Up: Map Next: B568