Prev: A7D4 Up: Map Next: A7F8
A7E8: Find Orchid State
Used by the routines at LoadOrchid and SaveOrchid.
Finds the entry in TableOrchidTypes for the layout of a room.
Input
A Room
Output
HL Address of the state of the orchid
Fetch the layout of the room.
HandlerOrchidType A7E8 LD L,A Use the room as the offset into the layout table.
A7E9 LD H,$00
A7EB LD BC,$6066 Point BC at the layout table at Layout.
A7EE ADD HL,BC Add the layout table address to get the address of the layout number for the room.
Fetch the state of the orchid for the layout.
A7EF LD L,(HL) Fetch the layout number of the room.
A7F0 LD H,$00 Clear H.
A7F2 ADD HL,HL Double the layout number, as there are two bytes of state for each layout.
A7F3 LD BC,$A7F8 Point BC at the table of orchid states at TableOrchidTypes.
A7F6 ADD HL,BC Add the table address to get the address of the state for the layout.
A7F7 RET Return.
Prev: A7D4 Up: Map Next: A7F8