; 68030 Turbo Install Script
; Version 0.00
; By Russel Miranda ----- 7 July 1992
; My first Installer script - Who thought LISP would be useful?
; Loosly based upon ideas from the G-Force 040 Install Script

; Written for use with Commodore's Installer.

(set instldsk "GVP.Install:")

; ========================
; If the user has booted from this floppy, we need to find out
; where the usual SYS: partition is.  Try a few looks about the system...
; Currently looks for WB_2.x:, System2.0:, or dh0:.  Ask user if we can't
; figure out where s/he boots from, and/or for confirmation.

(set target (getassign "wb_2.x" 'd'))             ; Device-only check.
(if (= target "")
    (set target (getassign "System2.0" 'v')))     ; VolumeName-only check.
(if (= target "")
    (set target (getassign "dh0" 'd')))           ; Device-only check.
(if (= target "")
    (set target (getassign "System2.0")))         ; Logical assign check.
(if (= target "")
    (set target (getassign "dh0")))               ; Logical assign check.

; If we're at Wit's End: -- Welcome to Wit's End, population 1?
(if (= target "")
   (set target @default-dest)                     ; default destination
)

; Now, make absolutely, positively sure that we go to the right place.
(set target (askdir (prompt "Which partition do you usually boot from?\n"
                            "The required utilities should be installed there.")
                    (help @askdir-help)
                    (default target)))

; ====================
; This is where the installation occurs:
;

(copylib (source (tackon instldsk "Expansion/gvpscsi"))
         (infos)
         (dest (tackon target "Expansion"))
         (confirm)
         (prompt "Shall I install the binddrivers version of the "
                 "gvpscsi driver?")
         (help "The binddrivers version can be copied to a floppy disk "
               "to allow access to the hard drive if autobooting has been "
               "disabled.\n\n"
               @copylib-help))

(set os_ver (/ (getversion) $0000FFFF))
(if (< os_ver 36)
    (
     (copyfiles (source (tackon instldsk "GVP/68030/SetCPU"))
                (dest (tackon target "C"))
                (confirm)
                (prompt "Shall I install SetCPU?")
                (help "SetCPU is used to control the caches on the 68030.\n\n"
                      @copyfiles-help))
     (set CacheCmd (cat (tackon target "C/SetCPU") " cache"))
    )
    (
     (set CacheCmd (cat (tackon target "C/CPU") " cache"))
    )
)

(copyfiles (source (tackon instldsk "GVP"))
           (dest (tackon target "GVP"))
           (all)
           (infos)
           (confirm)
           (prompt "Shall I install the GVP support software?")
           (help "This software allows you to control and configure "
                 "all aspects of the 68030 Turbo Accelerator.\n\n"
                 @copyfiles-help))

(onerror (message "Sorry, but either your startup-sequence "
                  "was missing or is too heavily modified for "
                  "the installer program to understand. You "
                  "will have to make this modification by "
                  "hand.\n"
                  "To turn on the 68030's data cache in your "
                  "startup sequence, add the following line "
                  "at the top of your User-startup or "
                  "Startup-sequence file:\n\n"
                  CacheCmd
                  "\n" )
         (message "Another modification you may make to your startup-sequence "
                  "is to enable the FastROM option. This instructs the 68030 "
                  "to copy the Kickstart image into 32-bit RAM, which will "
                  "increase system performance. It will also take up 512K of "
                  "your fast RAM. If you wish to trade 512K for speed, add "
                  "the following line to your User-startup or Startup-sequence:\n\n"
                  (tackon target "GVP/68030/GVPCPUCtrl FastROM")))

(startup "68030_Cache"
         (prompt "Do you want the 68030 data cache turned on "
                 "automatically?\n\n"
                 "Click 'Proceed' to have it turned on in your "
                 "Startup-sequence.")
         (help   "This will turn the data cache of the 68030 on as "
                 "your Amiga boots. This will increase the performance "
                 "of the system.\n\n"
                 "The command to be added is:\n"
                 CacheCmd)
         (command CacheCmd))

(set fastrom (askbool (prompt "Would you like to improve system performance "
                              "by remapping Kickstart to FastRAM on the "
                              "board?\n\n"
                              "Click 'Proceed' to use the FastROM option.")
                      (choices "Yes" "No")
                      (default "Yes")
                      (help "This will automatically copy the Kickstart image "
                            "into the 32-bit RAM on the board. It will be much "
                            "faster than reading from ROM, and will increase "
                            "system performance.\n\n"
                            "On the other hand, it will take about 512K of "
                            "Fast RAM. Choose 'Yes' if you want to trade "
                            "512K for speed; choose 'Skip this part' otherwise.\n\n"
                            "The command to be added to your startup is:\n"
                            "   "
                            (tackon target "GVP/68030/GVPCPUCtrl")
                            " FastROM"))
)
(if fastrom (startup "68030_FastROM"
                     (prompt "You are sure you understand this will take "
                             "512K of your free RAM?")
                     (help "This will cause the Kickstart image to be "
                           "copied into RAM, increasing performance but "
                           "using 512K of RAM.")
                     (command (cat (tackon target "GVP/68030/GVPCPUCtrl")
                                   " FastROM"))))
(set A@default-dest target)
