home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / utilities / drives / install / install.s < prev    next >
Encoding:
Text File  |  1994-07-01  |  15.9 KB  |  811 lines

  1.         opt    o+,ow-,ow6+
  2.         output    Source:Install
  3.  
  4.         ; Install v1.2
  5.         ; © 1990 by David Kinder
  6.  
  7.         ; "It installs disks!"
  8.  
  9.         ; Assemble using Devpac v3
  10.  
  11.         ; Note that the header "system.gs" must be compiled
  12.         ; with v36 or higher include files.
  13.  
  14.         ; Thanks to HiSoft, Iron Maiden, Megadeth, Judas Priest,
  15.         ; The Sisters of Mercy, The Damned and Oriel...
  16.  
  17.         section    Install_Code,code
  18.  
  19.         incdir    Source:include/
  20.         include    devices/trackdisk.i
  21.         include    workbench/icon_lib.i
  22.         include    workbench/workbench.i
  23.  
  24. CALLSYS        MACRO                ; A usefull macro, saves
  25.         jsr    _LVO\1(a6)        ; a few bytes
  26.         ENDM
  27.  
  28.         suba.l    a1,a1
  29.         CALLEXEC FindTask
  30.         move.l    d0,a5
  31.  
  32.         tst.l    pr_CLI(a5)        ; Are we CLI or Workbench?
  33.         bne.s    EndStartup
  34.  
  35.         lea    pr_MsgPort(a5),a0
  36.         CALLSYS    WaitPort        ; Wait for a message
  37.         lea    pr_MsgPort(a5),a0
  38.         CALLSYS    GetMsg            ; Then get it
  39.         move.l    d0,ReturnMsg
  40.  
  41. EndStartup    bsr.s    _Main
  42.         tst.l    ReturnMsg
  43.         beq.s    ExitToDOS
  44.         CALLEXEC Forbid
  45.         move.l    ReturnMsg,a1
  46.         CALLSYS    ReplyMsg
  47.  
  48. ExitToDOS    moveq    #0,d0
  49.         rts
  50.  
  51. _Main        lea    IntName,a1        ; Open 'intuition.library'
  52.         moveq    #36,d0
  53.         CALLEXEC OpenLibrary
  54.         move.l    d0,_IntuitionBase
  55.         beq.s    NoNewOS
  56.  
  57.         lea    Gadg0,a0
  58.         bsr.s    ModGadg2
  59.         lea    Gadg1,a0
  60.         bsr.s    ModGadg2
  61.         lea    Gadg2,a0
  62.         bsr.s    ModGadg
  63.         lea    Gadg3,a0
  64.         bsr.s    ModGadg
  65.  
  66.         eori    #CHECKED,KS13O+mi_Flags
  67.         eori    #CHECKED,KS20O+mi_Flags
  68.         bra.s    RunAllOS
  69.  
  70. ModGadg        subi    #1,gg_TopEdge(a0)    ; Changes for OS 2.0
  71. ModGadg2    subi    #2,gg_LeftEdge(a0)
  72.         addi    #4,gg_Width(a0)
  73.         addi    #2,gg_Height(a0)
  74.         move.l    #x2_GBord1,gg_GadgetRender(a0)
  75.         move.l    gg_GadgetText(a0),a1
  76.         addi    #2,it_LeftEdge(a1)
  77.         addi    #1,it_TopEdge(a1)
  78.         move.b    #2,it_FrontPen(a1)
  79.         rts
  80.  
  81. NoNewOS        lea    IntName,a1        ; Try again
  82.         moveq    #0,d0
  83.         CALLEXEC OpenLibrary
  84.         move.l    d0,_IntuitionBase
  85.         beq    NoIntuition        ; Open failed
  86.  
  87. RunAllOS    lea    DosName,a1        ; Open 'dos.library'
  88.         moveq    #0,d0
  89.         CALLSYS    OpenLibrary
  90.         move.l    d0,_DOSBase
  91.         beq    NoDos
  92.         lea    GfxName,a1        ; Open 'graphics.library'
  93.         moveq    #0,d0
  94.         CALLSYS    OpenLibrary
  95.         move.l    d0,_GfxBase
  96.         beq    NoGfx
  97.  
  98.         tst.l    ReturnMsg        ; Workbench?
  99.         beq.s    NoIconLib
  100.  
  101.         lea    IconName,a1        ; Open 'icon.library'
  102.         moveq    #0,d0
  103.         CALLSYS    OpenLibrary
  104.         move.l    d0,_IconBase
  105.         beq.s    NoIconLib
  106.  
  107.         move.l    ReturnMsg,a3
  108.         move.l    sm_ArgList(a3),a3
  109.         move.l    wa_Lock(a3),d1
  110.         CALLDOS    CurrentDir        ; Move to current directory
  111.  
  112.         move.l    wa_Name(a3),a0
  113.         CALLICON GetDiskObject
  114.         move.l    d0,a5
  115.         tst.l    d0
  116.         beq.s    EndIconFind
  117.  
  118.         move.l    do_ToolTypes(a5),a0
  119.         lea    ToolType,a1
  120.         CALLSYS    FindToolType
  121.         beq.s    EndIconCode
  122.  
  123.         move.b    #1,CheckTest
  124. EndIconCode    move.l    a5,a0
  125.         CALLSYS    FreeDiskObject
  126.  
  127. EndIconFind    move.l    _IconBase,a1
  128.         CALLEXEC CloseLibrary
  129.  
  130. NoIconLib    moveq    #0,d0
  131.         lea    SBBlock,a0
  132.         lea    DiskBuffer1,a1
  133. BootLoop1    move    (a0,d0),(a1,d0)        ; Transfer bootblock
  134.         addq    #2,d0
  135.         cmpi    #EBBlock-SBBlock,d0
  136.         bne    BootLoop1
  137.  
  138.         moveq    #0,d0
  139.         lea    SNBBlock,a0
  140.         lea    DiskBuffer2,a1
  141. BootLoop2    move    (a0,d0),(a1,d0)
  142.         addq    #2,d0
  143.         cmpi    #ENBBlock-SNBBlock,d0
  144.         bne    BootLoop2
  145.  
  146.         moveq    #MP_SIZE,d0        ; Put together a port where
  147.         move.l    #MEMF_PUBLIC!MEMF_CLEAR,d1
  148.         CALLEXEC AllocMem        ; we can recieve messages
  149.         move.l    d0,a3            ; from 'trackdisk.device'
  150.         beq    NoMemPort
  151.         move.l    a3,MsgPort
  152.         moveq    #-1,d0
  153.         CALLSYS    AllocSignal
  154.         cmpi.b    #-1,d0
  155.         beq    NoSigPort
  156.         move.b    d0,MP_SIGBIT(a3)
  157.         suba.l    a1,a1
  158.         CALLSYS    FindTask
  159.         move.b    #NT_MSGPORT,LN_TYPE(a3)
  160.         move.b    #PA_SIGNAL,MP_FLAGS(a3)
  161.         move.l    d0,MP_SIGTASK(a3)
  162.         lea    MP_MSGLIST(a3),a0
  163.         NEWLIST    a0
  164.  
  165.         moveq    #IOSTD_SIZE,d0        ; Now use message port
  166.         move.l    #MEMF_PUBLIC!MEMF_CLEAR,d1
  167.         CALLSYS    AllocMem        ; to construct an
  168.         tst.l    d0            ; IORequest struct so we
  169.         beq    NoMemIO            ; can communicate with
  170.         move.l    d0,a0            ; the drive
  171.         move.l    a0,IORequest
  172.         move.l    a3,MN_REPLYPORT(a0)
  173.         move    #IOSTD_SIZE,MN_LENGTH(a0)
  174.         move.b    #NT_MESSAGE,LN_TYPE(a0)
  175.  
  176.         moveq    #0,d0            ; Which drives are present?
  177.         lea    Gadg0+gg_Flags,a5
  178.         bsr    CheckDevice
  179.         moveq    #1,d0
  180.         lea    Gadg1+gg_Flags,a5
  181.         bsr    CheckDevice
  182.         moveq    #2,d0
  183.         lea    Gadg2+gg_Flags,a5
  184.         bsr    CheckDevice
  185.         moveq    #3,d0
  186.         lea    Gadg3+gg_Flags,a5
  187.         bsr    CheckDevice
  188.  
  189.         bsr    AdjustAll
  190.         lea    MyWindow,a0        ; Open our window on
  191.         CALLINT    OpenWindow        ; Workbench screen
  192.         move.l    d0,Windowhd
  193.         bne.s    GotWindow        ; Open window failed
  194.         lea    MyWindow,a0
  195.         clr    nw_TopEdge(a0)
  196.         CALLSYS    OpenWindow        ; Try again
  197.         move.l    d0,Windowhd
  198.         beq    NoWindow
  199.  
  200. GotWindow    move.l    Windowhd,a1        ; Set default font
  201.         move.l    wd_RPort(a1),a1
  202.         move.l    a5,a0
  203.         CALLGRAF SetFont
  204.         move.l    Windowhd,a0
  205.         move.l    wd_UserPort(a0),UserPort
  206.         move.l    wd_RPort(a0),a0
  207.         lea    Text,a1
  208.         moveq    #0,d0
  209.         moveq    #0,d1
  210.         CALLINT    PrintIText        ; Print credit
  211.         move.l    Windowhd,a0
  212.         lea    BootMenu,a1
  213.         CALLSYS    SetMenuStrip
  214.         move.l    Windowhd,a0
  215.         movea.l    #-1,a1
  216.         lea    ScreenTitle,a2
  217.         CALLSYS    SetWindowTitles        ; Change title
  218.  
  219. MainLoop    move.l    UserPort,a0        ; Wait for an Intuition
  220.         CALLEXEC WaitPort        ; message...
  221. CheckMessage    move.l    UserPort,a0
  222.         CALLEXEC GetMsg
  223.         tst.l    d0
  224.         beq    MainLoop
  225.         move.l    d0,a1
  226.         move.l    im_Class(a1),d2        ; Store the message
  227.         move.l    im_IAddress(a1),a2
  228.         CALLSYS    ReplyMsg
  229.         cmpi.l    #CLOSEWINDOW,d2        ; Is it close time?
  230.         beq.s    QuitProper
  231.         cmpi.l    #GADGETUP,d2
  232.         beq    StartInstall
  233.         bra    CheckMessage
  234.  
  235. QuitProper    move.l    Windowhd,a0        ; Close window
  236.         CALLINT    ClearMenuStrip
  237.         move.l    Windowhd,a0
  238.         CALLSYS    CloseWindow
  239. NoWindow    move.l    IORequest,a1        ; Free IORequest
  240.         moveq    #IOSTD_SIZE,d0
  241.         CALLEXEC FreeMem
  242. NoMemIO        move.l    MsgPort,a3        ; Unlink MsgPort
  243.         moveq    #0,d0
  244.         move.b    MP_SIGBIT(a3),d0
  245.         CALLEXEC FreeSignal
  246. NoSigPort    move.l    MsgPort,a1        ; Free MsgPort
  247.         moveq    #MP_SIZE,d0
  248.         CALLEXEC FreeMem
  249. NoMemPort    move.l    _GfxBase,a1        ; Close Graphics
  250.         CALLEXEC CloseLibrary
  251. NoGfx        move.l    _DOSBase,a1        ; Close DOS
  252.         CALLEXEC CloseLibrary
  253. NoDos        move.l    _IntuitionBase,a1    ; Close Intuition
  254.         CALLEXEC CloseLibrary
  255. NoIntuition    rts
  256.  
  257. CheckDevice    lea    TrackDisk,a0        ; Check for a drive and
  258.         move.l    IORequest,a1        ; disable gadget if not
  259.         moveq    #0,d1            ; present
  260.         CALLEXEC OpenDevice
  261.         cmpi    #TDERR_BadDriveType,d0
  262.         bne.s    DeviceOn
  263.         move    #GADGHCOMP!GADGDISABLED,(a5)
  264.         rts
  265. DeviceOn    tst    d0
  266.         bne.s    OtherFail
  267.         move.l    IORequest,a1
  268.         CALLSYS    CloseDevice
  269. OtherFail    rts
  270.  
  271. StartInstall    move    KS13O+mi_Flags,d0    ; 1.3 (OFS) bootblock?
  272.         andi    #CHECKED,d0
  273.         beq.s    Check2
  274.         move.l    #DiskBuffer1,DiskBuffer
  275.         bra.s    StartGadg
  276.  
  277. Check2        move.l    #DiskBuffer2,DiskBuffer
  278.         move    KS20O+mi_Flags,d0    ; 2.0 (OFS) bootblock?
  279.         andi    #CHECKED,d0
  280.         beq.s    ChangeFFS
  281.         clr.b    DiskBuffer2+3
  282.         move.l    #$E33D0E73,DiskBuffer2+4
  283.         bra.s    StartGadg
  284.  
  285. ChangeFFS    move.b    #1,DiskBuffer2+3    ; Changes for FFS bootblock
  286.         move.l    #$E33D0E72,DiskBuffer2+4
  287.  
  288. StartGadg    move    gg_GadgetID(a2),d0    ; Which gadget was it?
  289.         move.b    d0,d7
  290.         addi.b    #$30,d0
  291.         move.b    d0,CheckTxtPt
  292.         cmpi.b    #1,CheckTest
  293.         beq.s    NoTest
  294.  
  295.         move.l    Windowhd,a0
  296.         lea    CheckText,a1
  297.         lea    CYes,a2
  298.         lea    CNo,a3
  299.         moveq    #0,d0
  300.         moveq    #0,d1
  301.         move    AutoReqX+0,d2
  302.         move    AutoReqY,d3
  303.         CALLINT    AutoRequest        ; Are you sure?
  304.         tst.l    d0
  305.         beq    CheckMessage
  306.  
  307. NoTest        lea    TrackDisk,a0
  308.         moveq    #0,d0
  309.         move.b    d7,d0
  310.         move.l    IORequest,a1
  311.         moveq    #0,d1
  312.         CALLEXEC OpenDevice
  313.         beq.s    NoOpenErr
  314.  
  315.         moveq    #1,d0
  316.         bsr    ErrorTime
  317.         bra    CheckMessage
  318.  
  319. NoOpenErr    move.l    IORequest,a1
  320.         move    #TD_CHANGESTATE,IO_COMMAND(a1)
  321.         CALLSYS    DoIO
  322.         move.l    IORequest,a1
  323.         move.l    IO_ACTUAL(a1),d0
  324.         beq.s    NoDiskError
  325.  
  326.         move.l    Windowhd,a0
  327.         lea    NoDiskErr,a1
  328.         suba.l    a2,a2
  329.         lea    AbortText,a3
  330.         moveq    #0,d0
  331.         moveq    #0,d1
  332.         move    AutoReqX+2,d2
  333.         move    AutoReqY,d3
  334.         CALLINT    AutoRequest
  335.         bra.s    CloseInstall
  336.  
  337. NoDiskError    move    #TD_PROTSTATUS,IO_COMMAND(a1)
  338.         CALLSYS    DoIO            ; Check write protect
  339.         move.l    IORequest,a1
  340.         move.l    IO_ACTUAL(a1),d0
  341.         beq.s    NoProtErr
  342.  
  343.         move.l    Windowhd,a0
  344.         lea    ProtectErr,a1
  345.         suba.l    a2,a2
  346.         lea    AbortText,a3
  347.         moveq    #0,d0
  348.         moveq    #0,d1
  349.         move    AutoReqX+4,d2
  350.         move    AutoReqY,d3
  351.         CALLINT    AutoRequest
  352.         bra.s    CloseInstall
  353.  
  354. NoProtErr    move.l    #1024,IO_LENGTH(a1)    ; Set up command
  355.         move.l    DiskBuffer,IO_DATA(a1)
  356.         move    #CMD_WRITE,IO_COMMAND(a1)
  357.         clr.l    IO_OFFSET(a1)
  358.         CALLSYS    DoIO            ; Send new bootblock
  359.  
  360.         move.l    IORequest,a1
  361.         move.b    IO_ERROR(a1),d0
  362.         beq.s    NoWriteErr
  363.         bsr.s    ErrorTime
  364.  
  365. CloseInstall    move.l    IORequest,a1
  366.         CALLEXEC CloseDevice
  367.         bra    CheckMessage
  368.  
  369. NoWriteErr    move    #CMD_UPDATE,IO_COMMAND(a1)
  370.         CALLSYS    DoIO            ; Force track write
  371.  
  372.         move.l    IORequest,a1
  373.         clr.l    IO_LENGTH(a1)
  374.         move    #TD_MOTOR,IO_COMMAND(a1)
  375.         CALLSYS    DoIO            ; Motor off
  376.         bra    CloseInstall
  377.  
  378. ErrorTime    move.l    Windowhd,a0
  379.         lea    GeneralErr,a1
  380.         suba.l    a2,a2
  381.         lea    AbortText,a3
  382.         moveq    #0,d0
  383.         moveq    #0,d1
  384.         move    AutoReqX+6,d2
  385.         move    AutoReqY,d3
  386.         CALLINT    AutoRequest
  387.         rts
  388.  
  389. AdjustAll    move.l    #sc_RastPort+rp_SIZEOF,d0
  390.         move.l    #MEMF_CLEAR,d1        ; Modify structures for
  391.         CALLEXEC AllocMem        ; different fonts
  392.         tst.l    d0
  393.         beq    NoMemA
  394.         move.l    d0,a4
  395.         move.l    d0,a0
  396.         move.l    #sc_RastPort+rp_SIZEOF,d0
  397.         move    #WBENCHSCREEN,d1
  398.         suba.l    a1,a1
  399.         CALLINT    GetScreenData        ; Find screen
  400.         move    sc_RastPort+rp_TxHeight(a4),d7
  401.         lea    sc_RastPort(a4),a1
  402.         lea    Txt,a0
  403.         moveq    #22,d0
  404.         CALLGRAF TextLength
  405.         move    d0,d6
  406.  
  407.         lea    sc_RastPort(a4),a1
  408.         lea    BootName,a0
  409.         moveq    #9,d0
  410.         CALLSYS    TextLength
  411.         add    sc_RastPort+rp_TxWidth(a4),d0
  412.         move    d0,BootMenu+mu_Width
  413.  
  414.         lea    MyWindow,a0        ; Scale window etc.
  415.         move    nw_Width(a0),d0
  416.         muls    d6,d0
  417.         divs    #176,d0
  418.         move    d0,nw_Width(a0)
  419.         move    nw_Height(a0),d0
  420.         muls    d7,d0
  421.         lsr    #3,d0
  422.         move    d0,nw_Height(a0)
  423.  
  424.         lea    AutoReqX,a0
  425. AutoLoop    move    (a0),d0
  426.         beq.s    DoLastAuto
  427.         muls    d6,d0
  428.         divs    #176,d0
  429.         move    d0,(a0)+
  430.         bra    AutoLoop
  431. DoLastAuto    move    AutoReqY,d0
  432.         muls    d7,d0
  433.         lsr    #3,d0
  434.         move    d0,AutoReqY
  435.  
  436.         move    sc_RastPort+rp_TxWidth(a4),d0
  437.         mulu    #10,d0            ; Scale menus
  438.         addi    #COMMWIDTH+CHECKWIDTH,d0
  439.         move    d0,KS13O+mi_Width
  440.         move    d0,KS20O+mi_Width
  441.         move    d0,KS20F+mi_Width
  442.         move    d7,d0
  443.         addq    #1,d0
  444.         move    d0,KS13O+mi_Height
  445.         move    d0,KS20O+mi_Height
  446.         move    d0,KS20F+mi_Height
  447.         move    d0,KS20O+mi_TopEdge
  448.         lsl    #1,d0
  449.         move    d0,KS20F+mi_TopEdge
  450.  
  451.         moveq    #22,d2
  452.         move    MyWindow+nw_Width,d3
  453.         lea    Text,a2
  454.         bsr    ScaleText
  455.         lea    Gadg0,a0
  456.         move    gg_Width(a0),d4
  457.         move    gg_Height(a0),d5
  458.         bsr    ScaleGadget
  459.         lea    Gadg1,a0
  460.         bsr    ScaleGadget
  461.         lea    Gadg2,a0
  462.         bsr    ScaleGadget
  463.         lea    Gadg3,a0
  464.         bsr    ScaleGadget
  465.         lea    GadgBord1,a0
  466.         bsr    ScaleBorder
  467.         lea    GadgBord2,a0
  468.         bsr.s    ScaleBorder
  469.         lea    GadgBord3,a0
  470.         bsr.s    ScaleBorder
  471.         lea    x2_GBord1,a0
  472.         bsr.s    ScaleBorder
  473.         lea    x2_GBord2,a0
  474.         bsr.s    ScaleBorder
  475.  
  476.         lea    CheckText,a2
  477.         bsr.s    ScaleText2
  478.         lea    AbortText,a2
  479.         bsr.s    ScaleText2
  480.         lea    GeneralErr,a2
  481.         bsr.s    ScaleText2
  482.         lea    ProtectErr,a2
  483.         bsr.s    ScaleText2
  484.         lea    NoDiskErr,a2
  485.         bsr.s    ScaleText2
  486.         lea    CYes,a2
  487.         bsr.s    ScaleText2
  488.         lea    CNo,a2
  489.         bsr.s    ScaleText2
  490.  
  491.         move.l    sc_RastPort+rp_Font(a4),a5
  492.         move.l    #sc_RastPort+rp_SIZEOF,d0
  493.         move.l    a4,a1
  494.         CALLEXEC FreeMem
  495. NoMemA        rts
  496.  
  497. ScaleText2    move    it_LeftEdge(a2),d0    ; Scale IText (a2)
  498.         muls    d6,d0
  499.         divs    #176,d0
  500.         move    d0,it_LeftEdge(a2)
  501.         bra    ScaleText3
  502.  
  503. ScaleBorder    move.b    bd_Count(a0),d1        ; Scale Border (a0)
  504.         move.l    bd_XY(a0),a0
  505. BordLoop1    move    (a0),d0
  506.         cmpi    #10,d0
  507.         blt.s    BordLoop2
  508.         sub    d4,d0
  509.         add    Gadg0+gg_Width,d0
  510. BordLoop2    move    d0,(a0)+
  511.         move    (a0),d0
  512.         cmpi    #10,d0
  513.         blt.s    BordLoop3
  514.         sub    d5,d0
  515.         add    Gadg0+gg_Height,d0
  516. BordLoop3    move    d0,(a0)+
  517.         subq.b    #1,d1
  518.         bne    BordLoop1
  519.         rts
  520.  
  521. ScaleGadget    move    gg_LeftEdge(a0),d0    ; Scale Gadget (a0)
  522.         muls    d6,d0
  523.         divs    #176,d0
  524.         move    d0,gg_LeftEdge(a0)
  525.         move    gg_TopEdge(a0),d0
  526.         muls    d7,d0
  527.         lsr    #3,d0
  528.         move    d0,gg_TopEdge(a0)
  529.         move    gg_Width(a0),d0
  530.         muls    d6,d0
  531.         divs    #176,d0
  532.         move    d0,gg_Width(a0)
  533.         move    gg_Height(a0),d0
  534.         muls    d7,d0
  535.         lsr    #3,d0
  536.         move    d0,gg_Height(a0)
  537.         moveq    #3,d2
  538.         move    gg_Width(a0),d3
  539.         move.l    gg_GadgetText(a0),a2
  540. ScaleText    lea    sc_RastPort(a4),a1    ; Scale IText (a2) with
  541.         move.l    it_IText(a2),a0        ; length (d2) in space (d3)
  542.         move    d2,d0
  543.         CALLGRAF TextLength
  544.         sub    d0,d3
  545.         lsr    #1,d3
  546.         move    d3,it_LeftEdge(a2)
  547. ScaleText3    move    it_TopEdge(a2),d0
  548.         muls    d7,d0
  549.         lsr    #3,d0
  550.         move    d0,it_TopEdge(a2)
  551.         rts
  552.  
  553.         ; The following code represents the standard 1.3 bootblock
  554.  
  555. SBBlock        dc.b    "DOS",0
  556.         dc.l    $C0200F19
  557.         dc.l    $00000370
  558.         lea    Boot1(pc),a1
  559.         jsr    _LVOFindResident(a6)
  560.         tst.l    d0
  561.         beq.s    Boot2
  562.         move.l    d0,a0
  563.         move.l    22(a0),a0
  564.         moveq    #0,d0
  565. Boot3        rts
  566. Boot2        moveq    #-1,d0
  567.         bra.s    Boot3
  568. Boot1        dc.b    "dos.library"
  569.         even
  570. EBBlock
  571.         ; This code is the 2.04 OFS bootblock
  572.  
  573. SNBBlock    dc.b    "DOS",0
  574.         dc.l    $E33D0E73
  575.         dc.l    $00000370
  576.         lea    NBoot1(pc),a1
  577.         moveq    #37,d0
  578.         jsr    _LVOOpenLibrary(a6)
  579.         tst.l    d0
  580.         beq.s    NBoot2
  581.         movea.l    d0,a1
  582.         bset    #6,34(a1)
  583.         jsr    _LVOCloseLibrary(a6)
  584. NBoot2        lea    NBoot3(pc),a1
  585.         jsr    _LVOFindResident(a6)
  586.         tst.l    d0
  587.         beq.s    NBoot4
  588.         movea.l    d0,a0
  589.         movea.l    22(a0),a0
  590.         moveq    #0,d0
  591.         rts
  592. NBoot4        moveq    #-1,d0
  593.         rts
  594.  
  595. NBoot3        dc.b    "dos.library",0
  596. NBoot1        dc.b    "expansion.library",0
  597.         even
  598. ENBBlock
  599.         section    Install_Data,data
  600.  
  601. MyWindow    dc.w    80,35,202,81
  602.         dc.b    0,1
  603.         dc.l    GADGETUP!CLOSEWINDOW
  604.         dc.l    WINDOWDRAG!WINDOWDEPTH!WINDOWCLOSE!ACTIVATE!SMART_REFRESH
  605.         dc.l    Gadg0,0,WindName,0,0
  606.         dc.w    0,0,0,0,WBENCHSCREEN
  607. WindName    dc.b    "Install v1.2",0
  608.         even
  609.  
  610. BootMenu    dc.l    0
  611.         dc.w    5,0,0,0,MENUENABLED
  612.         dc.l    BootName
  613.         dc.l    KS13O
  614.         dc.w    0,0,0,0
  615. BootName    dc.b    "BootBlock",0
  616.         even
  617.  
  618. KS13O        dc.l    KS20O
  619.         dc.w    0,0,0,0
  620.         dc.w    HIGHCOMP!ITEMENABLED!ITEMTEXT!COMMSEQ!CHECKIT!CHECKED
  621.         dc.l    2+4,KS13OName,0
  622.         dc.b    "1",0
  623.         dc.l    0
  624.         dc.w    0
  625. KS13OName    dc.b    0,1,0,0
  626.         dc.w    1+CHECKWIDTH,1
  627.         dc.l    0,KS13OText,0
  628. KS13OText    dc.b    "OFS 1.3",0
  629.         even
  630.  
  631. KS20O        dc.l    KS20F
  632.         dc.w    0,0,0,0
  633.         dc.w    HIGHCOMP!ITEMENABLED!ITEMTEXT!COMMSEQ!CHECKIT
  634.         dc.l    1+4,KS20OName,0
  635.         dc.b    "2",0
  636.         dc.l    0
  637.         dc.w    0
  638. KS20OName    dc.b    0,1,0,0
  639.         dc.w    1+CHECKWIDTH,1
  640.         dc.l    0,KS20OText,0
  641. KS20OText    dc.b    "OFS 2.0",0
  642.         even
  643.  
  644. KS20F        dc.l    0
  645.         dc.w    0,0,0,0
  646.         dc.w    HIGHCOMP!ITEMENABLED!ITEMTEXT!COMMSEQ!CHECKIT
  647.         dc.l    1+2,KS20FName,0
  648.         dc.b    "3",0
  649.         dc.l    0
  650.         dc.w    0
  651. KS20FName    dc.b    0,1,0,0
  652.         dc.w    1+CHECKWIDTH,1
  653.         dc.l    0,KS20FText,0
  654. KS20FText    dc.b    "FFS 2.0",0
  655.         even
  656.  
  657. Gadg0        dc.l    Gadg1
  658.         dc.w    14,15,80,20,GADGHCOMP,RELVERIFY,BOOLGADGET
  659.         dc.l    GadgBord1,0,Gadg0Text,0,0
  660.         dc.w    0
  661.         dc.l    0
  662. Gadg0Text    dc.b    1,0,0,0
  663.         dc.w    0,6
  664.         dc.l    0,Gadg0Txt,0
  665. Gadg0Txt    dc.b    "DF0",0
  666.         even
  667.  
  668. Gadg1        dc.l    Gadg2
  669.         dc.w    108,15,80,20,GADGHCOMP,RELVERIFY,BOOLGADGET
  670.         dc.l    GadgBord1,0,Gadg1Text,0,0
  671.         dc.w    1
  672.         dc.l    0
  673. Gadg1Text    dc.b    1,0,0,0
  674.         dc.w    0,6
  675.         dc.l    0,Gadg1Txt,0
  676. Gadg1Txt    dc.b    "DF1",0
  677.         even
  678.  
  679. Gadg2        dc.l    Gadg3
  680.         dc.w    14,42,80,20,GADGHCOMP,RELVERIFY,BOOLGADGET
  681.         dc.l    GadgBord1,0,Gadg2Text,0,0
  682.         dc.w    2
  683.         dc.l    0
  684. Gadg2Text    dc.b    1,0,0,0
  685.         dc.w    0,6
  686.         dc.l    0,Gadg2Txt,0
  687. Gadg2Txt    dc.b    "DF2",0
  688.         even
  689.  
  690. Gadg3        dc.l    0
  691.         dc.w    108,42,80,20,GADGHCOMP,RELVERIFY,BOOLGADGET
  692.         dc.l    GadgBord1,0,Gadg3Text,0,0
  693.         dc.w    3
  694.         dc.l    0
  695. Gadg3Text    dc.b    1,0,0,0
  696.         dc.w    0,6
  697.         dc.l    0,Gadg3Txt,0
  698. Gadg3Txt    dc.b    "DF3",0
  699.         even
  700.  
  701. CheckText    dc.b    0,0,0,0
  702.         dc.w    9,7
  703.         dc.l    0,CheckTxt,0
  704. CheckTxt    dc.b    "Install disk in drive DF"
  705. CheckTxtPt    dc.b    "0. Are you sure?",0
  706.         even
  707.  
  708. Text        dc.b    1,0,0,0
  709.         dc.w    0,68
  710.         dc.l    0,Txt,0
  711. Txt        dc.b    "© 1990 by David Kinder",0
  712.         even
  713.  
  714. GadgBord1    dc.w    -2,-1
  715.         dc.b    1,0,0,5
  716.         dc.l    Coords1,GadgBord2
  717. Coords1        dc.w    0,0,83,0,83,21,0,21,0,0
  718.  
  719. GadgBord2    dc.w    -2,-1
  720.         dc.b    1,0,0,2
  721.         dc.l    Coords2,GadgBord3
  722. Coords2        dc.w    1,0,1,21
  723.  
  724. GadgBord3    dc.w    -2,-1
  725.         dc.b    1,0,0,2
  726.         dc.l    Coords3,0
  727. Coords3        dc.w    82,0,82,21
  728.  
  729. x2_GBord1    dc.w    0,0
  730.         dc.b    2,0,0,5
  731.         dc.l    x2_Coords1,x2_GBord2
  732. x2_Coords1    dc.w    82,0,0,0,0,21,1,20,1,0
  733.  
  734. x2_GBord2    dc.w    0,0
  735.         dc.b    1,0,0,5
  736.         dc.l    x2_Coords2,0
  737. x2_Coords2    dc.w    1,21,83,21,83,0,82,1,82,21
  738.  
  739. TrackDisk    dc.b    "trackdisk.device",0
  740.         even
  741.  
  742. ScreenTitle    dc.b    "Insert disk to be installed then click "
  743.         dc.b    "on drive gadget",0
  744.         even
  745.  
  746. AbortText    dc.b    0,1,0,0
  747.         dc.w    6,3
  748.         dc.l    0,AbortTxt,0
  749. AbortTxt    dc.b    "Abort Operation",0
  750.         even
  751.  
  752. GeneralErr    dc.b    0,1,0,0
  753.         dc.w    9,7
  754.         dc.l    0,GeneralTxt,0
  755. GeneralTxt    dc.b    "Cannot install specified disk",0
  756.         even
  757.  
  758. ProtectErr    dc.b    0,1,0,0
  759.         dc.w    9,7
  760.         dc.l    0,ProtectTxt,0
  761. ProtectTxt    dc.b    "The disk is write protected!",0
  762.         even
  763.  
  764. NoDiskErr    dc.b    0,1,0,0
  765.         dc.w    9,7
  766.         dc.l    0,NoDiskTxt,0
  767. NoDiskTxt    dc.b    "There is no disk in the drive!",0
  768.         even
  769.  
  770. CYes        dc.b    0,1,0,0
  771.         dc.w    6,3
  772.         dc.l    0,TYes,0
  773. TYes        dc.b    "Yes",0
  774.         even
  775.  
  776. CNo        dc.b    0,1,0,0
  777.         dc.w    6,3
  778.         dc.l    0,TNo,0
  779. TNo        dc.b    "No",0
  780.         even
  781.  
  782. ToolType    dc.b    "NOCHECK",0
  783.         even
  784.  
  785. DosName        DOSNAME
  786. GfxName        GRAFNAME
  787. IconName    ICONNAME
  788. IntName        INTNAME
  789.  
  790. AutoReqX    dc.w    360,281,265,276,0
  791. AutoReqY    dc.w    53
  792.  
  793.         section    Install_BSS,bss
  794.  
  795. IORequest    ds.l    1
  796. MsgPort        ds.l    1
  797. Windowhd    ds.l    1
  798. UserPort    ds.l    1
  799. DiskBuffer    ds.l    1
  800. ReturnMsg    ds.l    1
  801. _DOSBase    ds.l    1
  802. _GfxBase    ds.l    1
  803. _IconBase    ds.l    1
  804. _IntuitionBase    ds.l    1
  805. CheckTest    ds.b    1
  806.  
  807.         section    Install_ChipBSS,bss_c
  808.  
  809. DiskBuffer1    ds.b    1024
  810. DiskBuffer2    ds.b    1024
  811.