Prev: 41763 Up: Map Next: 41814
41787: 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 41787 LD DE,38886 Point DE at the record of the first object at ObjectData.
41790 XOR A Clear A.
41791 LD (DE),A Clear the sprite ID of the first object.
41792 CALL FindRoomObjects Find the entries in the table of room objects for the room.
41795 LD A,(HL) Fetch the first table entry for the room.
41796 AND A Jump to SetUpRoomObjects_Second if there is no object in the first entry.
41797 JR Z,SetUpRoomObjects_Second
41799 CALL CreateObject Create the first object.
Clear the second object and create it from the second table entry.
SetUpRoomObjects_Second 41802 LD DE,38898 Point DE at the record of the second object at ObjectData_Second.
41805 XOR A Clear A.
41806 LD (DE),A Clear the sprite ID of the second object.
41807 CALL FindRoomObjects Find the entries in the table of room objects for the room.
41810 INC HL Move onto the second table entry for the room.
41811 LD A,(HL) Fetch the second table entry for the room.
41812 AND A Return if there is no object in the second entry.
41813 RET Z
Continue on to CreateObject.
Prev: 41763 Up: Map Next: 41814