Prev: 6FC9 Up: Map Next: 703F
7007: 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+0C set to 01 is then made inactive by UpdateSprayCan.
Input
HL The cubby hole
IX Robbie object
PutCanInCubbyHole 7007 BIT 2,(IX+$04) Jump to Robbie_CarryingCan_Fire if Robbie cannot drop the can yet.
700B JP NZ,Robbie_CarryingCan_Fire
700E LD A,(IX+$03) A=the colour of Robbie.
7011 AND %00000111 Keep only bits 0-2 (the colour of the can).
7013 OR %00001000 Set bit 3 (the item is a spray can).
7015 LD (IX+$06),A Remember the item in IX+06 so it is not picked up again straight away.
7018 LD (HL),A Write the item to the cubby hole.
7019 SET 2,(IX+$04) Set bit 2 of IX+04.
701D LD (IX+$00),$01 Write 01 to IX+00 (Robbie is empty-handed).
7021 LD (IX+$03),$47 Write 47 (white) to the colour of Robbie.
7025 LD A,(IX+$09) A=the X position of the spray can.
7028 BIT 7,A Jump to PutCanInCubbyHole_Right if the can is on the right hand side.
702A JR NZ,PutCanInCubbyHole_Right
702C SUB $02 Subtract 02.
PutCanInCubbyHole_Move 702E LD (IX+$0D),A Write it to the new X position of the spray can.
7031 LD (IX+$0C),$01 Write 01 to IX+0C (the can is being put away).
7035 CALL PlayLowTone Play a tone using PlayLowTone.
7038 JP Robbie_CarryingCan_Fire Jump to Robbie_CarryingCan_Fire.
PutCanInCubbyHole_Right 703B ADD A,$04 Add 04.
703D JR PutCanInCubbyHole_Move Jump to PutCanInCubbyHole_Move.
Prev: 6FC9 Up: Map Next: 703F