Sherlock: annotated disassembly

Routines

Prev: D224 Up: Map Next: D249
D237: Resolve an id (in A) to its full entity record
Looks the id up in the 3-byte index table at 8B6F (via D34E above), which gives back a *pointer* to the entity's real, full record - one level of indirection past the compact index.
Input
A A thing number
Output
IX The thing's record
D237 LD IX,$8B6F The thing index at 8B6F: three-byte entries (id, record address)
D23B CALL $D34E Find id A in it (D34E)
D23E PUSH HL Save HL on the stack - IX = that entry's record address (+1/+2)
D23F LD L,(IX+$01) Read byte +1 of the record at IX into L
D242 LD H,(IX+$02) Read byte +2 of the record at IX into H
D245 EX (SP),HL Swap HL with the word on top of the stack
D246 POP IX Restore IX from the stack
D248 RET Return to the caller
Prev: D224 Up: Map Next: D249