![]() |
Routines |
| Prev: 62D0 | Up: Map | Next: 6307 |
|
Used by the routine at MainGameLoop.
Update Percy's movement speed.
If the current input matches the previous input, accelerate up to a maximum of 04. If the input has changed, decelerate down to a minimum of 01.
|
||||
| UpdateMovementSpeed | 62D8 | LD A,($5FA2) | Jump to UpdateMovementSpeed_Accelerate if *PreviousInputState is the same as *InputState. | |
| 62DB | LD C,A | |||
| 62DC | LD A,($5FA4) | |||
| 62DF | CP C | |||
| 62E0 | JR Z,UpdateMovementSpeed_Accelerate | |||
|
Input changed so decelerate.
|
||||
| 62E2 | LD A,($5FAE) | A=*MovementSpeed. | ||
| 62E5 | CP $01 | Return if already at minimum speed (01). | ||
| 62E7 | RET Z | |||
| 62E8 | DEC A | Decrease speed by one. | ||
| 62E9 | LD ($5FAE),A | Write A to *MovementSpeed. | ||
| 62EC | RET | Return. | ||
|
Input is the same so accelerate.
|
||||
| UpdateMovementSpeed_Accelerate | 62ED | LD A,($5FAE) | A=*MovementSpeed. | |
| 62F0 | CP $04 | Return if already at maximum speed (04). | ||
| 62F2 | RET Z | |||
| 62F3 | INC A | Increase speed by one. | ||
| 62F4 | LD ($5FAE),A | Write A to *MovementSpeed. | ||
| 62F7 | RET | Return. | ||
|
This entry point is used by the routine at MainGameLoop.
No input so decelerate movement speed towards minimum.
|
||||
| UpdateMovementSpeed_Decelerate | 62F8 | LD A,($5FAE) | A=*MovementSpeed. | |
| 62FB | CP $01 | Return if already at minimum speed (01). | ||
| 62FD | RET Z | |||
| 62FE | DEC A | Decrease speed by one. | ||
| 62FF | LD ($5FAE),A | Write A to *MovementSpeed. | ||
| 6302 | LD A,($5FA4) | E=*PreviousInputState (use the previous direction for animation). | ||
| 6305 | LD E,A | |||
| 6306 | RET | Return. | ||
| Prev: 62D0 | Up: Map | Next: 6307 |