Prev: C357 Up: Map Next: C386
C36D: Has the robot walked out of the room?
Used by the routine at MOVE_PLAYER.
Called by MOVE_PLAYER once the move has been cut short and before it is made. A room is left only through a doorway, and only walking the way the robot faces: a doorway's first pillar sets bit 0 of the legs' flags while he is in it (CHK_PLYR_NEAR_ARCH), which also lets him past the line of the wall (ADJ_DU_FOR_OUT_OF_BOUNDS, ADJ_DV_FOR_OUT_OF_BOUNDS). This clears the bit -- it is used once, and the pillar sets it again on its next update if he is still there -- and jumps through SCREEN_MOVE_TBL by the facing; each of the four decides whether this turn's move takes him wholly past the wall he faces.
Knight Lore's, instruction for instruction. The room's half-sizes are pushed for the four, because the dispatch uses HL.
Input
IX the legs' record
HANDLE_EXIT_SCREEN C36D LD A,(IX+$0C) Not during the walk into a room
C370 AND $F0
C372 RET NZ
C373 BIT 0,(IX+$07) Not in a doorway
C377 RET Z
C378 RES 0,(IX+$07) The flag is used once
C37C LD BC,SCREEN_MOVE_TBL The four exits, the room's half-sizes pushed for them, and the jump by facing
C37F LD HL,(ROOM_HALF_U)
C382 PUSH HL
C383 JP DISPATCH_ON_FACING
Prev: C357 Up: Map Next: C386