Prev: 9DBB Up: Map Next: 9DEE
9DD8: Test Vertical Overlap
Used by the routine at TestBoxesOverlap.
Tests whether two boxes overlap vertically. The result is stored in 5C1C.
Input
E Height of the second box
H Vertical position of the second box
IX Address of the first box
TestVerticalOverlap 9DD8 XOR A Clear the result.
9DD9 LD ($5C1C),A Store it.
9DDC LD A,(IX+$01) Fetch the top of the first box.
9DDF SUB H Subtract the position of the second box.
9DE0 CP (IX+$03) Is it less than the height of the first box?
9DE3 JR C,SetOverlapFlag Jump to SetOverlapFlag if so.
9DE5 LD A,H Fetch the position of the second box.
9DE6 SUB (IX+$01) Subtract the top of the first box.
9DE9 CP E Is it less than the height of the second box?
9DEA RET NC Return if not, as the boxes do not overlap.
9DEB JP SetOverlapFlag Jump to SetOverlapFlag.
Prev: 9DBB Up: Map Next: 9DEE