Prev: 57642 Up: Map Next: 58123
57901: Handler: Animals
Used by the routine at InitialiseGame.
Handler_Animals 57901 LD IX,62236 IX=62236.
57905 LD A,(IX+0) Jump to AnimalsEventTiming if *IX+0 is equal to 0.
57908 CP 0
57910 JP Z,AnimalsEventTiming
57913 LD HL,37708 Write 37708 (Graphics_Rat) to *CHARS.
57916 LD (23606),HL
57919 CALL 61094 Call 61094.
57922 LD (IX+0),C Write C to *IX+0.
57925 LD (IX+1),B Write B to *IX+1.
57928 LD (IX+2),E Write E to *IX+2.
57931 LD (IX+3),D Write D to *IX+3.
57934 LD A,E Jump to Handler_Animals_1 if E is not equal to 3.
57935 CP 3
57937 JR NZ,Handler_Animals_1
57939 LD A,(IX+4) Jump to Handler_Animals_0 if *IX+4 is equal to 255.
57942 CP 255
57944 JR Z,Handler_Animals_0
57946 LD A,C A=C.
57947 SUB (IX+7) A-=*IX+7.
57950 CP 2 Jump to Handler_Animals_1 if A is lower than 2.
57952 JR C,Handler_Animals_1
57954 CP 34 Jump to Handler_Animals_1 if A is higher than 34.
57956 JR NC,Handler_Animals_1
57958 LD C,A C=A.
57959 LD E,1 E=1.
57961 LD D,(IX+8) D=*IX+8.
57964 CALL PrintSpriteUpdateBuffer Call PrintSpriteUpdateBuffer.
57967 JR Handler_Animals_1 Jump to Handler_Animals_1.
Handler_Animals_0 57969 INC C Increment C by one.
57970 LD A,C Jump to Handler_Animals_1 if C is higher than 34.
57971 CP 34
57973 JR NC,Handler_Animals_1
57975 CP 2 Jump to Handler_Animals_1 if C is lower than 2.
57977 JR C,Handler_Animals_1
57979 LD E,1 E=1.
57981 LD D,(IX+8) D=*IX+8.
57984 CALL PrintSpriteUpdateBuffer Call PrintSpriteUpdateBuffer.
Handler_Animals_1 57987 LD A,(IX+0) Jump to Handler_Animals_3 if *IX+0 is equal to 38.
57990 CP 38
57992 JP Z,Handler_Animals_3
57995 CP 1 Jump to Handler_Animals_3 if *IX+0 is equal to 1.
57997 JP Z,Handler_Animals_3
58000 LD A,(IX+6) Jump to Handler_Animals_2 if *IX+6 is lower than 37.
58003 CP 37
58005 JR C,Handler_Animals_2
58007 ADD A,8 A+=8.
58009 CP 71 Jump to Handler_Animals_2 if A is lower than 71.
58011 JR C,Handler_Animals_2
58013 SUB 32 A-=32.
Handler_Animals_2 58015 LD (IX+6),A Write A to *IX+6.
58018 CALL 61143 Call 61143.
58021 LD A,(IX+0) Write *IX+0 to *IX+13.
58024 LD (IX+13),A
58027 LD A,(IX+1) Write *IX+1 to *IX+14.
58030 LD (IX+14),A
58033 LD A,(IX+2) Write *IX+2 to *IX+11.
58036 LD (IX+11),A
58039 LD A,(IX+3) Write *IX+3 to *IX+15.
58042 LD (IX+15),A
58045 LD A,(IX+8) A=*IX+8.
58048 ADD A,3 A+=3.
58050 LD C,A C=A.
58051 LD B,(IX+1) B=*IX+1.
58054 LD A,(62002) A=*62002.
58057 DEC A Decrease A by one.
58058 ADD A,(IX+8) A+=*IX+8.
58061 SUB B A-=B.
58062 CP C Return if A is higher than C.
58063 RET NC
58064 LD A,(IX+7) A=*IX+7.
58067 ADD A,2 A+=2.
58069 SLA A Shift A left two positions (with carry).
58071 SLA A
58073 LD B,A B=A.
58074 LD C,(IX+0) C=*IX+0.
58077 LD A,(62003) D=*62003.
58080 LD D,A
58081 LD A,C A=C.
58082 SLA A Shift A left two positions (with carry).
58084 SLA A
58086 ADD A,(IX+2) C=A+*IX+2.
58089 LD C,A
58090 LD A,(62001) A=*TablePlayerAttributes.
58093 ADD A,(IX+7) A+=*IX+7.
58096 SLA A Shift A left (with carry).
58098 SLA A Shift A left (with carry).
58100 ADD A,D A+=D.
58101 DEC A Decrease A by one.
58102 SUB C A-=C.
58103 CP B Return if A is higher than B.
58104 RET NC
58105 LD A,1 Write 1 to *SoundFlag_General.
58107 LD (65534),A
58110 JP LoseLife Jump to LoseLife.
Handler_Animals_3 58113 LD (IX+0),0 Write 0 to *IX+0.
58117 LD A,0 Write 0 to *SoundFlag_Animal.
58119 LD (65535),A
58122 RET Return.
Prev: 57642 Up: Map Next: 58123