Prev: 63203 Up: Map Next: 63233
63219: Point HL at terrain interaction data, or attribute file address for character coordinates x=C, y=B
The operand of the instruction at 63228 is usually 88 (corresponding to an attribute file lookup). It is only changed to 93 (corresponding to a terrain interaction data lookup) by the routine at 63233, and is returned to a value of 88 before that routine concludes.
Used by the routines at 37689, 39933, 40937, 41459, 46490, 47731, 48027, 48191, 62178, 63233 and 63740.
Input
B y-coordinate (chars)
C x-coordinate (chars)
Output
DE points to entry in data table with coordinates (C, 0)
HL points to entry in data table with coordinates (C, B)
63219 LD A,B Load y-coordinate into A
63220 ADD A,A Multiply this by 8...
63221 ADD A,A ...
63222 ADD A,A ...
63223 LD L,A Copy 8 times y-coordinate into HL...
63224 LD H,0 ...
63226 ADD HL,HL Multiply by 4...
63227 ADD HL,HL ...to give 32 times original y-coordinate in HL
The operand of the instruction at 63228 determines whether we are dealing with the attribute file (88), or the current terrain interaction data (93). It is modified by the instructions at 63235 and 63243.
63228 LD D,88 Point DE at start of data, plus x-coordinate offset in C...
63230 LD E,C ...
63231 ADD HL,DE Add 32 times y-coordinate as offset in HL
63232 RET Return
Prev: 63203 Up: Map Next: 63233