Prev: 6280 Up: Map Next: 62C2
62A2: Move Percy Right
Used by the routine at MainGameLoop.
Move Percy right. Checks screen boundary and handles room transitions.
Input
IX Pointer to Percy's state data
D Number of pixels to move
MovePercyRight 62A2 XOR A Write 00 to *PercyFacingDirection (Percy is facing right).
62A3 LD ($5FA5),A
If *CarryingWormFlag is set, apply an extra boundary check.
62A6 LD A,($5FAA) Jump to MovePercyRight_Apply if *CarryingWormFlag is unset.
62A9 OR A
62AA JR Z,MovePercyRight_Apply
62AC LD A,(IX+$00) Load A with Percy's X position (*IX+00) + the number of pixels to move (from D) + 04.
62AF ADD A,D
62B0 ADD A,$04
If Percy has gone past the right edge transition into the next room.
62B2 CP $EF Jump to TransitionRoomRight if Percy's new position is greater than or equal to EF.
62B4 JR NC,TransitionRoomRight
MovePercyRight_Apply 62B6 LD A,(IX+$00) Load A with Percy's X position (*IX+00) + the number of pixels to move (from D).
62B9 ADD A,D
If Percy has gone past the right edge transition into the next room.
62BA CP $EF Jump to TransitionRoomRight if Percy's new position is greater than or equal to EF (transition to next room).
62BC JR NC,TransitionRoomRight
62BE LD (IX+$00),A Write Percy's updated X screen position back to *IX+00.
62C1 RET Return.
Prev: 6280 Up: Map Next: 62C2