Prev: E4C5 Up: Map Next: E512
E4E9: Controls: Right/ Up
Used by the routine at Controls_CheckLeftDown.
Did the player press diagonally right/ up?
Controls_CheckRightUp E4E9 CP $09 Jump to Controls_CheckLeftUp if the player didn't press right/ up (01+08=09).
E4EB JR NZ,Controls_CheckLeftUp
Right/ up movement checks for boundaries and the home box.
E4ED LD A,($D82D) A=*DestinationCursor_X_Position.
Can the player move right?
E4F0 CP $0F If *DestinationCursor_X_Position is at or beyond the right-most boundary jump to MoveUp_Checks.
E4F2 JP P,MoveUp_Checks
Is the player either inside or below the home box?
This is position 02/ 02 and also position 02/ 06:
02/ 02 (Inside) 02/ 06 (Below)
cursor-02-02 cursor-02-06
E4F5 CP $02 If *DestinationCursor_X_Position is not 02 (which confirms the player can't be inside the home box), jump to MoveRightUp.
E4F7 JR NZ,MoveRightUp
Else it is now confirmed that *DestinationCursor_X_Position is at position 02.
E4F9 LD A,($D82C) If *DestinationCursor_Y_Position is either 06 (which confirms that yes, the player is below the home box) or 02 (which confirms that yes, the player is inside the home box), jump to MoveRight_Checks.
E4FC CP $06
E4FE JP Z,MoveRight_Checks
E501 CP $02
E503 JP Z,MoveRight_Checks
Normal right movement.
E506 LD A,($D82D) Reload *DestinationCursor_X_Position into A.
MoveRightUp E509 ADD A,$04 Move 04 character blocks right.
E50B LD ($D82D),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).
E50E INC (HL) Increment *HL by one.
E50F JP MoveUp_Checks Jump to MoveUp_Checks.
Prev: E4C5 Up: Map Next: E512