Sherlock: annotated disassembly

Routines

Prev: C41F Up: Map Next: C471
C45E: Is B below the last number for this object slot?
Carry when B is below 106 if the slot's requirement code ($A010, or $A00F when entered at C463) is below 5, or below 110 if it is 5 or more - 106 and 110 being one past the last room and the last thing. Used by the guessing loops C55A and C60D.
Input
B The candidate number
Output
F Carry when it is within the allowed range (below 106 for a room, 110 for a thing)
C45E LD A,($A010) Read $A010 in "Game variables" into A - Indirect object's requirement code ($A010)...
C461 JR $C466 Skip ahead to C466
This entry point is used by the routines at C4D1 and C583.
C463 LD A,($A00F) (or the direct object's $A00F from here)
C466 CP $05 Code below 5 means a room, otherwise a thing
C468 LD A,B Copy B into A - A = the candidate number B
C469 JR C,$C46E If A is below $05, skip ahead to C46E
C46B CP $6E Compare A with $6E - Things: carry if B is below 110
C46D RET Return to the caller
C46E CP $6A Compare A with $6A - Rooms: carry if B is below 106
C470 RET Return to the caller
Prev: C41F Up: Map Next: C471