Prev: B71B Up: Map Next: B75A
B729: Calculate vischar isometric position (from state)
This calculates the isometric screen position for the specified vischar from saved_pos.
Used by the routine at animate.
Similar to drop_item_tail_interior.
Input
HL Pointer to visible character.
Set vischar.iso_pos.x to ($200 - saved_pos_x + saved_pos_y) * 2
calc_vischar_iso_pos_from_state B729 EX DE,HL Preserve vischar pointer
B72A LD A,$18 Point DE at vischar.iso_pos.x (note shortcut - no rollover into high byte)
B72C ADD A,E
B72D LD E,A
B72E LD HL,($81A6) HL = saved_pos_y + $200
B731 LD BC,$0200
B734 ADD HL,BC
B735 LD BC,($81A4) Fetch saved_pos_x
B739 AND A Clear the carry flag
B73A SBC HL,BC HL -= saved_pos_x
B73C ADD HL,HL Double the result
B73D EX DE,HL Restore vischar pointer
B73E LD (HL),E Store result in vischar.iso_pos.x
B73F INC L
B740 LD (HL),D
B741 INC L
Set vischar.iso_pos_y = $800 - saved_pos_x - saved_pos_y - saved_height
B742 EX DE,HL Preserve vischar pointer
B743 LD HL,$0800 HL = $800
B746 AND A Clear the carry flag
B747 SBC HL,BC HL -= saved_pos_x
B749 LD BC,($81A8) Fetch saved_height
B74D SBC HL,BC HL -= saved_height
B74F LD BC,($81A6) Fetch saved_pos_y
B753 SBC HL,BC HL -= saved_pos_y
B755 EX DE,HL Restore vischar pointer
B756 LD (HL),E Store result in vischar.iso_pos.y
B757 INC L
B758 LD (HL),D
B759 RET Return
Prev: B71B Up: Map Next: B75A