 .text
 .globl _start
_start:
    | Native command9 removes150 velocity units/update; movement is17*v/65536.
    | Its fixed v>>8 lookahead underestimates high-speed stopping distance.
    | Offset only the containing back's target by the remaining outward coast;
    | actual native103C8/E594/10750 movement and checking remain responsible.
    move.w 0x2A(%a3),%d2
    btst #7,0x62(%a3)
    bne.s brake_direction
    neg.w %d2
brake_direction:
    tst.w %d2
    ble.s brake_done
    move.w %d2,%d3
    asr.w #8,%d3
    muls.w %d2,%d2
    swap %d2
    andi.l #0xFFFF,%d2
    mulu.w #17,%d2
    divu.w #300,%d2
    sub.w %d3,%d2
    ble.s brake_done
    sub.w %d2,%d1
brake_done:
    rts
 .org 0x40
 | E594's automatic charge can override103C8's command9 at the containing
 | target. Keep that brake request; every other command uses native checking.
 cmpi.w #9,%d0
 beq.s brake_return
 jmp 0xe594
brake_return:
 rts
