Prev: BD6B Up: Map Next: BED6
BEA7: Can this thing be picked up?
Used by the routine at TAKE_OR_LEAVE.
Only a valve (graphics 96 to 99), and only when he is on or beside it: IS_ON_OR_NEAR_OBJ, their boxes overlapping in U and V, and in Z with him lowered by 4, so that a thing he stands on counts as touching. The caller (TAKE_OR_LEAVE) has made his box 4 bigger each way. Knight Lore's can_pickup_spec_obj and is_on_or_near_obj together; EXTRA_LIFE uses the second alone.
Input
IX the robot's legs
IY the thing
Output
F carry set if it can
CAN_PICK_UP BEA7 LD A,(IY+$00) a valve, graphic 96 to 99; otherwise no carry
BEAA SUB $60
BEAC CP $04
BEAE RET NC
This entry point is used by the routine at EXTRA_LIFE.
IS_ON_OR_NEAR_OBJ BEAF PUSH BC overlapping in U and V (DO_OBJS_INTERSECT_ON_U, DO_OBJS_INTERSECT_ON_V), with no offset
BEB0 LD BC,$0000
BEB3 LD L,C
BEB4 LD H,C
BEB5 CALL DO_OBJS_INTERSECT_ON_U
BEB8 JR NC,CAN_PICK_UP_0
BEBA CALL DO_OBJS_INTERSECT_ON_V
BEBD JR NC,CAN_PICK_UP_0
BEBF LD A,(IX+$03) in Z (DO_OBJS_INTERSECT_ON_Z), with him 4 lower, then put back
BEC2 SUB $04
BEC4 LD (IX+$03),A
BEC7 CALL DO_OBJS_INTERSECT_ON_Z
BECA PUSH AF
BECB LD A,(IX+$03)
BECE ADD A,$04
BED0 LD (IX+$03),A
BED3 POP AF
CAN_PICK_UP_0 BED4 POP BC BC kept
BED5 RET
Prev: BD6B Up: Map Next: BED6