Prev: EA93 Up: Map Next: EB49
EB05: Player: Move Right
Used by the routines at PlayerControls_Kempston and PlayerControls.
Input
IX On entry will be set to TablePlayerAttributes
PlayerMoveRight EB05 LD A,(IX+$11) Return if *PlayerActionState is blocked / no walk.
EB08 CP $02
EB0A RET Z
EB0B CP $03 Jump to PlayerMoveRight_FaceAndWalk if *PlayerActionState is not on a ladder.
EB0D JR NZ,PlayerMoveRight_FaceAndWalk
EB0F LD A,(IX+$03) Return if *PlayerVerticalPosition is not 03.
EB12 CP $03
EB14 RET NZ
EB15 LD A,$FF Force *PlayerCollisionMask_Middle so the middle foot does not see a floor.
EB17 LD ($F32D),A
EB1A LD A,(IX+$01) Jump to PlayerMoveRight_FaceAndWalk if *PlayerVerticalCoordinate is at the top of the ladder.
EB1D CP (IX+$12)
EB20 JR Z,PlayerMoveRight_FaceAndWalk
EB22 CP (IX+$13) Return if *PlayerVerticalCoordinate is not at the bottom of the ladder.
EB25 RET NZ
Face and walk right.
PlayerMoveRight_FaceAndWalk EB26 LD A,(IX+$11) Jump to PlayerMoveRight_AdvanceFrame if *PlayerActionState is already facing right.
EB29 CP $13
EB2B JR Z,PlayerMoveRight_AdvanceFrame
EB2D LD (IX+$11),$13 Set *PlayerActionState to facing right.
EB31 LD (IX+$06),$1A Write the frame before the first right-facing walk sprite to *PlayerSpriteID.
PlayerMoveRight_AdvanceFrame EB35 LD A,(IX+$06) A=*PlayerSpriteID.
EB38 ADD A,$06 Advance to the next right-facing walk frame.
EB3A LD (IX+$06),A Write it back to *PlayerSpriteID.
EB3D CP $50 Jump to PlayerMoveRight_SetDirection if the walk cycle has not wrapped.
EB3F JR NZ,PlayerMoveRight_SetDirection
EB41 LD (IX+$06),$20 Reset *PlayerSpriteID to the first right-facing frame.
PlayerMoveRight_SetDirection EB45 DEC (IX+$04) Set *PlayerHorizontalMovement to move right.
EB48 RET Return.
Prev: EA93 Up: Map Next: EB49