rem @echo off 


set BuildFile=%1
set BuildPath=%2
if exist \utils\SelectedBuildFile.bat call \utils\SelectedBuildFile.bat 

cd %BuildPath%
\Utils\Vasm\vasmZ80_OldStyle_win32.exe %BuildFile%  -chklabels -nocase -Dvasm=1 -DBuildSMS=1 -Fbin -o "\RelSMS\cart.sms" -L \RelSMS\Listing.txt
if not "%errorlevel%"=="0" goto Abandon

rem \Utils\BinaryTools.exe checksum "\RelSMS\cart.sms" $0000 $7FF0 "\RelSMS\cart.sms" $7FFA 16bit

cd \
Emu\Fusion\Fusion.exe RelSMS\cart.sms
exit
:Abandon
if "%3"=="nopause" exit
pause
