![]() |
Routines |
| Prev: EDC6 | Up: Map | Next: EE8D |
|
Used by the routines at CULL_OBJECT and SORT_AND_DRAW_BEHIND.
Sets bit 0 of IY+$71 if the object at IX stands in front of the other object whose far corner and floor are in D, E and C (FAR_CORNER): if it does not lie wholly beyond the other on any axis. That is: its +6 is less than the other's far edge along +6, its top (+7) is above the other's floor, and its +8 is less than the other's far edge along +8. Greater +6 and +8 are farther from the viewer, and something wholly below another's floor is under it, so drawn behind it. Asked only of objects that overlap on the screen, one answer is enough to order them. Krumlinde's name for it is RTN_ComparePosition.
|
||||||||||||||||||
| IS_IN_FRONT | EE73 | LD A,D | Not in front if its +6 is at or beyond the other's far edge | |||||||||||||||
| EE74 | RES 0,(IY+WORK_DIRECTION-V) | |||||||||||||||||
| EE78 | CP (IX+OBJ_X) | |||||||||||||||||
| EE7B | RET C | |||||||||||||||||
| EE7C | RET Z | |||||||||||||||||
| EE7D | LD A,E | Or its top is at or below the other's floor | ||||||||||||||||
| EE7E | CP (IX+OBJ_TOP) | |||||||||||||||||
| EE81 | RET NC | |||||||||||||||||
| EE82 | LD A,C | Or its +8 is at or beyond the other's far edge | ||||||||||||||||
| EE83 | CP (IX+OBJ_Z) | |||||||||||||||||
| EE86 | RET C | |||||||||||||||||
| EE87 | RET Z | |||||||||||||||||
| EE88 | SET 0,(IY+WORK_DIRECTION-V) | In front | ||||||||||||||||
| EE8C | RET | |||||||||||||||||
| Prev: EDC6 | Up: Map | Next: EE8D |