Prev: B3D8 Up: Map Next: B43E
B41F: 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 00 01 or 02) in its low two bits, which gives three frames.
Input
IX Object record
Animate_Jellyfish B41F CALL StoreEntity Save the state of the jellyfish.
B422 INC (IX+$0E) Increase the animation counter of the jellyfish.
B425 LD A,(IX+$0E) Fetch the animation counter of the jellyfish.
B428 CP $06 Jump to Animate_Jellyfish_Set_Type if the animation counter is less than 06.
B42A JR C,Animate_Jellyfish_Set_Type
B42C XOR A Reset the animation counter.
B42D LD (IX+$0E),A
Animate_Jellyfish_Set_Type B430 RRA Divide the animation counter by two.
B431 AND %00000011 Keep only the two low bits.
B433 LD C,A Keep the frame in C.
B434 LD A,(IX+$00) Fetch the type of the jellyfish.
B437 AND %11111100 Reset the two low bits.
B439 OR C Combine the type with the frame.
B43A LD (IX+$00),A Store the type of the jellyfish.
B43D RET Return.
Prev: B3D8 Up: Map Next: B43E