Prev: 43308 Up: Map Next: 43647
43568: Handler: Pick Up Objects
Used by the routines at Handler_Move_Characters and 60161.
Handler_PickUpObjects 43568 PUSH HL Stash HL on the stack.
43569 CALL Handler_ItemsCurrentRoom Call Handler_ItemsCurrentRoom.
43572 INC HL Increment HL by three.
43573 INC HL
43574 INC HL
43575 LD A,(HL)
43576 AND (IY-40)
43579 JR Z,Handler_PickUpObjects_1
43581 LD A,(HL)
43582 AND %10000000 Keep only bit 7.
43584 JR Z,Handler_PickUpObjects_0
43586 PUSH HL Stash HL on the stack.
43587 CALL Character_Active Call Character_Active.
43590 POP HL Restore HL from the stack.
43591 JR NZ,Handler_PickUpObjects_1
Handler_PickUpObjects_0 43593 LD A,(HL)
43594 RES 7,A
43596 LD D,A
43597 LD A,(HL)
43598 AND %10000000 Keep only bit 7.
43600 OR (IY-50)
43603 LD (HL),A
43604 LD A,(IY-55)
43607 LD (IY-50),A
43610 LD (IY-55),D
Fetch the item 2 ID, we're about to drop it.
43613 LD A,(IY+85) A=*IY+85.
43616 DEC HL Decrease HL by three.
43617 DEC HL
43618 DEC HL
Fetch the picked up item ID.
43619 LD E,(HL) E=*HL.
Write the dropped item ID to *HL.
43620 LD (HL),A Write A to *HL.
Move the characters collected item 1 to item 2.
43621 LD A,(IY+80) A=*IY+80.
43624 LD (IY+85),A Write A to *IY+85.
Write the picked up item to the characters item 1.
43627 LD (IY+80),E Write E to *IY+80.
43630 CALL Character_Active Call Character_Active.
43633 CALL Z,58397
Handler_PickUpObjects_1 43636 LD A,(47441)
43639 CP (IY+15)
43642 CALL Z,Sounds_PickUp
43645 POP HL Restore HL from the stack.
43646 RET Return.
Prev: 43308 Up: Map Next: 43647