@echo off
set cdptl=%~dp0


cd cdptl
set lang=%~1%
if "%lang%"=="" set "lang=ru"
set "loc="
set "space=     "
if "%lang%"=="ru" set "loc=--dos866"
echo %space% INCLUDE "local/%lang%.asm" > local.asm
echo %space% DEFINE LOCAL %lang% > local_.asm

rem call .\add\plugin_src\compile.bat %lang%

cd %cdptl%
path .\cross_tools

sjasmplus --exp="export.asm"  --color=off %loc% bge.asm 2> bge_%lang%.log
echo.>> bge_%lang%.log
echo.>> bge_%lang%.log

hrust13 bge_main bge_main.hst
hrust13 bge_3 bge_3.hst
hrust13 bge_6 bge_6.hst
hrust13 bge_7 bge_7.hst

sjasmplus --color=off %loc% loader.asm 2>> bge_%lang%.log

rem pause
del *.hst

del user_%lang%.l
ren user.l user_%lang%.l

del bge_%lang%.trd
ren bge_xxx.trd bge_%lang%.trd
