Create Patch.bat
@echo off
if "%~1"=="" goto help
echo Creating patch...
"%~dp0xdelta" -efs "%~dp0unmodified_rom.nds" %1 "%~dp1patch_file.pat"
echo Done!
goto end
:help
echo Usage: Drag modified rom onto this file to create a patch.
:end
echo.
pause
cls
Apply Patch.bat
@echo off
if "%~1"=="" goto help
echo Patching...
"%~dp0xdelta" -dfs %1 "%~dp0patch_file.pat" "%~dpn1-patched%~x1"
if %ERRORLEVEL%==9009 goto missingxdelta
if %ERRORLEVEL%==1 goto patchfailed
echo Done! The patched file has been created in the same folder as the original.
echo If the patch does not work, make sure that you applied it to the original,
echo unpatched, untrimmed ROM.
goto end
:missingxdelta
echo.
echo Unable to find the xdelta patching utility. Make sure that you extract all
echo of the patch files to the same folder before running this.
goto end
:patchfailed
echo.
echo The xdelta patching utility was unable to apply the patch. Make sure to use the
echo original (unpatched, untrimmed) ROM and extract all of the patch files to the
echo same folder before running this.
goto end
:help
echo You're almost there, but don't try to open the Drop Rom Here file by itself.
echo To patch your game, close this window and drag the original (unpatched,
echo untrimmed) ROM onto the Drop Rom Here file. The patched ROM will be created in
echo the same folder as the original, with a different name.
:end
echo.
pause
cls
Replace unmodified_rom.nds and patch_file.pat with whichever filenames you decide to use.