Prev: 58601 Up: Map Next: 58684
58642: Controls: Left/ Up
Used by the routine at Controls_CheckRightUp.
Did the player press diagonally left/ up?
Controls_CheckLeftUp 58642 CP 10 Jump to 62526 if the player didn't press left up (2+8=10).
58644 JP NZ,62526
Left/ up movement checks for boundaries and the home box.
58647 LD A,(55341) A=*DestinationCursor_X_Position.
Can the player move left?
58650 CP 5 If *DestinationCursor_X_Position is at or beyond the left-most boundary jump to MoveUp_Checks.
58652 JP M,MoveUp_Checks
Is the player about to enter the home box?
This is position 6/ 6 and also position 6/ 2:
6/ 6 (Below) 6/ 2 (Beside)
cursor-06-06 cursor-06-02
58655 CP 6 If *DestinationCursor_X_Position is not 6 (which confirms the player can't be beside the home box), jump to MoveLeftUp.
58657 JR NZ,MoveLeftUp
Else it is now confirmed that *DestinationCursor_X_Position is at position 6.
58659 LD A,(55340) If *DestinationCursor_Y_Position is 6 (which confirms that yes, the player is diagonally below the home box) jump to Handler_CursorMovement.
58662 CP 6
58664 JP Z,Handler_CursorMovement
58667 CP 2 If *DestinationCursor_Y_Position is 2 (which confirms that yes, the player is beside the home box) jump to MoveLeft_Checks so this routine can handle the rest of the movement update.
58669 JP Z,MoveLeft_Checks
Normal left movement.
58672 LD A,(55341) Reload *DestinationCursor_X_Position into A.
MoveLeftUp 58675 SUB 4 Move 4 character blocks left.
58677 LD (55341),A Update *DestinationCursor_X_Position.
Update the tile ID the player has now landed on (note, this only covers the "left" movement here - the jump below covers if up should also alter the value).
58680 DEC (HL) Decrease *HL by one.
58681 JP MoveUp_Checks Jump to MoveUp_Checks.
Prev: 58601 Up: Map Next: 58684