Prev: CA70 Up: Map Next: CA90
CA89: Shorten a movement by one unit
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 one unit at a time and try again.
Input
A a dX, dY or dZ
A on exit, one unit closer to zero; Z set if zero
shorten_delta CA89 AND A already zero
CA8A RET Z
CA8B JP P,shorten_delta_dec negative: +2 and then -1
CA8E INC A
CA8F INC A
Prev: CA70 Up: Map Next: CA90