Prev: 49829 Up: Map Next: 49926
49868: 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 49868 LD A,1 Get the value that sets a flag.
49870 LD (23491),A Flag that the final animation has started at FinalAnimationFlag.
49873 PUSH IX Stash IX on the stack.
49875 LD IX,23656 Point IX at ObjectsTable_SecondSpecial.
49879 LD DE,32 Set DE to the size of an object.
49882 LD B,11 Set the number of objects to 11.
PrepareFinalAnimation_Remove 49884 PUSH BC Stash the number of objects left on the stack.
49885 PUSH DE Stash the size of an object on the stack.
49886 CALL SetWipeAndDrawFlags Flag the object to be wiped and drawn.
49889 POP DE Restore the size of an object from the stack.
49890 POP BC Restore the number of objects left from the stack.
49891 LD (IX+0),1 Set the graphic number of the object to 1, so it is not shown.
49895 ADD IX,DE Move on to the next object.
49897 DJNZ PrepareFinalAnimation_Remove Jump to PrepareFinalAnimation_Remove until all of the objects have been removed.
49899 LD BC,24840 Point BC at the end of the objects table, Font.
Change every remaining block into a sparkle.
PrepareFinalAnimation_Next 49902 LD A,(IX+0) Fetch the graphic number of the object.
49905 CP 7 Jump to PrepareFinalAnimation_Advance if it is not a block.
49907 JR NZ,PrepareFinalAnimation_Advance
49909 LD (IX+0),131 Change the graphic of the block to the first of the sparkles.
PrepareFinalAnimation_Advance 49913 ADD IX,DE Move on to the next object.
49915 PUSH IX Copy IX to HL (using the stack).
49917 POP HL
49918 AND A Subtract the address of the end of the table.
49919 SBC HL,BC
49921 JR C,PrepareFinalAnimation_Next Jump to PrepareFinalAnimation_Next until every object has been looked at.
49923 POP IX Restore IX from the stack.
49925 RET Return.
Prev: 49829 Up: Map Next: 49926