| Presentation keeps the native club rating scale (EDM94), with the change
| in actual roster mean applied after transfers. No price/player/stat writes.
| Internal2580EE still returns the actual player mean for its own engine users.
 .text
 .globl _start
_start:
 jsr 0x2580EE
 tst.w %d0
 bmi.w done                       | ordinary/no transfer: native original club lookup
 move.w %sr,-(%sp)
 movem.l %d1-%d7/%a0-%a1,-(%sp)
 move.w %d0,%d6                    | current canonical roster's base-player mean
 moveq #0,%d7
 move.w 0x28(%a2),%d7
 cmpi.w #31,%d7
 bhi.s invalid
 move.w %d7,%d1
 mulu.w #52,%d1
 lea 0x238020,%a0                  | immutable original canonical transfer roster
 adda.w %d1,%a0
 lea 0x239EC0,%a1                  | unchanged base player overall catalogue
 moveq #0,%d4
 moveq #0,%d5
 moveq #25,%d3
base_loop:
 moveq #0,%d1
 move.w (%a0)+,%d1
 cmpi.w #0xFFFF,%d1
 beq.s base_sum_done
 cmpi.w #831,%d1
 bhi.s invalid
 moveq #0,%d2
 move.b (%a1,%d1.w),%d2
 add.w %d2,%d5
 addq.w #1,%d4
 dbra %d3,base_loop
base_sum_done:
 tst.w %d4
 beq.s invalid
 divu.w %d4,%d5
 sub.w %d5,%d6                    | current floor(mean) - original floor(mean)
 lea 0x1E92B4,%a0                  | exact original32-team presentation grades
 moveq #0,%d0
 move.b (%a0,%d7.w),%d0
 add.w %d6,%d0
 bpl.s nonnegative
 moveq #0,%d0
nonnegative:
 cmpi.w #99,%d0
 bls.s restored
 moveq #99,%d0                    | native two-digit rating limit
 bra.s restored
invalid:
 moveq #-1,%d0
restored:
 movem.l (%sp)+,%d1-%d7/%a0-%a1
 move.w (%sp)+,%sr
done:
 tst.w %d0
 rts
 .ascii "OVM2"
