Prev: 9F21 Up: Map Next: A01A
A007: In permitted area (end bit)
This checks that the hero is in the specified room or camp bounds.
Used by the routine at in_permitted_area.
Input
A If bit 7 is set then bits 0..6 contain a room index. Otherwise it's an area index as passed into within_camp_bounds.
Output
F Z set if in the permitted area.
in_permitted_area_end_bit A007 LD HL,$68A0 Point HL at the global current room index
A00A BIT 7,A Was the permitted_route_ROOM flag set on entry? ($80)
A00C JR Z,end_bit_area Jump if not
A00E AND $7F Mask off the room flag
A010 CP (HL) Does the specified room match the global current room index?
A011 RET Return immediately with the result in flags
end_bit_area A012 EX AF,AF' Bank A
A013 LD A,(HL) Fetch the global current room index
A014 AND A Is it room_0_OUTDOORS? (0)
A015 RET NZ Return if not
A016 LD DE,$81B8 Point DE at hero_map_position
A019 EX AF,AF' Unbank A - restoring original A
FALL THROUGH to within_camp_bounds.
Prev: 9F21 Up: Map Next: A01A