experimental/goalie_ai.s

Download file

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

1    .ifndef WITH_CATCH_AI2    .equ WITH_CATCH_AI,13    .endif4| Leave an AI goalie under AI control when he catches/collects the puck.5| Hook $15322, after ownership/statistics are recorded but before automatic controller assignment.6| Explicit Y/B goalie selection uses a different path and remains available.7| Scope: one to four teammates with Goalie Ctrl Manual; opposing humans stay native.8        .text9        .globl _start10_start:11        move.l  %d1,-(%sp)              | a new accepted pickup cancels any previous-possession B request,12        move.w  %sr,-(%sp)13        ori.w   #0x700,%sr14        move.w  0x52(%a2),%d1           | except one queued for this very goalie just before his catch15        cmp.w   0xFFFFF066,%d1          | (outlet.s incoming, 2026-10-26-r13)16        beq.s   1f17        clr.l   0xFFFFF064181:      move.w  (%sp)+,%sr19        move.l  (%sp)+,%d120        tst.w   0x34(%a2)              | only the goalie; pulled-goalie substitutes remain skaters21        bne.s   original22        tst.w   0xFFD052                | Goalie Ctrl Manual23        bne.s   original24        tst.w   0xFFC32C25        bne.s   four_players26        tst.w   0xFFC32E27        bne.s   four_players28        btst    #0,0xFFC2FA             | shootout still needs the normal goalie assignment29        bne.s   original30        move.l  %d1,-(%sp)31        move.w  0xFFC328,%d1            | controller 1's side: 0 none, 1 home, 2 away32        beq.s   keep_ai33        cmp.w   0xFFC32A,%d134        beq.s   keep_ai                 | both controllers are teammates35        tst.w   0xFFC32A36        beq.s   keep_ai                 | only one human37        move.l  (%sp)+,%d1              | opposing human teams: original behaviour38original:39        cmp.w   0xFFC320,%d0            | original instructions at $1532240        beq.s   done41        jmp     0x1532A42keep_ai:43        move.l  (%sp)+,%d144catch_handoff:45    .if WITH_CATCH_AI46        jsr     0x2DBC0047    .endif48done:   rts49four_players:50        btst    #0,0xFFC2FA51        bne.s   original52        jsr     0x2EA610                | keep AI for3/4 teammates, native assignment for opposing humans53        beq.s   catch_handoff54        bra.s   original55