; this checks your cpu and installs the correct bltclear() patch
; last update 13/12/2003

BltClearCheck:
    btst #AFB_68030,AttnFlags+1(a6)     ;test if 030 
     beq.b QBC              ;if flag is zero then we have a 020 else we could have 030+
    btst #AFB_68040,AttnFlags+1(a6) ;test if 040
     bne.b QBC              ;if flag is set then we have 040+   
    move.l MemForPatch,d0       ; test passed, we have a 030
    add.l #BltClear030-StartPatch,d0
    move.w #_LVOBltClear,a0
    movea.l GFXBase,a1
     jsr _LVOSetFunction(a6)
    tst.l opt0
     bne.b .exit
    movea.l DOSBase,a6
    move.l #QBC030Msg,d1
     jsr _LVOPutStr(a6)
    movea.l 4.w,a6
.exit: rts
 cnop 0,4
QBC: move.l MemForPatch,d0
    add.l #BltClear-StartPatch,d0
    move.w #_LVOBltClear,a0
    movea.l GFXBase,a1
     jsr _LVOSetFunction(a6)
    tst.l opt0
     bne.b .exit
    movea.l DOSBase,a6
    move.l #QBCMsg,d1
     jsr _LVOPutStr(a6)
    movea.l 4.w,a6
.exit: rts
