Prev: 46040 Up: Map Next: 46142
46111: Animate Jellyfish
Used by the routines at Handle_Jellyfish and Handle_Gargoyle.
Counts a jellyfish through the six steps of its animation. The type of the jellyfish gets the counter divided by two (so 0 1 or 2) in its low two bits, which gives three frames.
Input
IX Object record
Animate_Jellyfish 46111 CALL StoreEntity Save the state of the jellyfish.
46114 INC (IX+14) Increase the animation counter of the jellyfish.
46117 LD A,(IX+14) Fetch the animation counter of the jellyfish.
46120 CP 6 Jump to Animate_Jellyfish_Set_Type if the animation counter is less than 6.
46122 JR C,Animate_Jellyfish_Set_Type
46124 XOR A Reset the animation counter.
46125 LD (IX+14),A
Animate_Jellyfish_Set_Type 46128 RRA Divide the animation counter by two.
46129 AND %00000011 Keep only the two low bits.
46131 LD C,A Keep the frame in C.
46132 LD A,(IX+0) Fetch the type of the jellyfish.
46135 AND %11111100 Reset the two low bits.
46137 OR C Combine the type with the frame.
46138 LD (IX+0),A Store the type of the jellyfish.
46141 RET Return.
Prev: 46040 Up: Map Next: 46142