Prev: CA70 Up: Map Next: CA92
CA89: Bring Speed Closer To Zero
Takes one off the size of a speed.
Input
A The speed
Output
A The new speed
F The zero flag is set if the new speed is zero
BringSpeedCloserToZero CA89 AND A Test whether the speed is zero.
CA8A RET Z Return if it is.
CA8B JP P,BringSpeedCloserToZero_Step Jump to BringSpeedCloserToZero_Step if it is positive.
CA8E INC A Add two to the negative speed.
CA8F INC A
BringSpeedCloserToZero_Step CA90 DEC A Take one off the speed.
CA91 RET Return.
View the equivalent code in;
Prev: CA70 Up: Map Next: CA92