Prev: C5A9 Up: Map Next: C5D3
C5BE: Test Overlap In Y
Tests whether two objects overlap along y, once the first has moved by its new speed along y. They overlap when the distance between the y positions is smaller than the two depths added together.
Input
L New speed along y of the first object
IX The address of the first object
IY The address of the second object
Output
F Carry flag set if the objects overlap
Compare the y distance with the depths.
TestOverlapInY C5BE LD A,(IX+$05) Fetch the depth of the first object.
C5C1 ADD A,(IY+$05) Add the depth of the second object.
C5C4 LD D,A Copy the total to D.
C5C5 LD A,(IX+$02) Fetch the y position of the first object.
C5C8 ADD A,L Add L.
C5C9 SUB (IY+$02) Subtract the y position of the second object.
C5CC JP P,TestOverlapInY_Compare Jump to TestOverlapInY_Compare if the sign flag is clear.
C5CF NEG Negate A.
TestOverlapInY_Compare C5D1 SUB D Subtract D.
C5D2 RET Return.
View the equivalent code in;
Prev: C5A9 Up: Map Next: C5D3