    .ifndef WITH_TRANSFERS
    .equ WITH_TRANSFERS,0
    .endif
    .equ TRANSFER_ROW_SHIFT,2*WITH_TRANSFERS
    .ifndef WITH_MOMENTUM
    .equ WITH_MOMENTUM,0
    .endif
    .ifndef WITH_FACEOFF_DOTS
    .equ WITH_FACEOFF_DOTS,0
    .endif
    .ifndef WITH_AI_SHOT_PLAN
    .equ WITH_AI_SHOT_PLAN,0
    .endif
    .ifndef WITH_STRICT_SO
    .equ WITH_STRICT_SO,0
    .endif
    .ifndef WITH_ALT_GOALIES
    .equ WITH_ALT_GOALIES,0
    .endif
    .ifndef WITH_PICKUP_DELAY
    .equ WITH_PICKUP_DELAY,0
    .endif
    .ifndef WITH_PASS_CHARGE
    .equ WITH_PASS_CHARGE,0
    .endif
    .ifndef WITH_PENALTY_RATE
    .equ WITH_PENALTY_RATE,0
    .endif
    .ifndef WITH_DIRECTIONAL
    .equ WITH_DIRECTIONAL,0
    .endif
    .ifndef WITH_PASS_SPEED
    .equ WITH_PASS_SPEED,0
    .endif
    .ifndef WITH_PASS_HEIGHT
    .equ WITH_PASS_HEIGHT,0
    .endif
    .ifndef ICING_DEFAULT
    .equ ICING_DEFAULT,0
    .endif
    .ifndef WITH_PREF_DEFAULTS
    .equ WITH_PREF_DEFAULTS,1
    .endif
    .ifndef WITH_ICING_MENU
    .equ WITH_ICING_MENU,1
    .endif
    .ifndef WITH_CRIT_OPTION
    .equ WITH_CRIT_OPTION,1
    .endif
| Per-season human count, including Continue Playoffs. Optional PC record in
| unused logical SRAM1EF0..1EF3 follows each slot's existing snapshot/checksum.
| +0 load (mapper enabled), +4 store, +8 menu step (D2 direction,D3 result),
| +12 label (D0 pointer), +16 league settings, +20 playoff settings, +24 cursor.
    .equ COUNT,0xFFFFF0D0       | preferred1..4; F0D2 is the existing playoff-game flag
    .equ TM,0xFFFFF07C
    .equ MTAP,0xFFFFD046
    .equ PLAYERS,0xFFFFD04A
    .equ PMODE,0xFFFFD048
    .equ RECORD,0x203DE1        | logical1EF0, physical odd bytes: P,C,count,~count
    .equ MAP,0xA130F1
    .equ NCOUNT,0xFFFFF0DA      | standalone:1One,2Two coop,3Three,4Four,5Two head-to-head
    .equ DIFF,0xFFFFF07A        | crowd.s Difficulty: 0 Normal, 1 Hard, 2 Easy
    .equ DREC,0x203DE9          | r36: logical1EF4..1EF5 = difficulty, ~difficulty (was unused)
    .equ SREC,0x203FED          | logical1FF6..1FFD: U adds Icing at1FFD to the XOR; old S/T accepted as On.
                                | Per.Length, Goalie Ctrl, Penalties,
                                | Line Changes, Fighting, xor check (was unused; NHL94 forum report:
                                | the season's settings came back as the start-up defaults, locked)
    .equ EXTRA,0x203D59        | old per-slot D046..D087 snapshot, logical 1EAC
    .equ NRECORD,0x205C29       | logical2E14..2E17, after the standalone NPO1 context
    .text
    .globl _start
_start:
    bra.w load
    bra.w store
    bra.w step
    bra.w label
    bra.w league
    bra.w playoff
    bra.w cursor
    bra.w native_load           | +28 mapper already enabled by slots.ctxload
    bra.w native_step           | +32
    bra.w native_label          | +36
    bra.w native_sides          | +40
    bra.w writer                | +44 native/season writer dispatch
    bra.w display               | +48 native/season value-label dispatch
    bra.w diffstore             | +52 r36: season difficulty record (crowd.s, each new game)
    bra.w openrow               | +56 compatibility entry: started seasons never unlock
    bra.w startsettings         | +60 freeze/restore settings before native match preparation

cursor:                          | native Continue skips Players/Home/Away; expose Players only for seasons
    tst.w 0xFFFFF06C
    beq.s cursor_row
    cmpi.w #3,0xFFFFE3F0
    bne.s native_cursor
cursor_row:
    cmpi.w #2,%d7
    bne.s native_cursor
    tst.w %d7                    | clear Z: bypass the native Continue row-skip test
    rts
native_cursor:
    cmpi.w #1,PMODE
    rts

load:
    movem.l %d0-%d2/%a0-%a1,-(%sp)
    clr.w DIFF                         | played legacy fallback remains Normal
    .if WITH_PREF_DEFAULTS
    tst.b 0x202011
    bne.s default_difficulty_ready
    tst.b 0x202013
    bne.s default_difficulty_ready
    move.w #1,DIFF                    | a fresh empty season starts Hard, as requested
default_difficulty_ready:
    .endif
    move.b DREC,%d0             | r36 (jdc: Easy came back as Normal after a restart, then
    cmpi.b #2,%d0               | locked): the slot's own difficulty, when it has one
    bhi.s 1f
    move.b %d0,%d1
    not.b %d1
    cmp.b DREC+2,%d1
    bne.s 1f
    andi.w #3,%d0
    move.w %d0,DIFF
1:  bsr.w loadsettings
    .if WITH_PASS_HEIGHT
    jsr 0x2DE404
    .endif
3:
    lea RECORD,%a0
    cmpi.b #0x50,(%a0)
    bne.s legacy
    cmpi.b #0x43,2(%a0)
    bne.s legacy
    moveq #0,%d0
    move.b 4(%a0),%d0
    cmpi.w #1,%d0
    bcs.s legacy
    cmpi.w #4,%d0
    bhi.s legacy
    move.b %d0,%d1
    not.b %d1
    cmp.b 6(%a0),%d1
    beq.s loaded
legacy:
    moveq #1,%d0
    tst.w PMODE
    bne.s old_playoff
    cmpi.w #3,PLAYERS
    beq.s old_two
    moveq #3,%d0
    cmpi.w #5,PLAYERS
    beq.s loaded
    moveq #4,%d0
    cmpi.w #6,PLAYERS
    beq.s loaded
    moveq #1,%d0
    bra.s loaded
old_playoff:
    cmpi.w #6,PLAYERS
    beq.s old_two
    cmpi.w #8,PLAYERS
    bne.s loaded
old_two:
    moveq #2,%d0
loaded:
    move.w %d0,COUNT
    bsr.w effective
    tst.w PMODE
    bne.s loaded_done             | force applies playoff encoding after native password decode
    bsr.w league_value
    move.w %d0,PLAYERS
loaded_done:
    movem.l (%sp)+,%d0-%d2/%a0-%a1
    rts

| Never erase a saved four-pad preference merely because the adapter is absent.
effective:                       | D0=effective1..4; synchronize TM, preserve preferred COUNT
    move.w COUNT,%d0
    cmpi.w #1,%d0
    bcs.s one
    cmpi.w #4,%d0
    bls.s count_valid
one:moveq #1,%d0
count_valid:
    tst.w MTAP
    bne.s adapter
    cmpi.w #2,%d0
    bls.s adapter
    moveq #2,%d0
adapter:
    clr.w TM
    cmpi.w #3,%d0
    bcs.s effective_done
    move.w %d0,TM
effective_done:
    rts
league_value:                    | D0 count -> native Regular Season Players
    subq.w #1,%d0
    add.w %d0,%d0
    lea league_values(%pc),%a0
    move.w (%a0,%d0.w),%d0
    rts
league:
    movem.l %d0/%a0,-(%sp)
    bsr.s effective
    bsr.s league_value
    move.w %d0,PLAYERS
    movem.l (%sp)+,%d0/%a0
    rts

playoff:                         | after native17CA0/17D16; keep bracket/password/club untouched
    move.l %d0,-(%sp)
    bsr.s effective
    cmpi.w #2,%d0
    bcs.s po_one
    moveq #1,%d0                | native saved co-op side encoding without adapter
    tst.w MTAP
    beq.s po_encoded
    moveq #3,%d0                | adapter table's two-on-one entry
    bra.s po_encoded
po_one:
    moveq #0,%d0
po_encoded:
    move.w %d0,0xFFFFCEF0
    moveq #7,%d0
    tst.w MTAP
    beq.s po_players
    moveq #11,%d0
po_players:
    sub.w 0xFFFFCEF0,%d0
    move.w %d0,PLAYERS
    move.l (%sp)+,%d0
    rts

step:                            | one real native key (caller excludes unchanged-row writes)
    movem.l %d0-%d1/%a0,-(%sp)
    bsr.w effective
    moveq #2,%d1
    tst.w MTAP
    beq.s max_ready
    moveq #4,%d1
max_ready:
    tst.w %d2
    bmi.s left
    addq.w #1,%d0
    cmp.w %d1,%d0
    bls.s selected
    moveq #1,%d0
    bra.s selected
left:
    subq.w #1,%d0
    bne.s selected
    move.w %d1,%d0
selected:
    move.w %d0,COUNT
    bsr.w store
    tst.w PMODE
    bne.s step_po
    bsr.w league
    bra.s step_ready
step_po:
    bsr.w playoff
step_ready:
    move.w PLAYERS,%d3
    movem.l (%sp)+,%d0-%d1/%a0
    rts

label:                           | D0 points at native word22 +22chars; all other registers kept
    move.l %a0,-(%sp)
    bsr.w effective
    subq.w #1,%d0
    mulu.w #24,%d0
    lea labels(%pc),%a0
    adda.w %d0,%a0
    move.l %a0,%d0
    movea.l (%sp)+,%a0
    rts

store:                           | active slot only; native slot manager snapshots it on switch
    movem.l %d0-%d2/%a0-%a1,-(%sp)
    move.w %sr,-(%sp)
    ori.w #0x700,%sr
    move.b #1,MAP
    lea RECORD,%a0
    move.b #0x50,(%a0)
    move.b #0x43,2(%a0)
    move.w COUNT,%d0
    move.b %d0,4(%a0)
    not.b %d0
    move.b %d0,6(%a0)
    .if WITH_PASS_HEIGHT
    jsr 0x2DE408
    .endif
resum:
    lea 0x200001,%a0
    moveq #0,%d0
    move.w #0x1FFE-1,%d1
sum:
    add.b (%a0),%d0
    addq.l #2,%a0
    dbra %d1,sum
    not.b %d0
    move.b %d0,(%a0)
    not.b %d0
    move.b %d0,2(%a0)
    move.b #0,MAP
    move.w (%sp)+,%sr
    movem.l (%sp)+,%d0-%d2/%a0-%a1
    rts

| r36: the season's difficulty into the active slot (season view only; same stack frame and
| checksum tail as store). Nothing is written when the record already holds it.
diffstore:
    tst.w 0xFFFFF06C
    beq.w 9f
    cmpi.w #2,DIFF
    bhi.w 9f
    movem.l %d0-%d2/%a0-%a1,-(%sp)
    move.w %sr,-(%sp)
    ori.w #0x700,%sr
    move.b #1,MAP
    moveq #0,%d2                       | becomes 1 when a byte changes
    lea DREC,%a0
    move.w DIFF,%d0
    bsr.w putb
    not.b %d0
    addq.l #2,%a0
    bsr.w putb
    bsr.w settingsvalid                | first Start captured menu values before Auto normalizes
    beq.w settingsready                | never overwrite that record with in-game D058=0
    lea SREC,%a0                       | Per.Length, Goalie Ctrl, Penalties, Line Changes, Fighting
    .if WITH_ICING_MENU
    moveq #0x55,%d0
    .else
    moveq #0x54,%d0
    .endif
    bsr.w putb
    moveq #0x5A,%d1
    move.w 0xFFFFD050,%d0
    bsr.w putx
    move.w 0xFFFFD052,%d0
    bsr.w putx
    move.w 0xFFFFD056,%d0
    bsr.w putx
    move.w 0xFFFFD058,%d0
    bsr.w putx
    move.w 0xFFFFF004,%d0
    bsr.w putx
    .if WITH_ICING_MENU
    move.w 0xFFFFF0EE,%d0
    eor.b %d0,%d1
    move.l %a0,-(%sp)
    addq.l #4,%a0                     | logical1FFD, final free byte before the native bank CRC
    bsr.w putb
    movea.l (%sp)+,%a0
    .endif
    move.b %d1,%d0
    addq.l #2,%a0
    bsr.w putb
settingsready:
    tst.w %d2
    bne.w resum                        | something changed: new checksum (store's tail)
    move.b #0,MAP
    move.w (%sp)+,%sr
    movem.l (%sp)+,%d0-%d2/%a0-%a1
9:  rts
| Compatibility entry remains at +56, but migration never unlocks a played season.
openrow:
    andi.b #0xFB,%ccr
    rts

| Validate every enum as well as the XOR. D0=0/Z on valid, -1/not-Z otherwise.
settingsvalid:
    lea SREC,%a0
    .if WITH_ICING_MENU
    cmpi.b #0x55,(%a0)
    beq.s validtag
    .endif
    cmpi.b #0x54,(%a0)                 | corrected pre-match record
    beq.s validtag
    cmpi.b #0x53,(%a0)                 | accept the earlier in-game record
    bne.s invalidsettings
validtag:
    moveq #0x5A,%d1
    lea limits(%pc),%a1
    moveq #4,%d0
    move.w %d2,-(%sp)
checksetting:
    addq.l #2,%a0
    move.b (%a0),%d2
    cmp.b (%a1)+,%d2
    bhi.s badsetting
    eor.b %d2,%d1
    dbra %d0,checksetting
    .if WITH_ICING_MENU
    cmpi.b #0x55,SREC
    bne.s oldcheck
    move.b 4(%a0),%d2
    cmpi.b #1,%d2
    bhi.s badsetting
    eor.b %d2,%d1
oldcheck:
    .endif
    cmp.b 2(%a0),%d1
    movem.w (%sp)+,%d2                  | preserve the checksum compare flags
    bne.s invalidsettings
    moveq #0,%d0
    rts
badsetting:
    move.w (%sp)+,%d2
invalidsettings:
    moveq #-1,%d0
    rts
limits: .byte 3,1,2,2,1
    .even

loadsettings:
    move.l %a1,-(%sp)
    bsr.s settingsvalid
    bne.w legacysettings
    lea SREC,%a0
    moveq #0,%d0
    move.b 2(%a0),%d0
    move.w %d0,0xFFFFD050
    move.b 4(%a0),%d0
    move.w %d0,0xFFFFD052
    move.b 6(%a0),%d0
    move.w %d0,0xFFFFD056
    move.b 8(%a0),%d0
    move.w %d0,0xFFFFD058
    move.w %d0,0xFFFFD072
    move.b 10(%a0),%d0
    move.w %d0,0xFFFFF004
    .if WITH_ICING_MENU
    clr.w 0xFFFFF0EE                  | old S/T records always retain native Icing On
    cmpi.b #0x55,SREC
    bne.s icingloaded
    moveq #0,%d0
    move.b 14(%a0),%d0
    move.w %d0,0xFFFFF0EE
icingloaded:
    .endif
    cmpi.b #0x53,SREC                  | old S record could have stored normalized Auto as On
    bne.w settingsloaded
    tst.w 0xFFFFD058
    bne.w settingsloaded
    cmpi.b #0x53,0x203D41
    bne.w settingsloaded
    cmpi.b #0x33,0x203D43
    bne.w settingsloaded
    cmpi.b #0x53,0x203D45
    bne.w settingsloaded
    cmpi.b #0x56,0x203D47
    bne.w settingsloaded
    cmpi.b #2,EXTRA+90                 | old snapshot retains D072=Auto
    bne.w settingsloaded
    tst.b EXTRA+88
    bne.w settingsloaded
    move.w #2,0xFFFFD058
    move.w #2,0xFFFFD072
    bra.w settingsloaded
legacysettings:
    .if WITH_ICING_MENU
    clr.w 0xFFFFF0EE                  | played absent/corrupt old records preserve native Icing On
    .if WITH_PREF_DEFAULTS
    tst.b 0x202011
    bne.s legacy_icing_ready
    tst.b 0x202013
    bne.s legacy_icing_ready
    move.w #ICING_DEFAULT,0xFFFFF0EE  | fresh Icing On; valid saved choices still win
legacy_icing_ready:
    .endif
    .endif
    | Empty/new slots retain editable menu choices. Played old seasons stay
    | locked and recover four values from their old slot snapshot when present.
    tst.b 0x202011                     | logical1008 games played, high then low
    bne.s oldplayed
    tst.b 0x202013
    beq.w settingsloaded
oldplayed:
    clr.w 0xFFFFD050                   | explicit legacy fallback, not another slot's RAM
    clr.w 0xFFFFD052
    move.w #2,0xFFFFD056
    move.w #2,0xFFFFD058
    move.w #2,0xFFFFD072
    clr.w 0xFFFFF004                   | Fighting was never in the old snapshot; default Off
    cmpi.b #0x53,0x203D41
    bne.w settingsloaded
    cmpi.b #0x33,0x203D43
    bne.w settingsloaded
    cmpi.b #0x53,0x203D45
    bne.w settingsloaded
    cmpi.b #0x56,0x203D47
    bne.w settingsloaded
    lea EXTRA,%a0
    moveq #0,%d0
    move.b 20(%a0),%d0                | high byte must be zero for every enum
    bne.w settingsloaded
    move.b 22(%a0),%d0
    cmpi.w #3,%d0
    bhi.w settingsloaded
    move.w %d0,0xFFFFD050
    moveq #0,%d0
    move.b 24(%a0),%d0
    bne.w settingsloaded
    move.b 26(%a0),%d0
    cmpi.w #1,%d0
    bhi.w settingsloaded
    move.w %d0,0xFFFFD052
    moveq #0,%d0
    move.b 32(%a0),%d0
    bne.w settingsloaded
    move.b 34(%a0),%d0
    cmpi.w #2,%d0
    bhi.w settingsloaded
    move.w %d0,0xFFFFD056
    moveq #0,%d0
    move.b 88(%a0),%d0                | D072 is the original Auto/On/Off menu value
    bne.w settingsloaded
    move.b 90(%a0),%d0
    cmpi.w #2,%d0
    bhi.w settingsloaded
    move.w %d0,0xFFFFD058
    move.w %d0,0xFFFFD072
settingsloaded:
    movea.l (%sp)+,%a1
    rts

startsettings:
    tst.w 0xFFFFF06C
    beq.s startdone
    movem.l %d0-%d2/%a0-%a1,-(%sp)
    move.w %sr,-(%sp)
    ori.w #0x700,%sr
    move.b #1,MAP
    tst.b 0x202011
    bne.s restorelocked
    tst.b 0x202013
    bne.s restorelocked
    clr.b SREC                         | a new season freezes its chosen menu values, not old ones
    bra.s capturemenu
restorelocked:
    move.w PLAYERS,%d2                 | seasonmenu already chose Home/Visitor for this fixture
    bsr.w load                         | restore before any native match normalization
    tst.w PMODE
    bne.s restoredside
    cmpi.w #1,COUNT
    bne.s restoredside
    cmpi.w #1,%d2
    bcs.s restoredside
    cmpi.w #2,%d2
    bhi.s restoredside
    move.w %d2,PLAYERS                 | loading the count must not turn an away human into Home
restoredside:
    cmpi.b #0x53,SREC
    bne.s capturemenu
    clr.b SREC                         | promote recovered old S record to pre-match T format
capturemenu:
    move.b #0,MAP
    bsr.w diffstore
    move.w (%sp)+,%sr
    movem.l (%sp)+,%d0-%d2/%a0-%a1
startdone:
    rts

putx:                                  | next byte = d0, folded into the xor check d1
    addq.l #2,%a0
    eor.b %d0,%d1
putb:                                  | (a0) = d0 unless it already is; d2 = 1 on a change
    cmp.b (%a0),%d0
    beq.s 1f
    move.b %d0,(%a0)
    moveq #1,%d2
1:  rts

league_values: .word 1,3,5,6
labels:
    .word 22
    .ascii "One                   "
    .word 22
    .ascii "Two - Teammates       "
    .word 22
    .ascii "Three - Teammates     "
    .word 22
    .ascii "Four - Teammates      "
    .even

| Standalone native playoffs own a separate optional NC record in the Full
| bank's shared-profile gap. A season slot's PC preference is never changed.
native_load:
    .if WITH_PASS_HEIGHT
    jsr 0x2DE404
    .endif
    movem.l %d0/%a0,-(%sp)
    move.w #1,NCOUNT
    lea NRECORD,%a0
    cmpi.b #0x4E,(%a0)
    bne.s nloaded
    cmpi.b #0x43,2(%a0)
    bne.s nloaded
    moveq #0,%d0
    move.b 4(%a0),%d0
    cmpi.w #1,%d0
    bcs.s nloaded
    cmpi.w #5,%d0
    bhi.s nloaded
    not.b %d0
    cmp.b 6(%a0),%d0
    bne.s nloaded
    not.b %d0
    move.w %d0,NCOUNT
nloaded:
    movem.l (%sp)+,%d0/%a0
    rts
native_effective:                  | D0 preference code, clamp Three/Four only with no adapter
    move.w NCOUNT,%d0
    cmpi.w #1,%d0
    bcs.s none
    cmpi.w #5,%d0
    bls.s nvalid
none:moveq #1,%d0
nvalid:
    tst.w MTAP
    bne.s neffective
    cmpi.w #3,%d0
    bcs.s neffective
    cmpi.w #4,%d0
    bhi.s neffective
    moveq #2,%d0
neffective:
    rts
native_sides:
    btst #0,0xFFFFC2FA             | the existing two-actor shootout controls remain authoritative
    bne.w nsides_done
    movem.l %d0-%d2,-(%sp)
    bsr.s native_effective
    clr.w TM
    cmpi.w #5,%d0
    beq.s nhead
    cmpi.w #3,%d0
    bcs.s ntm_ready
    move.w %d0,TM
ntm_ready:
    moveq #0,%d1
    cmpi.w #1,%d0
    beq.s nencoded
    moveq #1,%d1
    tst.w MTAP
    beq.s nencoded
    moveq #3,%d1
    bra.s nencoded
nhead:
    moveq #2,%d1
    tst.w MTAP
    beq.s nencoded
    moveq #4,%d1
nencoded:
    move.w %d1,0xFFFFCEF0
    moveq #7,%d2
    tst.w MTAP
    beq.s nplayers
    moveq #11,%d2
nplayers:
    sub.w %d1,%d2
    move.w %d2,PLAYERS
    move.w 0xFFFFC328,%d2           | native bracket assignment still picks the user's club/side
    cmpi.w #1,%d2
    bcs.s nsides_restore
    cmpi.w #2,%d2
    bhi.s nsides_restore
    clr.w 0xFFFFC32A
    clr.l 0xFFFFC32C
    cmpi.w #1,%d0
    beq.s nsides_restore
    cmpi.w #5,%d0
    bne.s nteammates
    neg.w %d2
    addq.w #3,%d2
nteammates:
    move.w %d2,0xFFFFC32A
nsides_restore:
    movem.l (%sp)+,%d0-%d2
nsides_done:
    rts
native_step:
    movem.l %d0-%d1,-(%sp)
    bsr.w native_effective
    tst.w %d2
    bmi.s nleft
    addq.w #1,%d0
    tst.w MTAP
    bne.s nright_wrap
    cmpi.w #3,%d0
    bne.s nright_wrap
    moveq #5,%d0
nright_wrap:
    cmpi.w #5,%d0
    bls.s nselected
    moveq #1,%d0
    bra.s nselected
nleft:
    subq.w #1,%d0
    bne.s nleft_skip
    moveq #5,%d0
nleft_skip:
    tst.w MTAP
    bne.s nselected
    cmpi.w #4,%d0
    bne.s nselected
    moveq #2,%d0
nselected:
    move.w %d0,NCOUNT
    bsr.w native_store
    bsr.w native_sides
    move.w PLAYERS,%d3
    movem.l (%sp)+,%d0-%d1
    rts
native_label:
    move.l %a0,-(%sp)
    bsr.w native_effective
    cmpi.w #5,%d0
    beq.s nhead_label
    subq.w #1,%d0
    mulu.w #24,%d0
    lea labels(%pc),%a0
    adda.w %d0,%a0
    bra.s nlabel_ready
nhead_label:
    lea headlabel(%pc),%a0
nlabel_ready:
    move.l %a0,%d0
    movea.l (%sp)+,%a0
    rts
native_store:
    movem.l %d0-%d1/%a0,-(%sp)
    move.w %sr,-(%sp)
    ori.w #0x700,%sr
    move.b #1,MAP
    lea NRECORD,%a0
    move.b #0x4E,(%a0)
    move.b #0x43,2(%a0)
    move.w NCOUNT,%d0
    move.b %d0,4(%a0)
    not.b %d0
    move.b %d0,6(%a0)
    lea 0x204001,%a0              | Full bank only; active season preference/checksum untouched
    moveq #0,%d0
    move.w #0x1FFE-1,%d1
nsum:
    add.b (%a0),%d0
    addq.l #2,%a0
    dbra %d1,nsum
    not.b %d0
    move.b %d0,(%a0)
    not.b %d0
    move.b %d0,2(%a0)
    move.b #0,MAP
    move.w (%sp)+,%sr
    movem.l (%sp)+,%d0-%d1/%a0
    rts
is_native_players:
    tst.w 0xFFFFF06C
    bne.s not_native
    cmpi.w #2,%d7
    bne.s not_native
    tst.w PMODE
    beq.s not_native
    cmpi.w #3,PMODE
    bhi.s not_native
    tst.w PMODE                   | nonzero: handled by native helpers
    rts
not_native:
    cmp.w %d7,%d7                 | Z=1: keep existing season/native path
    rts
writer:
    .if WITH_QUICKGAME
    tst.w 0xFFFFF84C
    beq.s ordinary_writer
    cmpi.w #2,%d7
    bne.s ordinary_writer
    cmp.w PLAYERS,%d3
    beq.s quick_write_flags
    jsr 0x229008
quick_write_flags:
    tst.w %d2
    rts
ordinary_writer:
    .endif
    .if WITH_TRANSFERS
    cmpi.w #26,%d7
    bne.s not_transfer_writer
    jmp 0x254004
not_transfer_writer:
    .endif
    .if WITH_MOMENTUM
    cmpi.w #48+TRANSFER_ROW_SHIFT,%d7
    bne.s not_momentum_writer
    jmp 0x2E680C
not_momentum_writer:
    .endif
    .if WITH_FACEOFF_DOTS
    cmpi.w #46+TRANSFER_ROW_SHIFT,%d7
    bne.s not_dots_writer
    jmp 0x2E680C
not_dots_writer:
    .endif
    .if WITH_AI_SHOT_PLAN
    cmpi.w #44+TRANSFER_ROW_SHIFT,%d7
    bne.s not_plan_writer
    jmp 0x2E680C
not_plan_writer:
    .endif
    .if WITH_STRICT_SO
    cmpi.w #42+TRANSFER_ROW_SHIFT,%d7
    bne.s not_strict_writer
    jmp 0x2E680C
not_strict_writer:
    .endif
    .if WITH_ALT_GOALIES
    cmpi.w #40+TRANSFER_ROW_SHIFT,%d7
    bne.s not_alt_writer
    jmp 0x2E680C
not_alt_writer:
    .endif
    .if WITH_PICKUP_DELAY
    cmpi.w #38+TRANSFER_ROW_SHIFT,%d7
    bne.s not_pickup_writer
    jmp 0x2E680C
not_pickup_writer:
    .endif
    .if WITH_PASS_CHARGE
    cmpi.w #36+TRANSFER_ROW_SHIFT,%d7
    bne.s not_charge_writer
    jmp 0x2E680C
not_charge_writer:
    .endif
    .if WITH_PENALTY_RATE
    cmpi.w #34+TRANSFER_ROW_SHIFT,%d7
    bne.s not_rate_writer
    jmp 0x2E680C
not_rate_writer:
    .endif
    .if WITH_DIRECTIONAL
    cmpi.w #30+TRANSFER_ROW_SHIFT,%d7
    beq.s directional_writer
    cmpi.w #32+TRANSFER_ROW_SHIFT,%d7
    bne.s not_directional_writer
directional_writer:
    jmp 0x2E680C
not_directional_writer:
    .endif
    .if WITH_PASS_SPEED
    cmpi.w #28+TRANSFER_ROW_SHIFT,%d7
    bne.s speed_writer_done
    jmp 0x2DE604
speed_writer_done:
    .endif
    .if WITH_PASS_HEIGHT
    cmpi.w #26+TRANSFER_ROW_SHIFT,%d7
    bne.s height_writer_done
    jmp 0x2DE40C
height_writer_done:
    .endif
    .if WITH_CRIT_OPTION
    cmpi.w #22,%d7
    .if WITH_CRIT_LOCK
    bne.s other_option
    tst.w 0xFFFFF06C                  | native modes retain the global preference writer
    beq.w replay_writer
    tst.w 0xFFFFE3E8                  | selected header's actual completed-game index
    beq.w replay_writer               | starting an unfinished first match does not lock Crit
    cmpi.w #1,0xFFFFE3F0              | selected season has completed a match
    beq.w crit_locked
    cmpi.w #3,0xFFFFE3F0              | that season's playoffs
    beq.w crit_locked
    cmpi.w #4,0xFFFFE3F0              | completed season review
    beq.w crit_locked
    bra.w replay_writer
other_option:
    .else
    beq.w replay_writer
    .endif
    .endif
    cmpi.w #20,%d7                    | presentation preference stays editable in a locked season
    beq.w replay_writer
    .if WITH_DIRECTIONAL
    bsr.w is_native_players
    .else
    bsr.s is_native_players
    .endif
    beq.s season_writer
    cmp.w PLAYERS,%d3
    beq.s nwrite_flags
    bsr.w native_step
    jmp 0x2095D6
nwrite_flags:
    tst.w %d2
    rts
season_writer:
    jmp 0x2F9808
    .if WITH_CRIT_LOCK
crit_locked:
    tst.w %d2                        | exact native writer return flags; no settings/SRAM writes
    rts
    .endif
replay_writer:
    jmp 0x2DE008
display:
    .if WITH_QUICKGAME
    tst.w 0xFFFFF84C
    beq.s ordinary_display
    cmpi.w #2,%d7
    bne.s ordinary_display
    jsr 0x229004
    move.l %d0,-(%sp)
    jsr 0x20961A
    movea.l (%sp)+,%a1
    addq.l #4,%sp
    jmp 0x11BA4
ordinary_display:
    .endif
    .if WITH_CRIT_LOCK
    bsr.w is_native_players
    .else
    bsr.s is_native_players
    .endif
    beq.s season_display
    bsr.w native_label
    move.l %d0,-(%sp)
    jsr 0x20961A
    movea.l (%sp)+,%a1
    addq.l #4,%sp
    jmp 0x11BA4
season_display:
    jmp 0x2F9800
headlabel:
    .word 22
    .ascii "Two - Head to Head    "
    .even
