@rem argument %1 is the destination drive letter
@rem argument %2 select the display resolution

@set o_path=%path%
@set path=%1:\os2;%1:\os2\install;%path%

@if "%1"=="" goto usage
@if "%2"=="" goto usage
@echo - Cirrus Logic 16 colors display driver installation for OS/2 2.0...
@echo -
@echo - Please follow these steps before installing the Cirrus Logic drivers:
@echo -
@echo - 1. edit OS/2's config.sys file with the following settings
@echo -
@echo -    add %1:\OS2\DLL\CLDSP; to the immediate right of LIBPATH=
@echo -    set video_devices=vio_SVGA
@echo -    set vio_SVGA=device(bvhvga,BVHSVGA)
@echo -    device=%1:\os2\mdos\VSVGA.SYS
@echo -
@echo - 2. bring up a DOS full screen session, insert Cirrus Logic's driver
@echo -    diskette in drive A or B, type A:SVGA.EXE ON or B:SVGA.EXE ON to
@echo -    create a svgadata.pmi file
@echo -
@echo - 3. shutdown the system to boot up from the OS/2 2.0 installation
@echo -    diskette, then ESC out of diskette one to run this script file
@echo -
@echo - Type Control-C to abort the execution of the script file.
@echo -
@pause
@rem ---------------------------------------------------------------------
@echo - saving original files . . .

@if exist %1:\os2\screen01._cl           goto sav1
@if exist %1:\os2\screen01.sys copy %1:\os2\screen01.sys %1:\os2\screen01._cl >nul

:sav1
@if exist %1:\os2\screen02._cl           goto sav2
@if exist %1:\os2\screen02.sys copy %1:\os2\screen02.sys %1:\os2\screen02._cl >nul

:sav2
@if exist %1:\os2\svga._cl               goto sav3
@if exist %1:\os2\svga.exe copy %1:\os2\svga.exe %1:\os2\svga._cl >nul

:sav3
@if exist %1:\os2\dll\bvhsvga._cl        goto sav4
@if exist %1:\os2\dll\bvhsvga.dll copy %1:\os2\dll\bvhsvga.dll %1:\os2\dll\bvhsvga._cl >nul

:sav4
@if exist %1:\os2\dll\cldsp\display._cl goto sav5
@if exist %1:\os2\dll\cldsp\display.dll copy %1:\os2\dll\cldsp\display.dll %1:\os2\dll\cldsp\display._cl >nul

:sav5
@if exist %1:\os2\dll\cldsp\monitor._cl       goto sav6
@if exist %1:\os2\dll\cldsp\monitor.dll copy %1:\os2\dll\cldsp\monitor.dll %1:\os2\dll\cldsp\monitor._cl >nul

:sav6
@if exist %1:\os2\mdos\vsvga._cl         goto sav7
@if exist %1:\os2\mdos\vsvga.sys copy %1:\os2\mdos\vsvga.sys %1:\os2\mdos\vsvga._cl >nul

:sav7
@rem ---------------------------------------------------------------------
@echo - installing drivers . . .
@if not exist %1:\os2\dll\cldsp\monitor.dll  md %1:\os2\dll\cldsp >nul

@if %2==6 goto 600
@if %2==7 goto 768
@unpack sv48016.dl@  %1: >nul
@unpack display.dl_  %1: >nul
@goto inst

:600
@unpack sv60016.dl@  %1: >nul
@unpack display.dl_  %1: >nul
@goto inst

:768
@unpack sv76816.dl@  %1: >nul
@unpack display.dl_  %1: >nul

:inst
@if exist %1:\os2\screen01.sys unpack screen01.sy_ %1: >nul
@if exist %1:\os2\screen02.sys unpack screen02.sy_ %1: >nul
@copy   svga.exe     %1:\os2 >nul
@unpack bvhsvga.dl_  %1: >nul
@unpack vsvga.sy_    %1: >nul

@echo -
@echo - Press CRTL-ALT-DEL to reboot to OS/2 for the newly installed
@echo - drivers to take effect . . .
@echo -
@goto home

:usage
@echo *------------------------------------------------------------------*
@echo * Cirrus Logic SVGA installation for OS/2 2.0...                   *
@echo *==================================================================*
@echo *                                                                  *
@echo * Please specify the drive letter for the files to be copied to... *
@echo * and the vertical display resolution of choice...                 *
@echo *                                                                  *
@echo *    640 x 480 x 16 ---- type 4 (default)                          *
@echo *    800 x 600 x 16 ---- type 6                                    *
@echo *   1024 x 768 x 16 ---- type 7                                    *
@echo *                                                                  *
@echo * example: cli1620 C 7                                             *
@echo * meaning: install Cirrus Logic 1024x768x16 driver on drive C,     *
@echo *          the OS/2 drive                                          *
@echo *                                                                  *
@echo *------------------------------------------------------------------*

:home
@set path=%o_path%
@set o_path=

