Prev: BA09 Up: Map Next: BA21
BA0B: Zero a speed too small to matter
Used by the routines at reverse_speed, special_beam_key, hit_block and leave_slope.
A speed (8.8) from -0.65 to 0.39 (-$A8 to $63 in 256ths) becomes 0. The landscape bounces (hit_block, leave_slope) use it so that a bounce dies away; special_beam_key to tell whether the ship is still.
Input
HL the speed
Output
HL the speed, or 0
dead_band BA0B LD A,H 0 to $63: 0
BA0C AND A
BA0D JR NZ,dead_band_0
BA0F LD A,L
BA10 CP $64
BA12 RET NC
BA13 LD HL,$0000
BA16 RET
dead_band_0 BA17 INC A -$A8 to -1: 0
BA18 RET NZ
BA19 LD A,L
BA1A CP $58
BA1C RET C
BA1D LD HL,$0000
BA20 RET
Prev: BA09 Up: Map Next: BA21