experimental/penalty_owner.s

Download file

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

1| Preserve the fouled attacker's physical pad across native penalty-shot setup.2| +0 accepted getBAplayerInfo capture, +4 puckpenshot controller assignment.3| F654..F659: transient signature / physical offset+1 / attacking side1/2.4| Native collisions run at AEB8, after both adapter input banks are restored.5| No per-frame hook, side-setting persistence, shot selection or RNG change.6    .equ RECORD,0xFFFFF6547    .equ PAD,RECORD+28    .equ SIDE,RECORD+49    .equ OBJ,0xFFFFB04A10    .text11    .globl _start12_start:13    bra.w capture14    bra.w setup15capture:16    move.w %d0,0xFFFFD406           | both displaced native instructions17    lea OBJ,%a118    move.w %sr,-(%sp)19    movem.l %d0-%d3/%a0,-(%sp)20    clr.l RECORD21    clr.w SIDE22    cmpi.w #11,%d023    bhi.s captured24    move.w %d0,%d225    lsl.w #7,%d226    btst #3,0x62(%a1,%d2.w)27    beq.s captured28    tst.w 0x34(%a1,%d2.w)29    ble.s captured30    moveq #1,%d331    cmpi.w #6,%d032    bcs.s capture_side33    moveq #2,%d334capture_side:35    lea 0xFFFFC320,%a036    moveq #0,%d137capture_pad:38    cmp.w (%a0,%d1.w),%d039    bne.s capture_next40    cmp.w 8(%a0,%d1.w),%d341    bne.s capture_next42    addq.w #1,%d143    move.w %d1,PAD44    move.w %d3,SIDE45    move.w #0x5053,RECORD46    bra.s captured47capture_next:48    addq.w #2,%d149    cmpi.w #8,%d150    bcs.s capture_pad51captured:52    movem.l (%sp)+,%d0-%d3/%a053    move.w (%sp)+,%sr54    rts5556setup:57    move.w %sr,-(%sp)58    movem.l %d0-%d7/%a0-%a6,-(%sp)59    cmpi.w #0x5053,RECORD60    bne.w ordinary61    btst #0,0xFFFFC2FA            | OT/standalone shootout retains its rotation62    bne.w ordinary63    btst #2,0xFFFFC2F264    beq.w ordinary65    move.w PAD,%d466    subq.w #1,%d467    cmpi.w #6,%d468    bhi.w ordinary69    btst #0,%d470    bne.w ordinary71    move.w SIDE,%d572    cmpi.w #1,%d573    beq.s valid_side74    cmpi.w #2,%d575    bne.w ordinary76valid_side:77    lea 0xFFFFC328,%a078    cmp.w (%a0,%d4.w),%d579    bne.w ordinary80    move.w 0xFFFFD404,%d081    addq.w #1,%d082    cmp.w %d5,%d083    bne.w ordinary84    | Only actual participants may claim the two live actors. Keep all public85    | side choices on the stack and restore them before returning to the game.86    ori.w #0x700,%sr87    move.l (%a0),-(%sp)88    move.l 4(%a0),-(%sp)89    moveq #0,%d390    moveq #0,%d291select_sides:92    move.w (%a0,%d2.w),%d093    cmp.w %d2,%d494    beq.s keep_side95    tst.w %d096    beq.s keep_side97    cmp.w %d5,%d098    beq.s hide_side99    tst.w %d3100    bne.s hide_side101    moveq #1,%d3                  | first native defending pad keeps the goalie102    bra.s keep_side103hide_side:104    clr.w (%a0,%d2.w)105keep_side:106    addq.w #2,%d2107    cmpi.w #8,%d2108    bcs.s select_sides109    | All nonparticipants are parked. Remove stale ownership before the real110    | FD22/C0F8 assignment, including the secondary adapter bank's old objects.111    lea OBJ,%a1112    moveq #11,%d2113clear_ownership:114    bclr #3,0x62(%a1)115    adda.w #128,%a1116    dbra %d2,clear_ownership117    moveq #-1,%d0118    move.l %d0,0xFFFFC320119    move.l %d0,0xFFFFC324120    jsr 0xFD22121    move.l (%sp)+,0xFFFFC32C122    move.l (%sp)+,0xFFFFC328123    bra.s assigned124ordinary:125    movem.l (%sp)+,%d0-%d7/%a0-%a6126    move.w (%sp)+,%sr127    jsr 0xFD22128    clr.w RECORD129    move.w 0xFFFFD408,%d0130    rts131assigned:132    clr.w RECORD                 | each accepted award is consumed once133    movem.l (%sp)+,%d0-%d7/%a0-%a6134    move.w (%sp)+,%sr135    move.w 0xFFFFD408,%d0        | original instruction following BSR FD22136    rts137