Prev: A323 Up: Map Next: A356
A33B: Set Up Room Objects
Used by the routines at InitialiseGame and DrawRoomContents.
Creates the actors for the objects which are in the room the player is in. Each room has two entries in the table built by GenerateRoomObjects, and each of the entries which is not zero is turned into one of the two actors in ObjectData.
Input
IX Actor record of the player
Clear the first object and create it from the first table entry.
SetUpRoomObjects A33B LD DE,$97E6 Point DE at the record of the first object at ObjectData.
A33E XOR A Clear A.
A33F LD (DE),A Clear the sprite ID of the first object.
A340 CALL FindRoomObjects Find the entries in the table of room objects for the room.
A343 LD A,(HL) Fetch the first table entry for the room.
A344 AND A Jump to SetUpRoomObjects_Second if there is no object in the first entry.
A345 JR Z,SetUpRoomObjects_Second
A347 CALL CreateObject Create the first object.
Clear the second object and create it from the second table entry.
SetUpRoomObjects_Second A34A LD DE,$97F2 Point DE at the record of the second object at ObjectData_Second.
A34D XOR A Clear A.
A34E LD (DE),A Clear the sprite ID of the second object.
A34F CALL FindRoomObjects Find the entries in the table of room objects for the room.
A352 INC HL Move onto the second table entry for the room.
A353 LD A,(HL) Fetch the second table entry for the room.
A354 AND A Return if there is no object in the second entry.
A355 RET Z
Continue on to CreateObject.
Prev: A323 Up: Map Next: A356