Routines

27886: Get limits of range within which character can be seen by teacher


Used by routines at 28002 and 28029

H Number of character we're interested in the visibility of

27886 2E02 LD L,2
27888 56 LD D,(HL) Pick up the character's y-coordinate in D
27889 2D DEC L
27890 5E LD E,(HL) Pick up the character's x-coordinate in E
27891 0E00 LD C,0 Prepare lower limit of 0 in case E<10
27893 7B LD A,E
27894 D60A SUB 10
27896 3801 JR C,27899
27898 4F LD C,A C=lower limit of range
27899 C614 ADD A,20
27901 47 LD B,A B=upper limit of range
27902 C9 RET