Prev: 40361 Up: Map Next: 40379
40369: 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 23580
F The zero flag is set if the boxes do not overlap
TestBoxesOverlap 40369 CALL TestHorizontalOverlap Test whether the boxes overlap horizontally.
40372 LD A,(23580) Fetch the result.
40375 AND A Test it.
40376 RET Z Return if they do not.
40377 JR TestVerticalOverlap Jump to TestVerticalOverlap to test whether they overlap vertically.
Prev: 40361 Up: Map Next: 40379