; this installs patches that requires FBlit
; last update 13/12/2003

FBlitCheck:
    movea.l 4.w,a6
    lea fblitportname,a1
     jsr _LVOFindPort(a6)
    tst.l d0
     beq.w .InstallQBSBlit
    tst.l gopt19
      bne.b .allocraster
    move.l #$1004,D0  ; 4096 bytes for buffer 4 bytes for swap
    move.l #MEMF_FAST|MEMF_REVERSE,D1 ;requirements
     jsr _LVOAllocMem(A6)
    tst.l d0
     beq.b .exit
    movea.l MemForPatch,a4
    move.l D0,FTextMem-StartPatch(a4)
    add.l #$1000,d0
    move.l d0,AbsFtextSwap1+2-StartPatch(a4)
    move.l d0,AbsFtextSwap2+2-StartPatch(a4)
    move.l d0,AbsFtextSwap3+2-StartPatch(a4)
    movea.l GFXBase,a1
    PATCH Text
.allocraster:
    tst.l gopt25
     bne.b .string
    PATCH AllocRaster
.string:
    tst.l opt0
     bne.b .exit
    movea.l DOSBase,a6
    move.l #FBlitMsg,d1
     jsr _LVOPutStr(a6)
    movea.l 4.w,a6
.exit:
    movea.l GFXBase,a1
   rts
.InstallQBSBlit:
    movea.l GFXBase,a1
    tst.l gopt20
     bne.b .rts
    PATCH QBSBlit
.rts
   rts


