Skip to main content

A www.romhacking.net dat creator and update checker.

Project description

rhdndat finds triples (rom file, softpatch file, version file) on the same directory and creates a clrmamepro entry on stdout or file for the result of each softpatch. It can also serve as a notifier that a update is required by comparing local versions to remote romhacking.net versions.

A softpatch filename is:
rom filename - rom extension + patch extension or
rom filename - rom extension + .reset.xdelta

This last is a special case to recognize hardpatched roms with revert patches.

If there is no patch file, but a version file exists, and the extension matches, the file will be assumed to be hardpatched, which can be avoided by passing -i.

version file is simply named version and has a version number line followed by a romhacking.net url line, repeated. These correspond to each hack or translation on the softpatch.

During normal operation, for all roms rhdndat stores extended attributes user.rom.md5, user.rom.crc32 and user.rom.sha1 in the rom file, and these checksums refer to the ‘patched’ file, even if the patch is a softpatch. The calculation is skipped in roms that aren’t in a dir with a version file if they already exist.

The hope is that this will be supported by scanning tools like retroarch scanner in order to make it much more friendly to scan non-zip filesystems as well as solve some problems with softpatching false positives in the scanner.

Requires flips (if trying to work with ips, bps) and xdelta3 (if trying to work with xdelta) on path or the same directory.

Arguments:

rhdndat [-h] [-o output-file] [-o merge-file] [-d xml-file] [-i] [-x] [-t] search-path rom-type

positional arguments:
-search-path

directory tree to search for (rom, patches and version) files

if there is no (rom, romfilename patch) pair but a patch of the form ‘romfilename.reset.xdelta’ is found, rom is treated as a hardpatched rom, -d will search for the checksum of the original rom and the output will be the checksums of ‘rom’

if (rom, version) pair exists, but no patch, rom is treated as hardpatched and printed unless -i is given

-rom-type

extension (without dot) of roms to find patches for

optional arguments:
-h, --help

show this help message and exit

-o output-file

ouput file, if ommited writes to stdout

-m merge-file

merge non-overriden entries from this source file to override a entry, a new entry must list the same romhacking urls as the older entry

-d xml-file

picks up the game names from from this cmpro .xml and the rom checksum (including if a revert patch is available), if no entry is found the program picks names from the romhacking.net hack page

-i

don’t allow unrecognized roms to be added even if the patches have a romhacking.net hack page, requires -d

-x

forces recalculation of the extended attributes even to files without a version file, for if you updated a rom file outside of the rhdndat system

-t

only test version numbers against remote version, works without a patch present, exclusive option

Memory Requirements

This tool uses named FIFO files to calculate checksums when it has to patch, so not much memory is consumed. However, for patches of large roms like isos, you should make sure you’re using xdelta instead of bps, because flips tries to read the whole file into memory to create or apply a patch.

Install

rhdndat requires python 3.5 or later.

The source for this project is available here.

The project can be installed on recent linux machines with pip3 by installing rhdndat from [PyPI] or installing latest master from [github] but you’ll have to provide your own flips and xdelta executables in path (or current dir) for the ips, bps and xdelta support. That depends on your distribution but you can get and build them on the sites at the end of the document.

[PyPI]

pip3 install --user rhdndat

[github]

pip3 install --user https://github.com/i30817/rhdndat/archive/master.zip

rhdndat may fail to execute if your OS doesn’t add the pip3 install dir ~/.local/bin - in linux - to the path

Credits

Alcaro for helpful comments and for flips

https://github.com/Alcaro/Flips

xdelta for being fast and useful

http://xdelta.org/

romhacking.net for being a awesome resource

http://www.romhacking.net/

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rhdndat-1.5.3.tar.gz (32.6 kB view hashes)

Uploaded Source

Built Distribution

rhdndat-1.5.3-py3-none-any.whl (29.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page