Prev: C2A5 Up: Map Next: C306
C2CC: Prepare Final Animation
Used by the routine at HandleObjectAtCentreOfRoom.
Gets the cauldron room ready for the final animation, once the last of the charms has been put into the cauldron. The second special object of the room, the background objects and the foreground objects (eleven objects in all) are removed, and every block that is left in the objects table is changed into a sparkle.
Remove the extra objects of the cauldron room.
PrepareFinalAnimation C2CC LD A,$01 Get the value that sets a flag.
C2CE LD ($5BC3),A Flag that the final animation has started at FinalAnimationFlag.
C2D1 PUSH IX Stash IX on the stack.
C2D3 LD IX,$5C68 Point IX at ObjectsTable_SecondSpecial.
C2D7 LD DE,$0020 Set DE to the size of an object.
C2DA LD B,$0B Set the number of objects to 0B.
PrepareFinalAnimation_Remove C2DC PUSH BC Stash the number of objects left on the stack.
C2DD PUSH DE Stash the size of an object on the stack.
C2DE CALL SetWipeAndDrawFlags Flag the object to be wiped and drawn.
C2E1 POP DE Restore the size of an object from the stack.
C2E2 POP BC Restore the number of objects left from the stack.
C2E3 LD (IX+$00),$01 Set the graphic number of the object to 01, so it is not shown.
C2E7 ADD IX,DE Move on to the next object.
C2E9 DJNZ PrepareFinalAnimation_Remove Jump to PrepareFinalAnimation_Remove until all of the objects have been removed.
C2EB LD BC,$6108 Point BC at the end of the objects table, Font.
Change every remaining block into a sparkle.
PrepareFinalAnimation_Next C2EE LD A,(IX+$00) Fetch the graphic number of the object.
C2F1 CP $07 Jump to PrepareFinalAnimation_Advance if it is not a block.
C2F3 JR NZ,PrepareFinalAnimation_Advance
C2F5 LD (IX+$00),$83 Change the graphic of the block to the first of the sparkles.
PrepareFinalAnimation_Advance C2F9 ADD IX,DE Move on to the next object.
C2FB PUSH IX Copy IX to HL (using the stack).
C2FD POP HL
C2FE AND A Subtract the address of the end of the table.
C2FF SBC HL,BC
C301 JR C,PrepareFinalAnimation_Next Jump to PrepareFinalAnimation_Next until every object has been looked at.
C303 POP IX Restore IX from the stack.
C305 RET Return.
Prev: C2A5 Up: Map Next: C306