Prev: B952 Up: Map Next: B963
B95A: Shorten a move 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 a unit at a time and try again.
Input
A a dU, dV or dZ
Output
A one unit closer to zero; Z set if zero
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