Prev: C296 Up: Map Next: C319
C2F6: Add a step in the direction he faces
Used by the routine at MOVE_PLAYER.
First adds the nudge in +$0E and +$0F, which a doorway leaves to steer the robot onto its middle line (NUDGE_ALONG_V, NUDGE_ALONG_U), to the U and V steps, and clears it; then adds 3 in the direction he faces, through WALK_STEP_TBL. So the nudge acts only while he walks.
DISPATCH_ON_FACING, the last three instructions, jumps through a table of four addresses at BC by the facing of the object at IX (GET_SPRITE_DIR), using the main loop's jump through the update table (in AFTER_GAME). The exit check (HANDLE_EXIT_SCREEN) and a doorway's first pillar (FIRST_PILLAR) use it too.
Input
IX the legs' record
CALC_PLYR_DUV C2F6 LD A,(IX+$09) The U and V steps plus the nudge
C2F9 ADD A,(IX+$0E)
C2FC LD (IX+$09),A
C2FF LD A,(IX+$0A)
C302 ADD A,(IX+$0F)
C305 LD (IX+$0A),A
C308 XOR A The nudge is used up
C309 LD (IX+$0E),A
C30C LD (IX+$0F),A
C30F LD BC,WALK_STEP_TBL The table of steps
This entry point is used by the routines at FIRST_PILLAR and HANDLE_EXIT_SCREEN.
DISPATCH_ON_FACING C312 CALL GET_SPRITE_DIR Jump to the table's entry for the facing
C315 LD L,A
C316 JP JUMP_THROUGH_TABLE
Prev: C296 Up: Map Next: C319