Prev: CCFB Up: Map Next: CD0D
CD04: Speed a homing velocity up the positive way
Used by the routine at HOMER.
HOMER pulls each of the flyer's three velocities three sixteenths towards the player every turn. This is the pull for a player further along the axis: add 3, and cap the result at 56. A velocity still negative after the add is left alone, so a flyer going the wrong way turns round gradually rather than at once.
The cap is 56 here and -72 in ACCEL_MINUS, which looks lopsided until HOMER turns a velocity into a step: it adds 8 and shifts right four times, and both caps come out as a step of 4, one way or the other.
Input
A the velocity, in sixteenths of a unit
Output
A the new velocity
ACCEL_PLUS CD04 ADD A,$03 add 3; still going the other way: done
CD06 RET M
CD07 CP $38 no faster than 56
CD09 RET C
CD0A LD A,$38
CD0C RET
Prev: CCFB Up: Map Next: CD0D