@echo off
if "%1"=="" goto noinput
chkflash %1
if errorlevel 5 goto end
if errorlevel 4 goto end
if errorlevel 3 goto end
if errorlevel 2 goto end
if errorlevel 1 goto old_flash_utility

:new_flash_utility
phlash16 /mfg /mode=3 /BBL /c /s /x %1 %2 %3
goto end

:old_flash_utility
phlash /B=linden.bin /mfg /mode=3 /s /x %1 %2 %3
goto end

:noinput
echo Please input the ROM file name!

:end
