@cd /d "%~dp0"
@echo ----------------------------
@echo ----- COMPILE KERNAL LOADER
@echo ----------------------------

@"system/MegaLZ.exe" compile/kernal_low.bin compile/kernal_low.bin.mlz > nul
@for /f %%i in ("compile/kernal_low.bin") do @set KernLowSizeBin=%%~zi
@for /f %%i in ("compile/kernal_low.bin.mlz") do @set KernLowSizePacked=%%~zi
@set /a kernLowPercent= 100-100*KernLowSizePacked/(KernLowSizeBin + 1)
@echo KERNAL LOW PACKED SIZE: from %KernLowSizeBin% to %KernLowSizePacked%, SAVED: %kernLowPercent% percent

@"system/MegaLZ.exe" compile/kernal_hi.bin compile/kernal_hi.bin.mlz > nul
@for /f %%i in ("compile/kernal_hi.bin") do @set KernHiSizeBin=%%~zi
@for /f %%i in ("compile/kernal_hi.bin.mlz") do @set KernHiSizePacked=%%~zi
@set /a KernHiPercent= 100-100*KernHiSizePacked/(KernHiSizeBin + 1)
@echo KERNAL HI PACKED SIZE: from %KernHiSizeBin% to %KernHiSizePacked%, SAVED: %KernHiPercent% percent


@"system/pletter5d.exe" compile/effect.bin compile/effect.bin.pl5d > nul
@for /f %%i in ("compile/effect.bin") do @set SizeBin=%%~zi
@for /f %%i in ("compile/effect.bin.pl5d") do @set pl5dSizeBinCompress=%%~zi
@set /a pl5dPercent= 100-100*pl5dSizeBinCompress/SizeBin
@echo BEGIN FX PACKED SIZE: from %SizeBin% to %pl5dSizeBinCompress%, SAVED: %pl5dPercent% percent
