Prev: C1AB Up: Map Next: C232
C1F1: Handle Object Dropped In Cauldron
Handles the graphic numbers 68 to 6E, which are the special objects once the player has dropped them above the cauldron. The object moves towards the centre of the room in X and Y at a speed of one. While it does so it is kept at a height of about 98: it is lifted if it is below that, and it hangs there if it is not. Once it is at the centre of the room, it falls into the cauldron.
Input
IX Address of the object
Move the object towards the centre of the room.
HandleObjectDroppedInCauldron C1F1 CALL SetPixelAdjustments_Sparkle Set the pixel adjustments of a sparkle.
C1F4 LD A,(IX+$01) Fetch the X coordinate of the object.
C1F7 SUB $80 Subtract the X coordinate of the centre of the room.
C1F9 JR Z,HandleObjectDroppedInCauldron_SetX Jump to HandleObjectDroppedInCauldron_SetX if the object is at the centre of the room.
C1FB LD A,$01 Set the speed to 01.
C1FD JP M,HandleObjectDroppedInCauldron_SetX Jump to HandleObjectDroppedInCauldron_SetX if the object is on the west side of the centre.
C200 NEG Make the speed negative.
HandleObjectDroppedInCauldron_SetX C202 LD (IX+$09),A Set the speed in X, towards the centre of the room.
C205 LD A,(IX+$02) Fetch the Y coordinate of the object.
C208 SUB $80 Subtract the Y coordinate of the centre of the room.
C20A JR Z,HandleObjectDroppedInCauldron_SetY Jump to HandleObjectDroppedInCauldron_SetY if the object is at the centre of the room.
C20C LD A,$01 Set the speed to 01.
C20E JP M,HandleObjectDroppedInCauldron_SetY Jump to HandleObjectDroppedInCauldron_SetY if the object is on the south side of the centre.
C211 NEG Make the speed negative.
HandleObjectDroppedInCauldron_SetY C213 LD (IX+$0A),A Set the speed in Y, towards the centre of the room.
C216 LD A,(IX+$01) Fetch the X coordinate of the object.
C219 CP $80 Jump to HandleObjectDroppedInCauldron_Lift if the object is not at the centre of the room in X.
C21B JR NZ,HandleObjectDroppedInCauldron_Lift
C21D XOR (IX+$02) Combine the X coordinate of the object with the Y coordinate.
C220 JR Z,HandleObjectAtCentreOfRoom Jump to HandleObjectAtCentreOfRoom if the object is at the centre of the room in Y too.
HandleObjectDroppedInCauldron_Lift C222 LD A,(IX+$03) Fetch the Z coordinate of the object.
C225 CP $98 Compare it with 98.
C227 LD A,$01 Set the speed in Z to 01.
C229 JR NC,HandleObjectDroppedInCauldron_SetZ Jump to HandleObjectDroppedInCauldron_SetZ if the object is as high as that.
C22B INC A Set the speed in Z to 02.
HandleObjectDroppedInCauldron_SetZ C22C LD (IX+$0B),A Set the speed in Z.
This entry point is used by the routine at HandleObjectAtCentreOfRoom.
HandleObjectDroppedInCauldron_Move C22F CALL ApplyGravityAndMove Apply gravity to the object and move it.
Prev: C1AB Up: Map Next: C232