@echo off
rem -------------------------------------------------------------------------
rem snload.bat - Batch file to load a Sniffer executable
rem snload is called directly from snstart.  It represents a work-around
rem of a problem where the monitor driver is removed from memory while
rem snstart.bat is still partially in memory, thus fragmenting memory
rem and resulting in the analyzer failing be loaded.
rem -------------------------------------------------------------------------

rem - common expert system help
set %1xphelp=\%1sniff\xphelp
set xphelp=\xphelp


rem - prepare memory
fixemm clear > nul

goto pagea

rem goto pagee

:pagee
fixemm i=a000-afff i=b400-b7ff i=bc00-bfff %4
goto load

:pagea
fixemm i=b400-b7ff i=bc00-bfff %4
goto load

:load
echo.
echo Loading the %3 Sniffer...
echo.

rem - pick the right PCNet config file [compare all upper case]
if not "%1"=="PC" goto notpc
if "%2"=="P1SNIFF" copy \%1sniff\p1sniff.cfg \%1sniff\pcsniff.cfg > nul
if "%2"=="P2SNIFF" copy \%1sniff\p2sniff.cfg \%1sniff\pcsniff.cfg > nul
if "%2"=="P3SNIFF" copy \%1sniff\p3sniff.cfg \%1sniff\pcsniff.cfg > nul
if "%2"=="P4SNIFF" copy \%1sniff\p4sniff.cfg \%1sniff\pcsniff.cfg > nul
:notpc

if not "%1"=="SY" goto new_help
if exist c:\sysniff\sypcaddr.exe set %1help=\%1sniff
if exist c:\sysniff\sypcaddr.exe goto help_done

:new_help
set %1help=\%1sniff\help
:help_done

call c:\tools\autosetv %1 A START
set %1names=\%1sniff
if "%1"=="PC" \PCsniff\PCsniff.exe %scr% %scrmode% %5 %6 %7 %8 %9
if not "%1"=="PC" \%1sniff\%2.exe %scr% %scrmode% %5 %6 %7 %8 %9
call c:\tools\autosetv %1 A END
if errorlevel 1 pause
set %1help=
set %1names=
goto exit

:exit
set xphelp=
fixemm clear > nul
cd \
menu



