![]() |
Routines |
| Prev: 50601 | Up: Map | Next: 50643 |
|
Used by the routines at TestObjectIntersections, TestNearObject, BlockMovementInX, BlockMovementInY and BlockMovementInZ.
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.
|
||||||||||||||||
|
Compare the y distance with the depths.
|
||||||||||||||||
| TestOverlapInY | 50622 | LD A,(IX+5) | Fetch the depth of the first object. | |||||||||||||
| 50625 | ADD A,(IY+5) | Add the depth of the second object. | ||||||||||||||
| 50628 | LD D,A | Copy the total to D. | ||||||||||||||
| 50629 | LD A,(IX+2) | Fetch the y position of the first object. | ||||||||||||||
| 50632 | ADD A,L | Add L. | ||||||||||||||
| 50633 | SUB (IY+2) | Subtract the y position of the second object. | ||||||||||||||
| 50636 | JP P,TestOverlapInY_Compare | Jump to TestOverlapInY_Compare if the sign flag is clear. | ||||||||||||||
| 50639 | NEG | Negate A. | ||||||||||||||
| TestOverlapInY_Compare | 50641 | SUB D | Subtract D. | |||||||||||||
| 50642 | RET | Return. | ||||||||||||||
|
View the equivalent code in;
|
||||||||||||||||
| Prev: 50601 | Up: Map | Next: 50643 |