Prev: 53096 Up: Map Next: 53170
53150: Change Object Type
Used by the routines at RunPentagramStone and RunCollectableObject.
Changes the type of an object, and the type of the entry for it in the object store, which is the first entry that has the old type.
Input
A Old type
C New type
IX Object record
Find the store entry that has the old type.
ChangeObjectType 53150 CALL PointAtStore Call PointAtStore to point IY at the first entry of the object store.
ChangeObjectType_Loop 53153 CP (IY+0) Jump to ChangeObjectType_Found if the entry has the old type.
53156 JR Z,ChangeObjectType_Found
53158 ADD IY,DE Move on to the next entry.
53160 DJNZ ChangeObjectType_Loop Jump to ChangeObjectType_Loop until all of the entries have been tested.
53162 RET Return.
Set the new type in the store and the object.
ChangeObjectType_Found 53163 LD (IY+0),C Set the new type of the entry.
53166 LD (IX+0),C Set the new type of the object.
53169 RET Return.
Prev: 53096 Up: Map Next: 53170