Prev: 44697 Up: Map Next: 44863
44805: Update Special Objects
Used by the routines at GameOver and BuildRoomObjects.
Copies the number, position and room of each valve in SpecialObjectSlots back to its entry in SpecialObjects, so that they are remembered when the player leaves the room. Other special objects, such as extra lives, are not copied.
Copy each valve back to the table.
UpdateSpecialObjects 44805 LD IY,23496 Point IY at SpecialObjectSlots.
UpdateSpecialObjects_TestSlot 44809 LD A,(IY+0) Fetch the object number.
44812 SUB 96 Subtract 96.
44814 CP 8 Jump to UpdateSpecialObjects_NextSlot unless the object is a valve.
44816 JR NC,UpdateSpecialObjects_NextSlot
44818 LD E,(IY+16) Fetch the low byte of the entry address.
44821 LD D,(IY+17) Fetch the high byte of the entry address.
44824 LD A,(IY+0) Fetch the object number.
44827 LD (DE),A Store it in the entry.
44828 INC DE Move on to the current x position.
44829 INC DE
44830 INC DE
44831 INC DE
44832 INC DE
44833 PUSH IY Copy IY to HL (using the stack).
44835 POP HL
44836 INC HL Move on to the x position of the object.
44837 LD BC,3 Set BC to 0003.
44840 LDIR Copy the x, y and z coordinates to the entry.
44842 LD A,(IY+8) Fetch the room.
44845 LD (DE),A Store it in the entry.
UpdateSpecialObjects_NextSlot 44846 LD BC,32 Set BC to 0032.
44849 ADD IY,BC Move on to the next slot.
44851 PUSH IY Copy IY to HL (using the stack).
44853 POP HL
44854 LD BC,23560 Point BC at RoomObjects.
44857 AND A Subtract RoomObjects from HL.
44858 SBC HL,BC
44860 JR C,UpdateSpecialObjects_TestSlot Jump to UpdateSpecialObjects_TestSlot if there are more slots.
44862 RET Return.
View the equivalent code in;
Prev: 44697 Up: Map Next: 44863