Prev: 45105 Up: Map Next: 45139
45127: Reduce Velocity
Used by the routine at GamePlay_Start.
Moves a signed velocity towards zero by a given amount. It will not go past zero.
Input
A Velocity
B Amount to reduce the speed by
Output
A The new velocity
ReduceVelocity 45127 AND A Jump to ReduceVelocity_Positive if the velocity is positive.
45128 JP P,ReduceVelocity_Positive
45131 ADD A,B Add the amount to reduce the velocity by to the negative velocity.
45132 RET NC Return if the velocity is still negative.
45133 XOR A Set the velocity to zero.
45134 RET Return.
ReduceVelocity_Positive 45135 SUB B Subtract the amount to reduce the velocity by from the positive velocity.
45136 RET NC Return if the velocity is still positive.
45137 XOR A Set the velocity to zero.
45138 RET Return.
Prev: 45105 Up: Map Next: 45139