Prev: C9A1 Up: Map Next: CA1E
C9FB: Set Player Speed
Used by the routine at MovePlayer.
Sets the speeds along x and y of the player to walk forward. The adjustments of the speeds that arches make to nudge the player into doorways are added first, then the speed of 03 in the direction that the player is facing.
Input
IX The address of the object
Add the doorway nudges.
SetPlayerSpeed C9FB LD A,(IX+$09) Fetch the speed along the x axis.
C9FE ADD A,(IX+$0E) Add the adjustment along x.
CA01 LD (IX+$09),A Store the speed along the x axis.
CA04 LD A,(IX+$0A) Fetch the speed along the y axis.
CA07 ADD A,(IX+$0F) Add the adjustment along y.
CA0A LD (IX+$0A),A Store the speed along the y axis.
CA0D XOR A Write 00 to the adjustments along x and y.
CA0E LD (IX+$0E),A
CA11 LD (IX+$0F),A
Jump by the facing direction.
CA14 LD BC,$CA32 Point BC at PlayerMovementTable.
This entry point is used by the routines at NudgeObjectsToArch and HandleRoomExit.
SetPlayerSpeed_Direction CA17 CALL GetFacingDirection Fetch the direction the player is facing.
CA1A LD L,A Copy it to L.
CA1B JP RunGame_JumpToHandler Jump to the routine for the direction.
View the equivalent code in;
Prev: C9A1 Up: Map Next: CA1E