Prev: 40822 Up: Map Next: 40852
40834: Get Object First Location
Reads the first location an object appears in.
Input
A Object ID
Output
A 255 if the object does not appear exactly once, otherwise the location where it first appears.
ObjectFirstLocation 40834 CP 255 Return if this is the terminator character (255).
40836 RET Z
40837 CALL LocateObject Call LocateObject to set IX to the object data address.
40840 LD A,1 Does the object appear in the game once?
40842 CP (IX+0)
40845 LD A,255 The not-found id is 255.
40847 RET NZ Return if not.
40848 LD A,(IX+16) Read the object's location.
40851 RET Return.
View the equivalent code in;
Prev: 40822 Up: Map Next: 40852