Routines |
Prev: E4E9 | Up: Map | Next: E53C |
Used by the routine at Controls_CheckRightUp.
|
||||||||
Did the player press diagonally left/ up?
|
||||||||
Controls_CheckLeftUp | E512 | CP $0A | Jump to F43E if the player didn't press left up (02+08=0A). | |||||
E514 | JP NZ,$F43E | |||||||
Left/ up movement checks for boundaries and the home box.
|
||||||||
E517 | LD A,($D82D) | A=*DestinationCursor_X_Position. | ||||||
Can the player move left?
|
||||||||
E51A | CP $05 | If *DestinationCursor_X_Position is at or beyond the left-most boundary jump to MoveUp_Checks. | ||||||
E51C | JP M,MoveUp_Checks | |||||||
Is the player about to enter the home box?
This is position 06/ 06 and also position 06/ 02:
|
||||||||
E51F | CP $06 | If *DestinationCursor_X_Position is not 06 (which confirms the player can't be beside the home box), jump to MoveLeftUp. | ||||||
E521 | JR NZ,MoveLeftUp | |||||||
Else it is now confirmed that *DestinationCursor_X_Position is at position 06.
|
||||||||
E523 | LD A,($D82C) | If *DestinationCursor_Y_Position is 06 (which confirms that yes, the player is diagonally below the home box) jump to Handler_CursorMovement. | ||||||
E526 | CP $06 | |||||||
E528 | JP Z,Handler_CursorMovement | |||||||
E52B | CP $02 | 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. | ||||||
E52D | JP Z,MoveLeft_Checks | |||||||
Normal left movement.
|
||||||||
E530 | LD A,($D82D) | Reload *DestinationCursor_X_Position into A. | ||||||
MoveLeftUp | E533 | SUB $04 | Move 04 character blocks left. | |||||
E535 | 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 up should also alter the value).
|
||||||||
E538 | DEC (HL) | Decrease *HL by one. | ||||||
E539 | JP MoveUp_Checks | Jump to MoveUp_Checks. |
Prev: E4E9 | Up: Map | Next: E53C |