ROMCompressor
For some platforms, ROMs may come as a number of individual files (e.g. the original PlayStation has .bin and .cue files). ROMCompressor simplifies this by compressing these files into one single file.
If a platform is marked for compression, and the path to the appropriate executable is given in the config, then ROMCompressor will compress these files down.
Currently, ROMSearch can use chdman to compress ROMs to .chd files.
For more details on the ROMCompressor arguments, see the config file documentation.
chdman
To use chdman, download the latest chdman release from
https://github.com/umageddon/namDHC/releases.
Download chdman.exe, add the path to this file into your config, under chdman_path in the
romcompressor config section.
API
- class romsearch.ROMCompressor(platform, compress_method='chdman', compress_method_path=None, config_file=None, config=None, logger=None, log_line_sep='=', log_line_length=100)[source]
ROM compression tool
Offers a way to (re)compress a file. Currently only does CHD compression, but can be extended to other compression methods if needed.
- Parameters:
platform (str) – Platform name
compress_method (str, optional) – compression method. Defaults to “chdman”.
compress_method_path (str, optional) – path to compression executable. Defaults to None.
config_file (str, optional) – path to config file. Defaults to None.
config (dict, optional) – 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
- compress_chd(rom, rom_dir, temp_dir)[source]
Compress using CHDMAN
- Parameters:
rom (str) – ROM file to compress
rom_dir (str) – Directory for final, compressed ROM
temp_dir (str) – Directory containing files to compress
- run(rom)[source]
Run the ROMCompressor
- Parameters:
rom – ROM file to compress