Prev: B952 Up: Map Next: B963
B95A: Bring Speed Closer To Zero
Moves a signed value one step closer to zero.
Input
A Value
Output
A The value, one closer to zero
F Zero flag set if the result is zero
BringSpeedCloserToZero B95A AND A Return if the value is zero.
B95B RET Z
B95C JP P,BringSpeedCloserToZero_Subtract Jump to BringSpeedCloserToZero_Subtract if the value is positive.
B95F INC A Add two to a negative value...
B960 INC A
BringSpeedCloserToZero_Subtract B961 DEC A ...and subtract one from a positive value (or one from the two added to a negative value).
B962 RET Return.
View the equivalent code in;
Prev: B952 Up: Map Next: B963