Prev: CED0 Up: Map Next: CF48
CF35: Check Wall Vertical
Used by the routine at TestMoveUp.
Checks whether an object that is moving in the direction of heading zero touches a wall in the cell containing a point. If it does, VerticalSpeed is reduced by twice the depth and the object is marked as having hit a wall.
Input
DE The horizontal position of the point
HL The vertical position of the point
IX The address of the object
Output
F The carry flag is set if the object hit a wall
Check the walls, then push the object back if it is touching one.
CheckWallVertical CF35 CALL CheckWallsHorizontalFirst Call CheckWallsHorizontalFirst.
CF38 RET NC Return if the object is not touching a wall.
This entry point is used by the routine at CheckWallVerticalReverse.
Reduce VerticalSpeed by twice the depth.
CheckWallVertical_PushBack CF39 ADD A,A Double the depth and keep it in C.
CF3A LD C,A
CF3B LD A,($A215) Fetch VerticalSpeed.
CF3E ADD A,C Add the depth and set VerticalSpeed.
CF3F LD ($A215),A
This entry point is used by the routine at CheckWallHorizontal.
Mark the object as having hit a wall.
CheckWall_Hit CF42 SET 0,(IX+$07) Set bit 0 of the flags of the object.
CF46 SCF Set the carry flag and return.
CF47 RET
View the equivalent code in;
Prev: CED0 Up: Map Next: CF48