@echo off

rem
rem Verify that there is a BICOM.INI file which
rem is the copy of one of the pre-defined INI files
rem
if not exist BICOM.INI goto ini_missing

rem
rem Run system check
rem
bcmchk

rem
rem Specify the base options that have to be given
rem to the driver
rem
set bicom_base_opt=

rem
rem The user should specify any additional options here
rem
set bicom_user_opt=

rem
rem Check if the dump facility should be started
rem
if opt_%1 == opt_newspy    goto init_new_spy
if opt_%1 == opt_appendspy goto init_append_spy
goto load_firmware

:init_new_spy
del *.dmp
dumptsr -t -i60
set bicom_base_opt=%bicom_base_opt% -d0 -x16
goto load_firmware

:init_append_spy
dumptsr -t -i60
set bicom_base_opt=%bicom_base_opt% -d0 -x16
goto load_firmware

:load_firmware
medfed %bicom_base_opt% %bicom_user_opt%
goto end

:ini_missing
echo ***ERROR***: BICOM.INI file is missing.
goto end

:end
