Prev: E4A2 Up: Map Next: E4E9
E4C5: Controls: Left/ Down
Used by the routine at Controls_CheckRightDown.
Did the player press diagonally left/ down?
Controls_CheckLeftDown E4C5 CP $06 Jump to Controls_CheckRightUp if the player didn't press left/ down (02+04=06).
E4C7 JR NZ,Controls_CheckRightUp
Left/ down movement checks for boundaries and the home box.
E4C9 LD A,($D82D) A=*DestinationCursor_X_Position.
Can the player move left?
E4CC CP $05 If *DestinationCursor_X_Position is at or beyond the left-most boundary jump to MoveDown_Checks.
E4CE JP M,MoveDown_Checks
Is the player about to enter the home box?
This is position 06/ 02:
cursor-06-02
E4D1 CP $06 If *DestinationCursor_X_Position is not 06 (which confirms the player can't be beside the home box), jump to MoveLeftDown.
E4D3 JR NZ,MoveLeftDown
If the horizontal co-ordinate is 06 and the vertical co-ordinate is 02 then the player IS beside the home box. We then jump to MoveLeft_Checks to handle the animation of entering the home box.
E4D5 LD A,($D82C) Now compare *DestinationCursor_Y_Position with 02.
E4D8 CP $02
E4DA JP Z,MoveLeft_Checks If *DestinationCursor_Y_Position is 02 (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.
Normal left movement.
E4DD LD A,($D82D) Reload *DestinationCursor_X_Position into A.
Note this only handles moving left, it then passes the rest of the movement to MoveDown_Checks for handling moving down.
MoveLeftDown E4E0 SUB $04 Move 04 character blocks left.
E4E2 LD ($D82D),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 down should also alter the value).
E4E5 DEC (HL) Decrease *HL by one.
E4E6 JP MoveDown_Checks Jump to MoveDown_Checks.
Prev: E4A2 Up: Map Next: E4E9