Prev: 58565 Up: Map Next: 58642
58601: Controls: Right/ Up
Used by the routine at Controls_CheckLeftDown.
Did the player press diagonally right/ up?
Controls_CheckRightUp 58601 CP 9 Jump to Controls_CheckLeftUp if the player didn't press right/ up (1+8=9).
58603 JR NZ,Controls_CheckLeftUp
Right/ up movement checks for boundaries and the home box.
58605 LD A,(55341) A=*DestinationCursor_X_Position.
Can the player move right?
58608 CP 15 If *DestinationCursor_X_Position is at or beyond the right-most boundary jump to MoveUp_Checks.
58610 JP P,MoveUp_Checks
Is the player either inside or below the home box?
This is position 2/ 2 and also position 2/ 6:
2/ 2 (Inside) 2/ 6 (Below)
cursor-02-02 cursor-02-06
58613 CP 2 If *DestinationCursor_X_Position is not 2 (which confirms the player can't be inside the home box), jump to MoveRightUp.
58615 JR NZ,MoveRightUp
Else it is now confirmed that *DestinationCursor_X_Position is at position 2.
58617 LD A,(55340) If *DestinationCursor_Y_Position is either 6 (which confirms that yes, the player is below the home box) or 2 (which confirms that yes, the player is inside the home box), jump to MoveRight_Checks.
58620 CP 6
58622 JP Z,MoveRight_Checks
58625 CP 2
58627 JP Z,MoveRight_Checks
Normal right movement.
58630 LD A,(55341) Reload *DestinationCursor_X_Position into A.
MoveRightUp 58633 ADD A,4 Move 4 character blocks right.
58635 LD (55341),A Update *DestinationCursor_X_Position.
Update the tile ID the player has now landed on (note, this only covers the "right" movement here - the jump below covers if up should also alter the value).
58638 INC (HL) Increment *HL by one.
58639 JP MoveUp_Checks Jump to MoveUp_Checks.
Prev: 58565 Up: Map Next: 58642