Prev: E1A1 Up: Map Next: E236
E1D9: Routine at E1D9
Used by the routine at E0E2.
E1D9 PUSH BC Stash BC on the stack.
E1DA CALL $E1A1 Call E1A1.
E1DD POP BC Restore BC from the stack.
E1DE LD DE,$0101 DE=0101.
E1E1 LD A,B A=B.
E1E2 SUB H A-=H.
E1E3 JR NC,$E1E9 Jump to E1E9 if is higher.
E1E5 DEC D Decrease D by two.
E1E6 DEC D
E1E7 NEG NEG.
E1E9 LD B,A B=A.
E1EA LD A,C A=C.
E1EB SUB L A-=L.
E1EC JR NC,$E1F2 Jump to E1F2 if D is higher.
E1EE DEC E Decrease E by two.
E1EF DEC E
E1F0 NEG NEG.
E1F2 LD C,A C=A.
E1F3 OR B Set the bits from B.
E1F4 RET Z Return if E is zero.
E1F5 LD A,C A=C.
E1F6 CP B Compare A with B.
E1F7 PUSH HL Stash HL on the stack.
E1F8 LD H,D H=D.
E1F9 LD L,E L=E.
E1FA LD ($E1D5),HL Write HL to *E1D5.
E1FD LD L,$00 L=00.
E1FF JR C,$E205 Jump to E205 if A is lower.
E201 LD H,L H=L.
E202 LD L,E L=E.
E203 LD C,B C=B.
E204 LD B,A B=A.
E205 LD ($E1D7),HL Write HL to *E1D7.
E208 LD H,B H=B.
E209 LD A,B A=B.
E20A SRL A Shift A right.
E20C LD L,A L=A.
E20D LD A,L A=L.
E20E ADD A,C A+=C.
E20F JR C,$E214 Jump to E214 if A is lower.
E211 CP B Compare A with B.
E212 JR C,$E21C Jump to E21C if A is lower.
E214 SUB B A-=B.
E215 LD L,A L=A.
E216 LD DE,($E1D5) DE=*E1D5.
E21A JR $E221 Jump to E221.
E21C LD L,A L=A.
E21D LD DE,($E1D7) DE=*E1D7.
E221 EX (SP),HL Exchange the *SP with the HL register.
E222 LD A,H A=H.
E223 ADD A,D A+=D.
E224 LD H,A H=A.
E225 LD A,L A=L.
E226 ADD A,E A+=E.
E227 LD L,A L=A.
E228 PUSH BC Stash BC on the stack.
E229 CALL $E1A1 Call E1A1.
E22C CALL $E236 Call E236.
E22F POP BC Restore BC from the stack.
E230 EX (SP),HL Exchange the *SP with the HL register.
E231 DEC H Decrease H by one.
E232 JR NZ,$E20D Jump to E20D if H is not zero.
E234 POP HL Restore HL from the stack.
E235 RET Return.
Prev: E1A1 Up: Map Next: E236