Prev: 9F76 Up: Map Next: 9F94
9F82: Get Object First Location
Reads the first location an object appears in.
Input
A Object ID
Output
A FF if the object does not appear exactly once, otherwise the location where it first appears.
ObjectFirstLocation 9F82 CP $FF Return if this is the terminator character (FF).
9F84 RET Z
9F85 CALL LocateObject Call LocateObject to set IX to the object data address.
9F88 LD A,$01 Does the object appear in the game once?
9F8A CP (IX+$00)
9F8D LD A,$FF The not-found id is FF.
9F8F RET NZ Return if not.
9F90 LD A,(IX+$10) Read the object's location.
9F93 RET Return.
View the equivalent code in;
Prev: 9F76 Up: Map Next: 9F94