Prev: 9BDC Up: Map Next: 9C41
9C17: Object: Move Nested Contents
Used by the routine at Object_MoveContents.
Moves every object held by the id in A to the location in B, then does the same for what those objects hold. Meeting the player (id 00) clears the flag at Object_MoveContents.
Object_MoveContents_Recurse 9C17 PUSH IY Start the object search one slot before ObjectTable.
9C19 PUSH IX
9C1B LD IX,$C060
Object_MoveContents_Recurse_Loop 9C1F CALL Table_FindTheRecord Call Table_FindTheRecord to find the record.
9C22 JR Z,Object_MoveContents_Recurse_Done Jump to Object_MoveContents_Recurse_Done if Table_FindTheRecord reached the end of the index.
9C24 CP (IY+$01) Jump back to Object_MoveContents_Recurse_Loop if where this object is is not the id in A.
9C27 JR NZ,Object_MoveContents_Recurse_Loop
9C29 LD (IY+$10),B Set this object's location to the location in B.
Object_MoveContents_Recurse_Player 9C2C PUSH AF Save the id being sought and read the id from the index entry.
9C2D LD A,(IX+$00)
9C30 AND A Jump to Object_MoveContents_Recurse_MoveTheContents if this object's id is not zero.
9C31 JR NZ,Object_MoveContents_Recurse_MoveTheContents
9C33 LD ($9BDC),A Clear the flag at Object_MoveContents: the player was among the contents.
Object_MoveContents_Recurse_MoveTheContents 9C36 CALL Object_MoveContents_Recurse Call Object_MoveContents_Recurse to move the contents.
9C39 POP AF Jump back to Object_MoveContents_Recurse_Loop to find the record.
9C3A JR Object_MoveContents_Recurse_Loop
Object_MoveContents_Recurse_Done 9C3C POP IX Restore IX and IY from the stack.
9C3E POP IY
9C40 RET Return.
View the equivalent code in;
Prev: 9BDC Up: Map Next: 9C41