Prev: 8FCA Up: Map Next: 900A
8FE9: Allow a step that stays inside the walk rectangle
Used by the routine at TEST_STEP_IN_ROOM.
If |x - $58| is below the half-width at $5E1D and |y - $68| below the half-height, clears the bit in B from the record's +$02. MOVE_ACTOR's own test is the same comparison inline, for creatures, without the flag.
ALLOW_IF_IN_ROOM 8FE9 LD HL,$5E1D
8FEC LD A,E
8FED SUB $58
8FEF JP P,ALLOW_IF_IN_ROOM_0
8FF2 NEG
ALLOW_IF_IN_ROOM_0 8FF4 CP (HL)
8FF5 RET NC
8FF6 INC HL
8FF7 LD A,D
8FF8 SUB $68
8FFA JP P,ALLOW_IF_IN_ROOM_1
8FFD NEG
ALLOW_IF_IN_ROOM_1 8FFF CP (HL)
9000 RET NC
9001 LD A,B
9002 CPL
9003 AND (IX+$02)
9006 LD (IX+$02),A
9009 RET
Prev: 8FCA Up: Map Next: 900A