Routines
Prev:
29693
Up:
Map
Next:
29716
29696: Calculate appropriate coordinates for a message box
Used by the routines at
29716
,
29896
and
62668
. Returns with the coordinates of the messenger's head in
DE
.
Input
H
Messenger's character number (200-205)
Output
29696
LD L,1
Point
HL
at byte 1 of the character's buffer
29698
LD E,(HL)
E
=character's x-coordinate
29699
INC E
E
=x-coordinate of the character's head
29700
DEC L
L
=0
29701
LD A,(HL)
A
=character's animatory state
29702
AND 7
Keep only bits 0-2
29704
CP 6
Set the zero flag if the character is sitting on the floor
29706
LD A,0
The y-coordinate offset should be 0 if the character is standing
29708
JR NZ,29711
Jump if character is standing
29710
INC A
A
=1 (one level lower if the character is sitting on the floor)
29711
LD L,2
Point
HL
at byte 2 of the character's buffer
29713
ADD A,(HL)
Add the character's y-coordinate and the offset
29714
LD D,A
D
=y-coordinate of the character's head
29715
RET
Prev:
29693
Up:
Map
Next:
29716