Prev: 42506 Up: Map Next: 42549
42540: Item Locator
Given an item ID, this routine returns the byte stored for its location (0 for when an item/ event is disabled, 1 for when an item is in the players inventory, or pass back the room ID).
Input
A Item ID
Output
A Either a room ID, 1 for the players inventory, or 0 for when the item is disabled
Create an offset in DE.
ItemLocator 42540 LD E,A Load the item ID into DE.
42541 LD D,0
42543 LD HL,40840 Add the item ID offset to Table_ItemLocations.
42546 ADD HL,DE
42547 LD A,(HL) Fetch the item location and store it in A.
42548 RET Return.
View the equivalent code in;
Prev: 42506 Up: Map Next: 42549