Prev: B8F6 Up: Map Next: B926
B8FA: Convert a Y co-ordinate to a screen address
Used by the routine at B798.
Input
D Y co-ordinate
HL On exit, holds screen address
B8FA LD E,$08
B8FC LD HL,$4000
B8FF LD A,D
B900 CP $40
B902 JR C,$B90D
B904 SUB $40
B906 LD D,A
B907 LD A,H
B908 ADD A,$08
B90A LD H,A
B90B JR $B8FF
B90D LD A,D
B90E CP $08
B910 JR C,$B91B
B912 SUB $08
B914 LD D,A
B915 LD A,L
B916 ADD A,$20
B918 LD L,A
B919 JR $B90D
B91B LD A,D
B91C CP $00
B91E JR Z,$B925
B920 INC H
B921 DEC D
B922 DEC E
B923 JR $B91B
B925 RET
Prev: B8F6 Up: Map Next: B926