![]() |
Routines |
| Prev: B952 | Up: Map | Next: B963 |
|
Used by the routines at ADJ_DU_FOR_OBJ_INTERSECT, ADJ_DV_FOR_OBJ_INTERSECT, ADJ_DZ_FOR_OBJ_INTERSECT, ADJ_DU_FOR_OUT_OF_BOUNDS, ADJ_DV_FOR_OUT_OF_BOUNDS and ADJ_DZ_FOR_OUT_OF_BOUNDS.
Moves A one step towards zero -- down if positive, up if negative -- and leaves Z set if nothing is left. Every loop in the collision code uses it to cut a move short a unit at a time and try again.
|
||||||||||||
| SHORTEN_DELTA | B95A | AND A | already zero | |||||||||
| B95B | RET Z | |||||||||||
| B95C | JP P,SHORTEN_DELTA_DEC | negative: +2 here and -1 below | ||||||||||
| B95F | INC A | |||||||||||
| B960 | INC A | |||||||||||
| SHORTEN_DELTA_DEC | B961 | DEC A | the step down that sets Z | |||||||||
| B962 | RET | |||||||||||
| Prev: B952 | Up: Map | Next: B963 |