Prev: 9DA9 Up: Map Next: 9DBB
9DB1: Test Boxes Overlap
Tests whether a box overlaps another box. The first box is described by four bytes: the horizontal position of the left edge, the vertical position, the width and the height. The vertical test passes when the vertical position of the first box minus that of the second is less than the height of the first box, or when the vertical position of the second box minus that of the first is less than the height of the second box.
Input
D Width of the second box
E Height of the second box
H Vertical position of the second box
L Horizontal position of the second box
IX Address of the first box
Output
A Value of 5C1C
F The zero flag is set if the boxes do not overlap
TestBoxesOverlap 9DB1 CALL TestHorizontalOverlap Test whether the boxes overlap horizontally.
9DB4 LD A,($5C1C) Fetch the result.
9DB7 AND A Test it.
9DB8 RET Z Return if they do not.
9DB9 JR TestVerticalOverlap Jump to TestVerticalOverlap to test whether they overlap vertically.
Prev: 9DA9 Up: Map Next: 9DBB