Prev: E72F Up: Map Next: E787
E762: Convert Coordinate To Buffer Offset
Input
B Vertical position
C Horizontal position
Output
HL Position in Room Buffer (also written to BufferRoomPointer)
ConvertCoordinateToBufferOffset E762 LD A,$18 E=18-B.
E764 SUB B
E765 LD E,A
E766 LD D,$00 D=00.
E768 SLA E DE*=0100.
E76A RL D
E76C SLA E
E76E RL D
E770 SLA E
E772 RL D
E774 SLA E
E776 RL D
E778 SLA E
E77A RL D
E77C LD A,$21 L=21-C.
E77E SUB C
E77F LD L,A
E780 LD H,$00 H=00.
E782 ADD HL,DE HL+=DE.
E783 LD ($F330),HL Write HL to *BufferRoomPointer.
E786 RET Return.
Prev: E72F Up: Map Next: E787