marcrobledo / RomPatcher.js

An IPS/UPS/APS/BPS/RUP/PPF/xdelta ROM patcher made in HTML5.
https://www.marcrobledo.com/RomPatcher.js/
Other
656 stars 133 forks source link

Cannot generate .ips files for Switch due to file size limit #21

Closed tech-ticks closed 2 years ago

tech-ticks commented 3 years ago

Since this tool doesn't allow generating .ips patches over 16 megabytes, it's impossible to create patches for Switch mods of some games. I've bypassed the limit in my local copy to generate a patch for a 35 MB binary which worked fine, so it seems like this limit could be removed without any problems.

btimofeev commented 3 years ago

@tech-ticks the patch cannot handle files larger than 16 megabytes in accordance with the IPS specification. Your IPS patch will not be compatible with all other patchers if you change this. It is very bad to do this, since it will be a big problem for users to find a patcher that supports a specific version of the patch. It's better to focus on standards and choose the patch format that suits you best. You need to use UPS or BPS formats for large files.

There is also the IPS32 format (most likely this is what your implementation looks like), but such patches are not at all common. This is the same IPS, but it has MAGIC = "IPS32" instead of "PATCH", 4-byte offsets instead of 3-byte, and the end-of-file "EEOF" instead of "EOF". You can add support for such patches (this is easy to do based on the IPS code, it is enough to add conditions in three places), but please do not change the IPS format, this will add a headache to users and patcher developers.