Prev: 92F5 Up: Map Next: 934C
9326: Pick Up Item
Used by the routine at HandlerPickupItem.
Puts an item in the first slot of the inventory (see Inventory_Slot1) and takes it off the screen. A slot is the address of the entity (two bytes), the sprite ID and the attribute.
Input
IX The item entity
PickUpItem 9326 LD HL,$5E30 Point HL at the first inventory slot at Inventory_Slot1.
9329 PUSH IX Copy IX into DE, as the address of the item.
932B POP DE
932C LD (HL),E Write the low byte of the address of the item to the first slot.
932D INC HL Move on to the next byte.
932E LD (HL),D Write the high byte of the address of the item to the first slot.
932F INC HL Move on to the next byte.
9330 LD A,(IX+$00) Fetch the sprite ID of the item.
9333 LD (HL),A Write the sprite ID of the item to the first slot.
9334 INC HL Move on to the next byte.
9335 LD A,(IX+$05) Fetch the attribute of the item.
9338 LD (HL),A Write the attribute of the item to the first slot.
9339 CALL RemoveEntity Call RemoveEntity to remove the item from the screen.
933C LD A,($5E1A) Fetch the room attribute from CurrentRoom_Attribute.
933F LD (IX+$05),A Update the attribute of the item.
9342 CALL SetEntityAttributes_Moved Call SetEntityAttributes_Moved to set the attributes of the cells it covered.
9345 LD (IX+$00),$00 Write 00 to the sprite ID of the item, as it is not in the room now.
9349 JP SoundsInventory Jump to SoundsInventory to make the sound of picking up.
Prev: 92F5 Up: Map Next: 934C