Prev: A79F Up: Map Next: A7E8
A7D4: Find Orchid Position
Used by the routines at BringActorCloser and LoadOrchid.
Finds the entry in TableOrchidPositions for the layout of the room an actor is in.
Input
IX Actor record
Output
HL Address of the X and Y position of the orchid
HandlerOrchidPosition A7D4 PUSH BC Stash BC on the stack.
Fetch the layout of the room.
A7D5 LD L,(IX+$01) Fetch the room of the actor.
A7D8 LD H,$00 Clear H.
A7DA LD BC,$6066 Point BC at the layout table at Layout.
A7DD ADD HL,BC Add the layout table address to get the address of the layout number for the room.
Fetch the orchid position for the layout.
A7DE LD L,(HL) Fetch the layout number of the room.
A7DF LD H,$00 Clear H.
A7E1 ADD HL,HL Double the layout number, as there are two bytes of position for each layout.
A7E2 LD BC,$D6A6 Point BC at the table of orchid positions at TableOrchidPositions.
A7E5 ADD HL,BC Add the table address to get the address of the position for the layout.
A7E6 POP BC Restore BC from the stack.
A7E7 RET Return.
Prev: A79F Up: Map Next: A7E8