![]() |
Routines |
| Prev: 53762 | Up: Map | Next: 54185 |
|
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.
|
||||||||||||
| FindPathEntry | 54153 | LD HL,(23806) | The list sits just before the level header. | |||||||||
| 54156 | DEC HL | |||||||||||
| 54157 | LD A,(IX+36) | Twice bits 0-5 of field 36 select the entry. | ||||||||||
| 54160 | AND 63 | |||||||||||
| 54162 | ADD A,A | |||||||||||
| 54163 | LD E,A | |||||||||||
| 54164 | LD D,0 | |||||||||||
| 54166 | AND A | Step back that far in the list. | ||||||||||
| 54167 | SBC HL,DE | |||||||||||
| 54169 | LD E,(HL) | The entry's address. | ||||||||||
| 54170 | INC HL | |||||||||||
| 54171 | LD D,(HL) | |||||||||||
| 54172 | LD HL,4 | Four bytes into the entry. | ||||||||||
| 54175 | ADD HL,DE | |||||||||||
| 54176 | LD A,(HL) | The reward byte, remembered for FollowPath. | ||||||||||
| 54177 | LD (53970),A | |||||||||||
| 54180 | LD DE,8 | Eight bytes further on is returned. | ||||||||||
| 54183 | ADD HL,DE | |||||||||||
| 54184 | RET | Return. | ||||||||||
| Prev: 53762 | Up: Map | Next: 54185 |