Prev: 53189 Up: Map Next: 53250
53214: Check Walls Horizontal First
Used by the routines at CheckWallVertical and CheckWallVerticalReverse.
Checks whether an object touches any wall rectangle in the cell containing a point. The list for the cell is found from WallRectanglePointers. The horizontal range is checked first.
Input
DE The horizontal position of the point
HL The vertical position of the point
IX The address of the object
Output
A The depth into the wall along Y, negative if they overlap
F The carry flag is set if the object touches a wall
Find the cell and its rectangle list.
CheckWallsHorizontalFirst 53214 CALL FindPositionInCell Call FindPositionInCell.
53217 LD BC,24913 Point BC at WallRectanglePointers.
53220 CALL GetTableEntry Call GetTableEntry.
53223 PUSH HL Copy the rectangle list to IY (using the stack).
53224 POP IY
Test the next rectangle.
CheckWallsHorizontalFirst_Next 53226 LD A,(IY+0) Return if this is the end of the list.
53229 AND A
53230 RET Z
53231 CALL CheckOverlapAlongX Call CheckOverlapAlongX.
53234 JR NC,CheckWallsHorizontalFirst_Skip Jump to CheckWallsHorizontalFirst_Skip if the object is not touching the rectangle.
53236 CALL CheckOverlapAlongY Call CheckOverlapAlongY.
53239 RET C Return if the object is touching the rectangle.
Move on to the next rectangle.
CheckWallsHorizontalFirst_Skip 53240 INC IY Move on to the next rectangle.
53242 INC IY
53244 INC IY
53246 INC IY
53248 JR CheckWallsHorizontalFirst_Next Jump to CheckWallsHorizontalFirst_Next.
View the equivalent code in;
Prev: 53189 Up: Map Next: 53250