Prev: 54182 Up: Map Next: 54368
54191: Handler: Sea Creature Animation
Used by the routines at 54476 and Handler_SeaCreatures.
Input
B Creature vertical co-ordinate
C Creature horizontal co-ordinate
D Creature vertical position offset in character block
E Creature horizontal position offset in character block
IX Creature data
Handler_SeaCreatureAnimation 54191 LD A,C A=C.
54192 SUB (IX+13) A-=*IX+13.
54195 JR Z,Handler_SeaCreatureAnimation_0 Jump to Handler_SeaCreatureAnimation_0 if the result is zero.
54197 CP 255 Compare A with 255.
54199 PUSH AF Stash AF on the stack.
54200 CALL Z,Handler_SeaCreatureAnimation_4 Call Handler_SeaCreatureAnimation_4 if A was equal to 255 on line 54195.
54203 POP AF Restore AF from the stack.
54204 CALL NZ,Handler_SeaCreatureAnimation_6 Call Handler_SeaCreatureAnimation_6 if A was not equal to 255 on line 54195.
54207 JR Handler_SeaCreatureAnimation_1 Jump to Handler_SeaCreatureAnimation_1.
Handler_SeaCreatureAnimation_0 54209 LD A,E Jump to Handler_SeaCreatureAnimation_1 if E is equal to *IX+11.
54210 CP (IX+11)
54213 JR Z,Handler_SeaCreatureAnimation_1
54215 CP 3 Call Handler_SeaCreatureAnimation_6 if E is equal to 3.
54217 CALL Z,Handler_SeaCreatureAnimation_6
Handler_SeaCreatureAnimation_1 54220 LD A,B A=B.
54221 SUB (IX+14) A-=*IX+14.
54224 JR Z,Handler_SeaCreatureAnimation_2 Jump to Handler_SeaCreatureAnimation_2 if the result is zero.
54226 CP 255 Compare A with 255.
54228 PUSH AF Stash AF on the stack.
54229 CALL Z,Handler_SeaCreatureAnimation_10 Call Handler_SeaCreatureAnimation_10 if A was equal to 255 on line 54226.
54232 POP AF Restore AF from the stack.
54233 CALL NZ,Handler_SeaCreatureAnimation_8 Call Handler_SeaCreatureAnimation_8 if A was not equal to 255 on line 54226.
54236 JR Handler_SeaCreatureAnimation_3 Jump to Handler_SeaCreatureAnimation_3.
Handler_SeaCreatureAnimation_2 54238 LD A,D Jump to Handler_SeaCreatureAnimation_3 if D is equal to *IX+15.
54239 CP (IX+15)
54242 JR Z,Handler_SeaCreatureAnimation_3
54244 CP 3 Call Handler_SeaCreatureAnimation_8 if D is equal to 3.
54246 CALL Z,Handler_SeaCreatureAnimation_8
Handler_SeaCreatureAnimation_3 54249 RET Return.
Handler_SeaCreatureAnimation_4 54250 PUSH BC Stash BC and DE on the stack.
54251 PUSH DE
54252 LD C,(IX+13) C=*IX+13.
54255 LD B,(IX+14) B=*IX+14.
54258 LD D,(IX+8) D=*IX+8.
54261 LD E,1 E=1.
54263 LD A,(IX+3) Jump to Handler_SeaCreatureAnimation_5 if *IX+3 is equal to 3.
54266 CP 3
54268 JR Z,Handler_SeaCreatureAnimation_5
54270 INC D Increment D by one.
Handler_SeaCreatureAnimation_5 54271 CALL GoldfishGame_EraseSprite Call GoldfishGame_EraseSprite.
54274 POP DE Restore DE and BC from the stack.
54275 POP BC
54276 RET Return.
Handler_SeaCreatureAnimation_6 54277 PUSH BC Stash BC and DE on the stack.
54278 PUSH DE
54279 LD A,(IX+13) A=*IX+13.
54282 LD C,(IX+7) C=*IX+7.
54285 SUB C A-=C.
54286 LD C,A C=A.
54287 LD B,(IX+14) B=*IX+14.
54290 LD D,(IX+8) D=*IX+8.
54293 LD E,1 E=1.
54295 LD A,(IX+3) Jump to Handler_SeaCreatureAnimation_7 if *IX+3 is equal to 3.
54298 CP 3
54300 JR Z,Handler_SeaCreatureAnimation_7
54302 INC D Increment D by one.
Handler_SeaCreatureAnimation_7 54303 CALL GoldfishGame_EraseSprite Call GoldfishGame_EraseSprite.
54306 POP DE Restore DE and BC from the stack.
54307 POP BC
54308 RET Return.
Handler_SeaCreatureAnimation_8 54309 PUSH BC Stash BC and DE on the stack.
54310 PUSH DE
54311 LD A,(IX+14) A=*IX+14.
54314 LD D,(IX+8) D=*IX+8.
54317 SUB D A-=D.
54318 LD B,A B=A.
54319 LD E,(IX+7) E=*IX+7.
54322 LD C,(IX+13) C=*IX+13.
54325 LD D,1 D=1.
54327 LD A,(IX+2) Jump to Handler_SeaCreatureAnimation_9 if *IX+2 is equal to 3.
54330 CP 3
54332 JR Z,Handler_SeaCreatureAnimation_9
54334 INC E Increment E by one.
Handler_SeaCreatureAnimation_9 54335 CALL GoldfishGame_EraseSprite Call GoldfishGame_EraseSprite.
54338 POP DE Restore DE and BC from the stack.
54339 POP BC
54340 RET Return.
Handler_SeaCreatureAnimation_10 54341 PUSH BC Stash BC and DE on the stack.
54342 PUSH DE
54343 LD C,(IX+13) C=*IX+13.
54346 LD B,(IX+14) B=*IX+14.
54349 LD D,1 D=1.
54351 LD E,(IX+7) E=*IX+7.
54354 LD A,(IX+2) Jump to Handler_SeaCreatureAnimation_11 if *IX+2 is equal to 3.
54357 CP 3
54359 JR Z,Handler_SeaCreatureAnimation_11
54361 INC E Increment E by one.
Handler_SeaCreatureAnimation_11 54362 CALL GoldfishGame_EraseSprite Call GoldfishGame_EraseSprite.
54365 POP DE Restore DE and BC from the stack.
54366 POP BC
54367 RET Return.
Prev: 54182 Up: Map Next: 54368