Prev: CF68 Up: Map Next: CFB2
CF9E: 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 CF9E CALL PointAtStore Call PointAtStore to point IY at the first entry of the object store.
ChangeObjectType_Loop CFA1 CP (IY+$00) Jump to ChangeObjectType_Found if the entry has the old type.
CFA4 JR Z,ChangeObjectType_Found
CFA6 ADD IY,DE Move on to the next entry.
CFA8 DJNZ ChangeObjectType_Loop Jump to ChangeObjectType_Loop until all of the entries have been tested.
CFAA RET Return.
Set the new type in the store and the object.
ChangeObjectType_Found CFAB LD (IY+$00),C Set the new type of the entry.
CFAE LD (IX+$00),C Set the new type of the object.
CFB1 RET Return.
Prev: CF68 Up: Map Next: CFB2