![]() |
Routines |
| Prev: C535 | Up: Map | Next: C5BE |
|
Used by the routines at DO_ANY_OBJS_INTERSECT, CAN_PICK_UP, ADJ_DU_FOR_OBJ_INTERSECT, ADJ_DV_FOR_OBJ_INTERSECT and ADJ_DZ_FOR_OBJ_INTERSECT.
Boxes are centred in U and V, with +$04 and +$05 the half-sizes. They overlap in U if the distance between the centres, after the mover's dU, is less than the two half-sizes added: exactly touching is not overlapping. The distance is taken as a signed byte, so centres 128 or more apart would be misjudged; no room is that big. Also used by DO_ANY_OBJS_INTERSECT and CAN_PICK_UP.
|
||||||||||||||||
| DO_OBJS_INTERSECT_ON_U | C5A9 | LD A,(IX+$04) | D = the two half-sizes | |||||||||||||
| C5AC | ADD A,(IY+$04) | |||||||||||||||
| C5AF | LD D,A | |||||||||||||||
| C5B0 | LD A,(IX+$01) | A = |U + dU - the other's U| | ||||||||||||||
| C5B3 | ADD A,C | |||||||||||||||
| C5B4 | SUB (IY+$01) | |||||||||||||||
| C5B7 | JP P,DO_OBJS_INTERSECT_ON_U_0 | |||||||||||||||
| C5BA | NEG | |||||||||||||||
| DO_OBJS_INTERSECT_ON_U_0 | C5BC | SUB D | Carry if less than D | |||||||||||||
| C5BD | RET | |||||||||||||||
| Prev: C535 | Up: Map | Next: C5BE |