@echo off
echo Copying files...
copy ROM\OS.nb.payload temp\OS.nb.payload
copy TOOLS\titan_nbh.txt temp\titan_nbh.txt

del buildpkg.wrn

cd temp

echo.
..\TOOLS\ImgfsFromNb   OS.nb.payload imgfs.bin
..\TOOLS\ImgfsFromDump imgfs.bin imgfs-new.bin
..\TOOLS\ImgfsToNb     imgfs-new.bin OS.nb.payload OS-new.nb.payload -bigstoragemove
..\TOOLS\NBMerge       -titan OS-new.nb
..\TOOLS\nbhgen	       titan_nbh.txt

del /q ..\RUU\*.nbh
ren RUU_signed.nbh dcd_titan_3.0.0_%date:~4,2%-%date:~7,2%-%date:~10%.nbh
move *.nbh ..\RUU\

CD..

rmdir /s /q temp

if NOT "%ALL%"=="1" pause
goto :EOF

:error
echo.
echo ERROR! (errorlevel: %errorlevel%)
