Prev: 53095 Up: Map Next: 53189
53153: Check Walls Vertical First
Used by the routines at CheckWallHorizontal and CheckWallHorizontalReverse.
Checks whether an object touches any wall rectangle in the cell containing a point. The list for the cell is found from WallRectanglePointers. The vertical 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 X, negative if they overlap
F The carry flag is set if the object touches a wall
Find the cell and its rectangle list.
CheckWallsVerticalFirst 53153 CALL FindPositionInCell Call FindPositionInCell.
53156 LD BC,24913 Point BC at WallRectanglePointers.
53159 CALL GetTableEntry Call GetTableEntry.
53162 PUSH HL Copy the rectangle list to IY (using the stack).
53163 POP IY
Test the next rectangle.
CheckWallsVerticalFirst_Next 53165 LD A,(IY+0) Return if this is the end of the list.
53168 AND A
53169 RET Z
53170 CALL CheckOverlapAlongY Call CheckOverlapAlongY.
53173 JR NC,CheckWallsVerticalFirst_Skip Jump to CheckWallsVerticalFirst_Skip if the object is not touching the rectangle.
53175 CALL CheckOverlapAlongX Call CheckOverlapAlongX.
53178 RET C Return if the object is touching the rectangle.
Move on to the next rectangle.
CheckWallsVerticalFirst_Skip 53179 INC IY Move on to the next rectangle.
53181 INC IY
53183 INC IY
53185 INC IY
53187 JR CheckWallsVerticalFirst_Next Jump to CheckWallsVerticalFirst_Next.
View the equivalent code in;
Prev: 53095 Up: Map Next: 53189