Prev: 55913 Up: Map Next: 56190
55921: Routine at DA71
Used by the routine at FindScene.
Input
IX Buildings Table
55921 LD (53779),A Write A to *53779.
55924 LD (IX+0),1 Write 1 to *IX+0.
55928 LD (IX+7),A Write A to *IX+7.
55931 LD (IX+8),D Write D to *IX+8.
55934 PUSH DE Stash DE on the stack.
55935 LD D,A D=A.
55936 LD E,0 E=0.
55938 CALL 55869 Call 55869.
55941 LD (IX+3),E Write E to *IX+3.
55944 LD (IX+4),D Write D to *IX+4.
55947 POP DE Restore DE from the stack.
55948 LD A,C A=C.
55949 AND %00011111 Keep only bits 0-4.
55951 LD (IX+1),A Write A to *IX+1.
55954 LD HL,52009 HL=Buildings_Data.
55957 LD A,(HL) A=*HL.
55958 INC HL Increment HL by one.
55959 CP 255 Jump to 55957 if A is not equal to 255.
55961 JR NZ,55957
55963 DEC E Decrease E by one.
55964 JR NZ,55957 Jump to 55957 until E is zero.
55966 LD (56146),HL Write HL to *56146.
55969 LD A,(HL) A=*HL.
55970 AND %11000000 Keep only bits 6-7.
55972 RLCA Rotate A left two positions (bits 6 to 7 are now in positions 0 to 1).
55973 RLCA
55974 CP 0 Jump to 55985 if A is not equal to 0.
55976 JR NZ,55985
55978 LD HL,51614 HL=51614.
55981 LD E,6 E=6.
55983 JR 56001 Jump to 56001.
55985 CP 1 Jump to 55996 if A is not equal to 1.
55987 JR NZ,55996
55989 LD HL,51705 HL=51705.
55992 LD E,7 E=7.
55994 JR 56001 Jump to 56001.
55996 LD HL,51799 HL=51799.
55999 LD E,8 E=8.
56001 LD A,(IX+1) A=*IX+1.
56004 ADD A,E A+=E.
56005 DEC A Decrease A by one.
56006 LD (IX+2),A Write A to *IX+2.
56009 LD (IX+6),E Write E to *IX+6.
56012 DEC E Decrease E by two.
56013 DEC E
56014 PUSH HL Stash HL on the stack.
56015 LD HL,(56146) HL=*56146.
56018 LD A,(HL) A=*HL.
56019 CP 255 Jump to 56107 if A is equal to 255.
56021 JP Z,56107
56024 POP HL Restore HL from the stack.
56025 INC (IX+5) Increment *IX+5 by one.
56028 AND %00111111 Keep only bits 0-5.
56030 PUSH HL Stash HL and DE (twice) on the stack.
56031 PUSH DE
56032 PUSH DE
56033 LD D,0 D=0.
56035 ADD HL,DE HL+=DE.
56036 DEC A Decrease A by one.
56037 JR NZ,56035 Jump to 56035 until A is zero.
56039 POP DE Restore DE from the stack.
56040 PUSH BC Stash BC on the stack.
56041 LD A,(HL) A=*HL.
56042 CP 14 Jump to 56055 if A is higher than 14.
56044 JR NC,56055
56046 CP 9 Jump to 56055 if A is lower than 9.
56048 JR C,56055
56050 CALL 56131 Call 56131.
56053 JR 56060 Jump to 56060.
56055 LD A,17 A=17.
56057 CALL 56131 Call 56131.
56060 LD A,(HL) A=*HL.
56061 CALL 56131 Call 56131.
56064 INC HL Increment HL by one.
56065 DEC E Decrease E by one.
56066 JR NZ,56060 Jump to 56060 until E is zero.
56068 DEC HL Decrease HL by one.
56069 LD A,(HL) A=*HL.
56070 CP 14 Jump to 56083 if A is higher than 14.
56072 JR NC,56083
56074 CP 9 Jump to 56083 if A is lower than 9.
56076 JR C,56083
56078 CALL 56131 Call 56131.
56081 JR 56088 Jump to 56088.
56083 LD A,20 A=20.
56085 CALL 56131 Call 56131.
56088 POP BC Restore BC from the stack.
56089 LD HL,32 HL=0032.
56092 ADD HL,BC HL+=BC.
56093 LD B,H B=H.
56094 LD C,L C=L.
56095 POP DE Restore DE from the stack.
56096 LD HL,(56146) HL=*56146.
56099 INC HL Increment HL by one.
56100 LD (56146),HL Write HL to *56146.
56103 POP HL Restore HL from the stack.
56104 JP 56014 Jump to 56014.
56107 POP HL Restore HL from the stack.
56108 LD A,(IX+5) A=*IX+5.
56111 INC A Increment A by one.
56112 LD (IX+10),A Write A to *IX+10.
56115 LD (IX+11),A Write A to *IX+11.
56118 ADD A,A A+=A.
56119 ADD A,A A+=A.
56120 ADD A,10 A+=10.
56122 LD (IX+12),A Write A to *IX+12.
56125 LD A,2 A=2.
56127 LD (IX+13),A Write A to *IX+13.
56130 RET Return.
56131 PUSH DE Stash DE on the stack.
56132 LD E,A E=A.
56133 LD A,(53779) A=*53779.
56136 LD D,A D=A.
56137 CALL 55869 Call 55869.
56140 INC (IX+9) Increment *IX+9 by one.
56143 INC BC Increment BC by one.
56144 POP DE Restore DE from the stack.
56145 RET Return.
56146 DEFW 0
This entry point is used by the routines at 59761, 59778 and 61318.
56148 LD IX,(53843) IX=53843.
56152 LD A,(53837) A=*Active_MonsterXPosition.
56155 LD (IX+1),A Write A to *IX+1.
56158 LD (IX+2),A Write A to *IX+2.
56161 LD (IX+13),A Write A to *IX+13.
56164 LD (IX+23),A Write A to *IX+23.
56167 LD A,(53838) A=*Active_MonsterYPosition.
56170 LD (IX+3),A Write A to *IX+3.
56173 LD (IX+11),A Write A to *IX+11.
56176 LD (IX+12),A Write A to *IX+12.
56179 LD (IX+21),A Write A to *IX+21.
56182 LD (IX+22),A Write A to *IX+22.
56185 LD DE,(53843) DE=*53843.
56189 RET Return.
Prev: 55913 Up: Map Next: 56190