ROMPatcher
If a patch file is found and the ROMPatcher module is selected, then this will download patch files and apply to ROMs. To highlight if a ROM has been patched, the final file will have a (ROMPatched) in the file name.
Currently, ROMSearch only uses xdelta to patch ROMs.
For more details on the ROMPatcher arguments, see the config file documentation.
xdelta
To use xdelta, download the latest xdelta3 release from
here. After unzipping the .exe file, add the path to this file
into your config, under xdelta_path in the rompatcher config section.
API
- class romsearch.ROMPatcher(platform, config_file=None, config=None, platform_config=None, logger=None, log_line_sep='=', log_line_length=100)[source]
ROM Patching tool
There are different ways to patch files based on platforms, so we need to keep track of a number of things here
- Parameters:
platform (str) – Platform name
config_file (str, optional) – path to config file. Defaults to None.
config (dict, optional) – configuration dictionary. Defaults to None.
platform_config (dict, optional) – platform configuration dictionary. Defaults to None.
logger (logging.Logger, optional) – logger. Defaults to None.
log_line_length (int, optional) – Line length of log. Defaults to 100
- download_patch_file(patch_url, patch_dir)[source]
Download a patch file
- Parameters:
patch_url (str) – URL to patch file
patch_dir (str) – Patch directory
- get_unpatched_file(patch_dir)[source]
Get the unpatched file from the patch directory
- Parameters:
patch_dir (str) – Patch directory
- patch_rom(unpatched_file, patch_file)[source]
Patch a ROM
- Parameters:
unpatched_file (str) – ROM file to patch
patch_file (str) – Patch file to patch
- run(file, patch_url)[source]
Run the ROMPatcher
- xdelta_patch(unpatched_file, patch_file, out_file)[source]
Patch using xdelta
- Parameters:
unpatched_file (str) – ROM file to patch
patch_file (str) – Patch file to patch
out_file (str) – Path for output file