Prev: 36569 Up: Map Next: 36606
36586: Point HL at terrain interaction data for character coordinates x=C, y=B
Used by the routines at 27495, 27666, 27809, 29356 and 38539.
Input
B y-coordinate (characters)
C y-coordinate (characters)
Output
HL Points to entry in "terrain interaction data" at 24539
36586 PUSH AF Store AF
36587 LD A,B Load y-coordinate into A
36588 ADD A,A Multiply this by 8...
36589 ADD A,A ...
36590 ADD A,A ...
36591 LD L,A Copy 8 times y-coordinate into HL...
36592 LD H,0 ...
36594 ADD HL,HL Multiply by 4...
36595 ADD HL,HL ...to give 32 times original y-coordinate in HL
36596 LD DE,24539 Point DE at start of "terrain interaction data"
36599 ADD HL,DE Add 32 times y-coordinate as offset to HL
36600 LD D,0 Load x-coordinate into DE...
36602 LD E,C ...
36603 ADD HL,DE Add x-coordinate as offset to HL
36604 POP AF Restore AF
36605 RET Return
Prev: 36569 Up: Map Next: 36606