@echo off
Rem Autogenerated batch to patch the files

SetLocal

if "a%1"=="a" (
echo "Usage: bin/xdelta3_FIREHAWK_apply.bat <source_dir> <target_dir>"
goto :end
)

set TGTDIR=%1
set MYDIR=%CD%

copy /b patch\newfiles\FILE_ID.DIZ %TGTDIR%\FILE_ID.DIZ
copy /b patch\newfiles\FIREHAWK.COM %TGTDIR%\FIREHAWK.COM
copy /b patch\newfiles\INSTFLOP.BAT %TGTDIR%\INSTFLOP.BAT
copy /b patch\newfiles\LANGUAGE\LANG-EN.BAT %TGTDIR%\LANGUAGE\LANG-EN.BAT
copy /b patch\newfiles\LANGUAGE\LANG-JP.BAT %TGTDIR%\LANGUAGE\LANG-JP.BAT
copy /b patch\newfiles\PSGMIXER.COM %TGTDIR%\PSGMIXER.COM
copy /b README.TXT %TGTDIR%\README.TXT
copy /b patch\newfiles\SETLANG.BAT %TGTDIR%\SETLANG.BAT
xdelta3 -f -d -s %TGTDIR%\BOSS9.COM patch\xdeltas\BOSS9.COM.xdelta3 %TGTDIR%\BOSS9.COM.tmp
del %TGTDIR%\BOSS9.COM
ren %TGTDIR%\BOSS9.COM.tmp BOSS9.COM
xdelta3 -f -d -s %TGTDIR%\FH.COM patch\xdeltas\FH.COM.xdelta3 %TGTDIR%\FH.COM.tmp
del %TGTDIR%\FH.COM
ren %TGTDIR%\FH.COM.tmp FH.COM
xdelta3 -f -d -s %TGTDIR%\FIREHAWK.DOS patch\xdeltas\FIREHAWK.DOS.xdelta3 %TGTDIR%\FIREHAWK.DOS.tmp
del %TGTDIR%\FIREHAWK.DOS
ren %TGTDIR%\FIREHAWK.DOS.tmp FIREHAWK.DOS
xdelta3 -f -d -s %TGTDIR%\HAWK.COM patch\xdeltas\HAWK.COM.xdelta3 %TGTDIR%\HAWK.COM.tmp
del %TGTDIR%\HAWK.COM
ren %TGTDIR%\HAWK.COM.tmp HAWK.COM
xdelta3 -f -d -s %TGTDIR%\HAWKEND.COM patch\xdeltas\HAWKEND.COM.xdelta3 %TGTDIR%\HAWKEND.COM.tmp
del %TGTDIR%\HAWKEND.COM
ren %TGTDIR%\HAWKEND.COM.tmp HAWKEND.COM

xdelta3 -f -d -s %TGTDIR%\LTPLAY.COM patch\xdeltas\LTPLAY.COM.xdelta3 %TGTDIR%\LTPLAY.COM.tmp
del %TGTDIR%\LTPLAY.COM
ren %TGTDIR%\LTPLAY.COM.tmp LTPLAY.COM
xdelta3 -f -d -s %TGTDIR%\NAKADEMO.COM patch\xdeltas\NAKADEMO.COM.xdelta3 %TGTDIR%\NAKADEMO.COM.tmp
del %TGTDIR%\NAKADEMO.COM
ren %TGTDIR%\NAKADEMO.COM.tmp NAKADEMO.COM
xdelta3 -f -d -s %TGTDIR%\PTPLAY.COM patch\xdeltas\PTPLAY.COM.xdelta3 %TGTDIR%\PTPLAY.COM.tmp
del %TGTDIR%\PTPLAY.COM
ren %TGTDIR%\PTPLAY.COM.tmp PTPLAY.COM

if exist translation/FH-EN-D1.IPS (
xdelta3 -f -d -s %TGTDIR%\LANGUAGE\EN\FH.COM patch\xdeltas\LANGUAGE\EN\FH.COM.xdelta3 %TGTDIR%\LANGUAGE\EN\FH.COM.tmp
del %TGTDIR%\LANGUAGE\EN\FH.COM
ren %TGTDIR%\LANGUAGE\EN\FH.COM.tmp FH.COM
xdelta3 -f -d -s %TGTDIR%\LANGUAGE\EN\NAKADEMO.COM patch\xdeltas\LANGUAGE\EN\NAKADEMO.COM.xdelta3 %TGTDIR%\LANGUAGE\EN\NAKADEMO.COM.tmp
del %TGTDIR%\LANGUAGE\EN\NAKADEMO.COM
ren %TGTDIR%\LANGUAGE\EN\NAKADEMO.COM.tmp NAKADEMO.COM
)

copy /b %TGTDIR%\FH.COM %TGTDIR%\LANGUAGE\JP
copy /b %TGTDIR%\NAKADEMO.COM %TGTDIR%\LANGUAGE\JP

:end
EndLocal

