Prev: C81F Up: Map Next: C880
C868: Keep the speed across within the top speed
Used by the routine at accelerate_across.
The whole part of the speed may be no more than half the top speed (top_speed) one way, or one more than that the other (the fraction is kept).
Input
H The whole part of the speed
clamp_speed_across C868 LD A,(top_speed) Negative: no less than minus half the top speed, less one.
C86B SRL A
C86D BIT 7,H
C86F JR Z,clamp_speed_across_0
C871 NEG
C873 LD B,A
C874 LD A,H
C875 CP B
C876 RET NC
C877 DEC B
C878 LD H,B
C879 RET
clamp_speed_across_0 C87A LD B,A Positive: no more than half the top speed.
C87B LD A,H
C87C CP B
C87D RET C
C87E LD H,B
C87F RET
Prev: C81F Up: Map Next: C880