Prev: D202 Up: Map Next: D3A9
D389: Find Path Entry
Used by the routine at FollowPath.
Finds the entry of the level data for the path of an entity. The entries are in a list that is found just before the level header at LevelHeaderAddress.
Input
IX The entity
Output
HL The address in the entry
FindPathEntry D389 LD HL,($5CFE) The list sits just before the level header.
D38C DEC HL
D38D LD A,(IX+$24) Twice bits 0-5 of field 24 select the entry.
D390 AND $3F
D392 ADD A,A
D393 LD E,A
D394 LD D,$00
D396 AND A Step back that far in the list.
D397 SBC HL,DE
D399 LD E,(HL) The entry's address.
D39A INC HL
D39B LD D,(HL)
D39C LD HL,$0004 Four bytes into the entry.
D39F ADD HL,DE
D3A0 LD A,(HL) The reward byte, remembered for FollowPath.
D3A1 LD ($D2D2),A
D3A4 LD DE,$0008 Eight bytes further on is returned.
D3A7 ADD HL,DE
D3A8 RET Return.
Prev: D202 Up: Map Next: D3A9