Prev: 9BDC Up: Map Next: 9C78
9C41: Routine at 9C41
Used by the routine at Action_Dir.
9C41 PUSH IX Stash IX, IY and BC on the stack.
9C43 PUSH IY
9C45 PUSH BC
9C46 LD B,A Stash A in the B register temporarily so it doesn't get overwritten.
9C47 CALL LocateLocation Call LocateLocation.
9C4A LD A,(IX+$01)
9C4D LD C,A Stash A in the C register temporarily so it doesn't get overwritten.
9C4E LD IX,$C060 Set IX to $C060 which is 3 bytes less than the start of the object table due to the following line adding $0003 and moving us on to the first record.
9C52 CALL Step3ByteTable Call Step3ByteTable.
9C55 JR Z,$9C6D Jump to 9C6D if we've reached the end of the object data.
9C57 LD A,(IY+$00) If the TODO is not $01 (TODO), then loop back round to 9C52 to move onto the next record.
9C5A CP $01
9C5C JR NZ,$9C52
Success! We've found a record which matches $01 (TODO).
9C5E LD A,B Restore the previous value of A from the B register.
9C5F CP (IY+$10)
9C62 JR NZ,$9C52
9C64 LD A,C
9C65 SUB (IY+$02)
9C68 JR C,$9C74
9C6A LD C,A
9C6B JR $9C52 Jump to 9C52.
9C6D LD A,C Restore the previous value of A from the C register.
9C6E POP BC Restore BC, IY and IX from the stack.
9C6F POP IY
9C71 POP IX
9C73 RET Return.
9C74 LD C,$00
9C76 JR $9C6D Jump to 9C6D.
Prev: 9BDC Up: Map Next: 9C78