Prev: C86F Up: Map Next: C8D5
C8AB: Two boxes occupy the same space
Index 13 of DEPTH_ORDER: the boxes overlap on all three axes, and order does not come into it. As in Knight Lore, this is where a valve that shares its space with something else is destroyed. Unless either is out of the collision tests (bit 1 of the flags), a loose valve -- graphics 96 to 99 -- is turned into graphic 64, whose update (SPARKLE_STEP) steps it to 65, whose update (SPARKLE_END_PLACE) empties its place in PLACES and then the record: the valve is gone for the rest of the game. The candidate is checked first; only one of the pair is changed. Knight Lore does this to its collectables (types 96-102); Pentagram does nothing here.
Measured in the simulator: a valve put in the start room where the robot appears, inside his box, was gone -- record and place emptied -- once he had appeared, with this routine's IY branch run; the same valve put above him came to rest on his top.
BOXES_INTERSECT C8AB LD A,(IX+$07) Either out of the collision tests: nothing to do
C8AE OR (IY+$07)
C8B1 AND $02
C8B3 JP NZ,COMPARE_NEXT_OBJ
C8B6 LD A,(IX+$00) The candidate a loose valve?
C8B9 SUB $60
C8BB CP $04
C8BD JR NC,BOXES_INTERSECT_0
C8BF LD (IX+$00),$40 Yes: destroy it
C8C3 JR BOXES_INTERSECT_1
BOXES_INTERSECT_0 C8C5 LD A,(IY+$00) The other a loose valve?
C8C8 SUB $60
C8CA CP $04
C8CC JR NC,BOXES_INTERSECT_1
C8CE LD (IY+$00),$40 Yes: destroy it
BOXES_INTERSECT_1 C8D2 JP COMPARE_NEXT_OBJ Next comparison
Prev: C86F Up: Map Next: C8D5