Prev: DF90 Up: Map Next: E119
E0AD: Routine at E0AD
Used by the routines at E62D, Handler_Controls and EAF6.
E0AD LD HL,$D24D HL=Active_MonsterXPosition.
E0B0 LD A,C A=C.
E0B1 AND A Jump to E0C1 if the sign flag set.
E0B2 JP M,$E0C1
E0B5 ADD A,(HL) A+=*HL.
E0B6 LD C,A C=A.
E0B7 INC HL Increment HL by one.
E0B8 LD A,B A=B.
E0B9 AND A Jump to E0C9 if the sign flag set.
E0BA JP M,$E0C9
E0BD ADD A,(HL) A+=*HL.
E0BE LD B,A B=A.
E0BF JR $E0CF Jump to E0CF.
E0C1 XOR %10000000 Flip bit 7.
E0C3 SUB (HL) A-=*HL.
E0C4 CPL Invert the bits in A.
E0C5 INC A Increment A by one.
E0C6 LD C,A C=A.
E0C7 JR $E0B7 Jump to E0B7.
E0C9 XOR %10000000 Flip bit 7.
E0CB SUB (HL) A-=*HL.
E0CC CPL Invert the bits in A.
E0CD INC A Increment A by one.
E0CE LD B,A B=A.
This entry point is used by the routines at Handler_Humans, F450 and F4E6.
E0CF LD A,C A=C.
E0D0 CP $20 Jump to E10A if A is higher than 20.
E0D2 JR NC,$E10A
E0D4 LD A,B A=B.
E0D5 CP $18 Jump to E10A if A is higher than 18.
E0D7 JR NC,$E10A
E0D9 RRCA RRCA.
E0DA RRCA
E0DB RRCA
E0DC LD L,A L=A.
E0DD AND %00000011 Keep only bits 0-1.
E0DF ADD A,$65 A+=65.
E0E1 LD H,A H=A.
E0E2 LD A,L A=L.
E0E3 AND %11100000 Keep only bits 5-7.
E0E5 ADD A,C A+=C.
E0E6 LD L,A L=A.
E0E7 LD A,(HL) Jump to E0FE if *HL is not zero.
E0E8 AND A
E0E9 JR NZ,$E0FE
E0EB DEC H Decrease H by three.
E0EC DEC H
E0ED DEC H
E0EE LD A,(HL) Jump to E0FE if *HL is not zero.
E0EF AND A
E0F0 JR NZ,$E0FE
E0F2 LD A,D A=D.
E0F3 CP $3D Jump to E113 if A is not equal to 3D.
E0F5 JR NZ,$E113
E0F7 DEC H Decrease H by three.
E0F8 DEC H
E0F9 DEC H
E0FA LD A,(HL) Jump to E114 if *HL is zero.
E0FB AND A
E0FC JR Z,$E114
E0FE CP D Jump to E114 if A is lower than D.
E0FF JR C,$E114
E101 INC E Increment E by one.
E102 CP E Jump to E114 if A is higher than E.
E103 JR NC,$E114
E105 LD ($D215),A Write A to *D215.
E108 OR A Set the bits from A.
E109 RET Return.
E10A POP HL Restore HL from the stack.
E10B LD A,($D3FB) Jump to EF86 if *D3FB is zero.
E10E AND A
E10F JP Z,$EF86
E112 PUSH HL Stash HL on the stack.
E113 XOR A Write 00 to *D215.
E114 LD ($D215),A
E117 XOR A A=00.
E118 RET Return.
Prev: DF90 Up: Map Next: E119