experimental/defensive_brake.s

Download file

Release 2026-11-04-r2 · SHA256 e92c7ea64c24f0e96f9c64aaeb7dc6944b75b7237802a1f6cd694c877ab73fe2 · Click a line number for a direct link.

1 .text2 .globl _start3_start:4    | Native command9 removes150 velocity units/update; movement is17*v/65536.5    | Its fixed v>>8 lookahead underestimates high-speed stopping distance.6    | Offset only the containing back's target by the remaining outward coast;7    | actual native103C8/E594/10750 movement and checking remain responsible.8    move.w 0x2A(%a3),%d29    btst #7,0x62(%a3)10    bne.s brake_direction11    neg.w %d212brake_direction:13    tst.w %d214    ble.s brake_done15    move.w %d2,%d316    asr.w #8,%d317    muls.w %d2,%d218    swap %d219    andi.l #0xFFFF,%d220    mulu.w #17,%d221    divu.w #300,%d222    sub.w %d3,%d223    ble.s brake_done24    sub.w %d2,%d125brake_done:26    rts27 .org 0x4028 | E594's automatic charge can override103C8's command9 at the containing29 | target. Keep that brake request; every other command uses native checking.30 cmpi.w #9,%d031 beq.s brake_return32 jmp 0xe59433brake_return:34 rts35