Prev: 28617 Up: Map Next: 28735
28679: Put Can In Cubby Hole
Used by the routine at Robbie_CarryingCan_CubbyColumn.
Robbie puts the spray can into the cubby hole in HL, and becomes Robbie empty-handed. The can is moved to the cubby hole and, with IX+12 set to 1 is then made inactive by UpdateSprayCan.
Input
HL The cubby hole
IX Robbie object
PutCanInCubbyHole 28679 BIT 2,(IX+4) Jump to Robbie_CarryingCan_Fire if Robbie cannot drop the can yet.
28683 JP NZ,Robbie_CarryingCan_Fire
28686 LD A,(IX+3) A=the colour of Robbie.
28689 AND %00000111 Keep only bits 0-2 (the colour of the can).
28691 OR %00001000 Set bit 3 (the item is a spray can).
28693 LD (IX+6),A Remember the item in IX+6 so it is not picked up again straight away.
28696 LD (HL),A Write the item to the cubby hole.
28697 SET 2,(IX+4) Set bit 2 of IX+4.
28701 LD (IX+0),1 Write 1 to IX+0 (Robbie is empty-handed).
28705 LD (IX+3),71 Write 71 (white) to the colour of Robbie.
28709 LD A,(IX+9) A=the X position of the spray can.
28712 BIT 7,A Jump to PutCanInCubbyHole_Right if the can is on the right hand side.
28714 JR NZ,PutCanInCubbyHole_Right
28716 SUB 2 Subtract 2.
PutCanInCubbyHole_Move 28718 LD (IX+13),A Write it to the new X position of the spray can.
28721 LD (IX+12),1 Write 1 to IX+12 (the can is being put away).
28725 CALL PlayLowTone Play a tone using PlayLowTone.
28728 JP Robbie_CarryingCan_Fire Jump to Robbie_CarryingCan_Fire.
PutCanInCubbyHole_Right 28731 ADD A,4 Add 4.
28733 JR PutCanInCubbyHole_Move Jump to PutCanInCubbyHole_Move.
Prev: 28617 Up: Map Next: 28735