Prev: E12A Up: Map Next: E30B
E22D: Handler: Animals
Used by the routine at InitialiseGame.
Handler_Animals E22D LD IX,$F31C IX=F31C.
E231 LD A,(IX+$00) Jump to AnimalsEventTiming if *IX+00 is equal to 00.
E234 CP $00
E236 JP Z,AnimalsEventTiming
E239 LD HL,$934C Write 934C (Graphics_Rat) to *CHARS.
E23C LD ($5C36),HL
E23F CALL $EEA6 Call EEA6.
E242 LD (IX+$00),C Write C to *IX+00.
E245 LD (IX+$01),B Write B to *IX+01.
E248 LD (IX+$02),E Write E to *IX+02.
E24B LD (IX+$03),D Write D to *IX+03.
E24E LD A,E Jump to Handler_Animals_1 if E is not equal to 03.
E24F CP $03
E251 JR NZ,Handler_Animals_1
E253 LD A,(IX+$04) Jump to Handler_Animals_0 if *IX+04 is equal to FF.
E256 CP $FF
E258 JR Z,Handler_Animals_0
E25A LD A,C A=C.
E25B SUB (IX+$07) A-=*IX+07.
E25E CP $02 Jump to Handler_Animals_1 if A is lower than 02.
E260 JR C,Handler_Animals_1
E262 CP $22 Jump to Handler_Animals_1 if A is higher than 22.
E264 JR NC,Handler_Animals_1
E266 LD C,A C=A.
E267 LD E,$01 E=01.
E269 LD D,(IX+$08) D=*IX+08.
E26C CALL PrintSpriteUpdateBuffer Call PrintSpriteUpdateBuffer.
E26F JR Handler_Animals_1 Jump to Handler_Animals_1.
Handler_Animals_0 E271 INC C Increment C by one.
E272 LD A,C Jump to Handler_Animals_1 if C is higher than 22.
E273 CP $22
E275 JR NC,Handler_Animals_1
E277 CP $02 Jump to Handler_Animals_1 if C is lower than 02.
E279 JR C,Handler_Animals_1
E27B LD E,$01 E=01.
E27D LD D,(IX+$08) D=*IX+08.
E280 CALL PrintSpriteUpdateBuffer Call PrintSpriteUpdateBuffer.
Handler_Animals_1 E283 LD A,(IX+$00) Jump to Handler_Animals_3 if *IX+00 is equal to 26.
E286 CP $26
E288 JP Z,Handler_Animals_3
E28B CP $01 Jump to Handler_Animals_3 if *IX+00 is equal to 01.
E28D JP Z,Handler_Animals_3
E290 LD A,(IX+$06) Jump to Handler_Animals_2 if *IX+06 is lower than 25.
E293 CP $25
E295 JR C,Handler_Animals_2
E297 ADD A,$08 A+=08.
E299 CP $47 Jump to Handler_Animals_2 if A is lower than 47.
E29B JR C,Handler_Animals_2
E29D SUB $20 A-=20.
Handler_Animals_2 E29F LD (IX+$06),A Write A to *IX+06.
E2A2 CALL $EED7 Call EED7.
E2A5 LD A,(IX+$00) Write *IX+00 to *IX+0D.
E2A8 LD (IX+$0D),A
E2AB LD A,(IX+$01) Write *IX+01 to *IX+0E.
E2AE LD (IX+$0E),A
E2B1 LD A,(IX+$02) Write *IX+02 to *IX+0B.
E2B4 LD (IX+$0B),A
E2B7 LD A,(IX+$03) Write *IX+03 to *IX+0F.
E2BA LD (IX+$0F),A
E2BD LD A,(IX+$08) A=*IX+08.
E2C0 ADD A,$03 A+=03.
E2C2 LD C,A C=A.
E2C3 LD B,(IX+$01) B=*IX+01.
E2C6 LD A,($F232) A=*F232.
E2C9 DEC A Decrease A by one.
E2CA ADD A,(IX+$08) A+=*IX+08.
E2CD SUB B A-=B.
E2CE CP C Return if A is higher than C.
E2CF RET NC
E2D0 LD A,(IX+$07) A=*IX+07.
E2D3 ADD A,$02 A+=02.
E2D5 SLA A Shift A left two positions (with carry).
E2D7 SLA A
E2D9 LD B,A B=A.
E2DA LD C,(IX+$00) C=*IX+00.
E2DD LD A,($F233) D=*F233.
E2E0 LD D,A
E2E1 LD A,C A=C.
E2E2 SLA A Shift A left two positions (with carry).
E2E4 SLA A
E2E6 ADD A,(IX+$02) C=A+*IX+02.
E2E9 LD C,A
E2EA LD A,($F231) A=*TablePlayerAttributes.
E2ED ADD A,(IX+$07) A+=*IX+07.
E2F0 SLA A Shift A left (with carry).
E2F2 SLA A Shift A left (with carry).
E2F4 ADD A,D A+=D.
E2F5 DEC A Decrease A by one.
E2F6 SUB C A-=C.
E2F7 CP B Return if A is higher than B.
E2F8 RET NC
E2F9 LD A,$01 Write 01 to *SoundFlag_General.
E2FB LD ($FFFE),A
E2FE JP LoseLife Jump to LoseLife.
Handler_Animals_3 E301 LD (IX+$00),$00 Write 00 to *IX+00.
E305 LD A,$00 Write 00 to *SoundFlag_Animal.
E307 LD ($FFFF),A
E30A RET Return.
Prev: E12A Up: Map Next: E30B