experimental/ai_pass_plan.s

Download file

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

1 .equ PLAN_MODE,02 .equ PLAN_TTL,1283| Hard CPU plans a real accepted pass into a native catch-and-release.4| Pending target F08C / TTL F08E; all position/velocity/attributes stay native.5 .text6 .globl _start7_start:8 bra.w launch9 bra.w frame10 bra.w clear11clear:12 clr.l 0xFFFFF08C13 rts14launch:15 move.w %d1,0xFFFFB774               | displaced final native pass velocity16 move.w %sr,-(%sp)17 movem.l %d0-%d7/%a0-%a6,-(%sp)18 movea.l %a3,%a4                    | actual passer19 movea.l %a0,%a5                    | actual accepted receiver20 btst #4,0xFFFFC2EA21 bne.w launch_done22 jsr 0x2D880C23 tst.w %d024 beq.w launch_done25 btst #2,0xFFFFC2FA26 bne.w launch_done27 tst.w 0x34(%a5)28 ble.w launch_done29 btst #3,0x62(%a5)30 bne.w launch_done31 btst #2,0x63(%a5)32 bne.w launch_done33 move.w 0x52(%a5),%d034 cmpi.w #11,%d035 bhi.w launch_done36 move.w 0x52(%a4),%d137 subq.w #6,%d038 subq.w #6,%d139 eor.w %d1,%d040 bmi.w launch_done41 movea.l %a5,%a342 move.w 0x14(%a3),%d543 btst #7,0x62(%a3)44 bne.s receive_depth45 neg.w %d546receive_depth:47 cmpi.w #160,%d548 blt.w launch_done49 cmpi.w #252,%d550 bgt.w launch_done51 move.w (%a3),%d452 bpl.s receiver_abs53 neg.w %d454receiver_abs:55 cmpi.w #92,%d456 bgt.w launch_done57 jsr 0x2DD01858 tst.w %d059 beq.w launch_done60 bsr.w unmarked61 tst.w %d062 beq.w launch_done63 .if PLAN_MODE64 cmpi.w #184,%d565 blt.w launch_done66 cmpi.w #244,%d567 bgt.w launch_done68 cmpi.w #64,%d469 bgt.w launch_done70 lea 0xFFFFB04A,%a171 cmpi.w #6,0x52(%a4)72 bcc.s keeper_base73 adda.w #768,%a174keeper_base:75 moveq #5,%d776keeper:77 tst.w 0x34(%a1)78 bne.w keeper_next79 btst #2,0x63(%a1)80 bne.w keeper_next81 move.w (%a1),%d682 move.w (%a4),%d083 eor.w %d6,%d084 bmi.w launch_done85 move.w %d6,%d086 bpl.s keeper_abs87 neg.w %d088keeper_abs:89 cmpi.w #8,%d090 blt.w launch_done91 cmpi.w #40,%d092 bgt.w launch_done93 move.w 0x14(%a1),%d394 btst #7,0x62(%a4)95 bne.s keeper_depth96 neg.w %d397keeper_depth:98 cmpi.w #232,%d399 blt.w launch_done100 cmpi.w #264,%d3101 bgt.w launch_done102 moveq #-16,%d0103 tst.w %d6104 bpl.s ray_post105 moveq #16,%d0106ray_post:107 sub.w (%a5),%d0108 sub.w %d5,%d3109 bmi.s planned110 muls.w %d3,%d0111 move.w #264,%d1112 sub.w %d5,%d1113 divs.w %d1,%d0114 add.w (%a5),%d0115 sub.w %d6,%d0116 bpl.s ray_abs117 neg.w %d0118ray_abs:119 cmpi.w #24,%d0120 blt.w launch_done121 bra.s planned122keeper_next:123 adda.w #128,%a1124 dbra %d7,keeper125 bra.s launch_done126 .endif127planned:128 move.w 0x52(%a5),%d0129 addq.w #1,%d0130 move.w %d0,0xFFFFF08C131 move.w #PLAN_TTL,0xFFFFF08E132launch_done:133 movem.l (%sp)+,%d0-%d7/%a0-%a6134 move.w (%sp)+,%ccr135 rts136| Receiver must remain unmarked; no keeper is treated as a checking skater.137unmarked:138 movem.l %d1-%d3/%d7/%a1,-(%sp)139 lea 0xFFFFB04A,%a1140 cmpi.w #6,0x52(%a3)141 bcc.s mark_base142 adda.w #768,%a1143mark_base:144 moveq #5,%d7145mark_loop:146 tst.w 0x34(%a1)147 ble.s mark_next148 btst #2,0x63(%a1)149 bne.s mark_next150 move.w (%a1),%d1151 sub.w (%a3),%d1152 muls.w %d1,%d1153 move.w 0x14(%a1),%d2154 sub.w 0x14(%a3),%d2155 muls.w %d2,%d2156 add.l %d2,%d1157 cmpi.l #676,%d1158 blo.s marked159mark_next:160 adda.w #128,%a1161 dbra %d7,mark_loop162 moveq #1,%d0163 bra.s mark_done164marked:165 moveq #0,%d0166mark_done:167 movem.l (%sp)+,%d1-%d3/%d7/%a1168 rts169frame:170 tst.w 0xFFFFF08C171 beq.w frame_empty172 move.w %sr,-(%sp)173 movem.l %d0-%d7/%a0-%a6,-(%sp)174 btst #4,0xFFFFC2EA175 bne.w frame_clear176 subq.w #1,0xFFFFF08E177 bmi.w frame_clear178 move.w 0xFFFFF08C,%d7179 subq.w #1,%d7180 cmpi.w #11,%d7181 bhi.w frame_clear182 jsr 0x2DD680                       | only real ownership / valid approaching pass183 cmp.w %d2,%d7184 bne.w frame_clear185 move.w %d7,%d0186 lsl.w #7,%d0187 lea 0xFFFFB04A,%a3188 adda.w %d0,%a3189 jsr 0x2DD014190 tst.w %d0191 beq.s frame_not_ready192 bsr.w unmarked193 tst.w %d0194 beq.s frame_not_ready195 move.w #0x5042,0xFFFFF086196 move.w 0xFFFFF08C,0xFFFFF088197 move.w 0xFFFFF08E,0xFFFFF08A198 bra.s frame_clear199frame_not_ready:200 cmp.w 0xFFFFB7AA,%d7              | blocked on actual catch: leave native decisions201 beq.s frame_clear202 bra.s frame_done203frame_clear:204 clr.l 0xFFFFF08C205frame_done:206 movem.l (%sp)+,%d0-%d7/%a0-%a6207 move.w (%sp)+,%ccr208frame_empty:209 rts210