This gives me this code:
Macro
DAFBSpeedPI ; A2->DAFBBase,A6->PrimFrame.
Tst.b IsSlowClock(A6) ; If CPU is running “slow,”
Bne.s @EndDAFBSpeedPI ; then leave things alone.
Tst.b wombatDAFB(A6) ; If we’re on a Wombat,
Bne.s @WombatSpeedPI ; then do the Wombat setup.
Ori.l #dafb33MHzConfig,DAFB_Config(A2) ; Otherwise, setup for 33MHz operation.
Bra.s @EndDAFBSpeedPI ; (Skip Wombat setup.)
@WombatSpeedPI Andi.l #dafbNoInterleave,DAFB_Config(A2) ; For Wombat, vRAM interleaving is not possible.
Ori.l #dafb33MHzConfigW,DAFB_Config(A2) ; Set up for at least 33MHz operation.
Subq #2,Sp ; Make some room on the stack.
Move.w DAFBFlags+2(A2),(Sp) ; Get the DAFBFlags.
Andi.w #(1<<w40MHz),(Sp)+ ; If the 40MHz bit is not set,
Beq.s @EndDAFBSpeedPI ; then just go on.
Ori.l #dafb40MHzConfigW,DAFB_Config(A2) ; Otherwise, set up for 40MHz operation.
@EndDAFBSpeedPI
EndMacro
As I do not have a Wombat only this part is relevant:
Macro
DAFBSpeedPI ; A2->DAFBBase,A6->PrimFrame.
Tst.b IsSlowClock(A6) ; If CPU is running “slow,”
Bne.s @EndDAFBSpeedPI ; then leave things alone.
Ori.l #dafb33MHzConfig,DAFB_Config(A2) ; Otherwise, setup for 33MHz operation.
Bra.s @EndDAFBSpeedPI ; (Skip Wombat setup.)
@EndDAFBSpeedPI
EndMacro
DAFBBase = $F980 0000, DAFB_Config = $10, dafb33MHzConfig = $0000 0800
So the code above set bit 11 of Frame Buffer Config register, if it think that CPU is running not snow. Elsewhere do nothing.
That is not the appropriate setting based on MEMCjr manual (should be $0000 0A00)
Comments do only tell about 33MHz and 25Mhz. So what does it do in case of 40MHz?
This depends on IsSlowClock(A6)
IsSlowClock is set to 1 in PrimaryInit.a
So Tst.b IsSlowClock(A6) check if (PrimFrame + 1) contain 0 or something else.
To understand PrimFrame record I assume we need to read PrimaryInit.a