Prev: AA15 Up: Map Next: AA37
AA27: Reverse and halve a step
Used by the routines at bounce_across and bounce_up_down.
The ship's step words are kept high byte first, so the bytes are swapped round either side: negate (negate_hl), halve (halve_hl), and let dead_band cut a small result to nothing.
Input
HL The step word as stored
Output
HL The new step, stored the same way
reverse_speed AA27 LD A,H
AA28 LD H,L
AA29 LD L,A
AA2A CALL negate_hl
AA2D CALL halve_hl
AA30 CALL dead_band
AA33 LD A,H
AA34 LD H,L
AA35 LD L,A
AA36 RET
Prev: AA15 Up: Map Next: AA37