Prev: 54388 Up: Map Next: 54439
54421: Get Object First Location
Returns at once when the id is 255. Otherwise looks the object up. Returns 255 when the object appears more than once, and the first location at offset 15 when it appears once.
Input
A Object ID
Output
A 255 when the id is empty or the object appears more than once, else its first location
GetObjectFirstLocation 54421 CP 255 Return if the id is 255.
54423 RET Z
54424 CALL FetchObjectDataPointer Call FetchObjectDataPointer to look that object up.
54427 LD A,1 See whether the object appears once.
54429 CP (IX+0)
54432 LD A,255 Leave 255 when the object appears more than once.
54434 RET NZ Return if the object appears more than once.
The object appears once, so return its first location.
54435 LD A,(IX+15) Read the object's first location.
54438 RET Return.
View the equivalent code in;
Prev: 54388 Up: Map Next: 54439