| Mini:seven divisional rounds; eighth stored column is legacy/padding only.
    .include "features.inc"
| +0 pick:d0 club,d2 round -> d3 opponent (a1 scratch).
| +4 list:d5 round,a2 list -> d6 count30/N clear, or -1/N set for legacy.
| Scratch:d0,d1,d3,a0. The caller uses its established all30-team legacy fallback.
    .text
    .globl _start
_start:
    bra.w pick
    bra.w fixtures
pick:
    move.w %d0,%d3
    lsl.w #3,%d3
    add.w %d2,%d3
    lea mini_schedule(%pc),%a1
    move.b (%a1,%d3.w),%d3
    andi.w #255,%d3
    rts
fixtures:
    lea mini_schedule(%pc),%a0
    cmpi.w #MINI_GAMES,%d5
    bcc.s legacy_fixture
    moveq #0,%d0
    move.b 0xFFFFC331,%d0
    move.w %d0,%d3
    lsl.w #3,%d3
    add.w %d5,%d3
    move.b (%a0,%d3.w),%d3
    cmp.b 0xFFFFC333,%d3
    bne.s legacy_fixture
    moveq #0,%d6
    moveq #0,%d0
next_team:
    move.w %d0,%d3
    lsl.w #3,%d3
    add.w %d5,%d3
    moveq #0,%d1
    move.b (%a0,%d3.w),%d1
    cmp.w %d1,%d0
    bhs.s skip
    cmp.b 0xFFFFC331,%d0
    beq.s skip
    cmp.b 0xFFFFC333,%d0
    beq.s skip
    move.b %d0,(%a2,%d6.w)
    addq.w #1,%d6
    move.b %d1,(%a2,%d6.w)
    addq.w #1,%d6
skip:
    addq.w #1,%d0
    cmpi.w #32,%d0
    bcs.s next_team
    rts
legacy_fixture:                          | old captured/already-running match outside the new schedule
    moveq #-1,%d6                       | N set: caller retains legacy 30-team simulation
    rts
    .include "minisched.inc"
