Prev: CA9E Up: Map Next: CAD2
CAA2: Build Room Objects
Used by the routine at RunGame.
Builds the objects of the room that the player is in, and sets the game up to start again in it.
Save the room that was left, unless this is the first.
BuildRoomObjects CAA2 LD A,($5B12) Fetch RoomFlags.
CAA5 AND A Jump to BuildRoomObjects_Clear if it is zero.
CAA6 JR Z,BuildRoomObjects_Clear
CAA8 CALL UpdateSpecialObjects Call UpdateSpecialObjects.
Build the new room.
BuildRoomObjects_Clear CAAB CALL RetrieveRoom Call RetrieveRoom.
CAAE CALL ClearScreenBuffer Call ClearScreenBuffer.
CAB1 CALL PlaceSpecialObjectsInRoom Call PlaceSpecialObjectsInRoom.
CAB4 CALL PlacePlayerAtDoor Call PlacePlayerAtDoor.
CAB7 XOR A Write 00 to EggTopFlag, RemoteControlCommand and LandMineFlag.
CAB8 LD ($5B3A),A
CABB LD ($5B42),A
CABE LD ($5B43),A
CAC1 LD A,($5B90) Fetch 5B90.
CAC4 CPL Invert A.
CAC5 AND %00000001 Keep only bit 0.
CAC7 LD ($5B3B),A Set EggTopDisabledFlag.
CACA LD A,$01 Write 01 to RedrawPanelFlag.
CACC LD ($5B17),A
CACF JP VisitRoom Jump to VisitRoom.
Prev: CA9E Up: Map Next: CAD2