News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Looking for documentation on the different patch file types  (Read 440 times)

Aquova

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Looking for documentation on the different patch file types
« on: September 04, 2020, 03:25:43 pm »
Hi there, for a fun little personal project, I've been wanting to work on a patching tool that can handle several different patching formats (IPS, BPS, etc.). However, I've been struggling to find any technical documentation on how the formats work. I did manage to find a decent IPS article (https://zerosoft.zophar.net/ips.php). But everything else I haven't been able to find. If anyone has any good resources, I'd like to see them. Thanks!

MysticLord

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Looking for documentation on the different patch file types
« Reply #1 on: September 04, 2020, 08:06:06 pm »
Ask here for UPS, BPS, and anything else byuu designed.

https://helmet.kafuka.org/bboard/

No clue about xdelta but it's commonly used in the software industry so there should be documents somewhere.

There are open source PPF tools, check here or github.

Jorpho

  • Hero Member
  • *****
  • Posts: 4620
  • The cat screams with the voice of a man.
    • View Profile
Re: Looking for documentation on the different patch file types
« Reply #2 on: September 04, 2020, 09:27:34 pm »
A Google search for "site:romhacking.net bps specification" (no quotes) turns up https://www.romhacking.net/documents/746/ .  Did you see that already?
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

FAST6191

  • Hero Member
  • *****
  • Posts: 2962
    • View Profile
Re: Looking for documentation on the different patch file types
« Reply #3 on: September 04, 2020, 10:52:45 pm »
Most of the formats have source code for patchers at least (patch makers as well most of the time but if you have the applier part then it is more tedious than anything else). Such things are both probably better and easier to come by than a wordy specification.

It should also be noted most formats we see have three or four different implementations and extensions to the format.

IPS has loads of random extensions, to say nothing of the missing EOF (IPS in the original implementation was supposed to end a file with EOF, however some implementations don't and that causes issues). I don't know how much you want to do the extensions today as most are not in common rotation and might be mutually incompatible (guess you could do a dropdown or something).

Xdelta has a few.
https://www.evanjones.ca/software/xdelta-win32.html being the earlier one popular during the DS after IPS finally showed its age* and people were forced to jump ship, http://xdelta.org/ then having 2.0 and the current one. Not to mention you probably also want to make sure you have an option to disable verification in case people want to use trimmed ROMs and stack patches.

BSdiff is largely spared from what I have seen, though the main link to the common older windows port/compile does mention things
https://www.pokorra.de/coding/bsdiff.html
http://www.daemonology.net/bsdiff/

PPF...
The original poster child for multiple mutually incompatible versions.

Afraid I have not kept up with beat and bps, I mostly encounter bps from people making optional patches of all the flavours or late stage GBA stuff (GBA ROMs go to 32 megs, more than baseline IPS can really handle). Fireflower I mention just because.

Straight deltas have been used occasionally. There are also a few file system aware formats and methods, in my case I would probably point you at the format made for Jump Ultimate Stars on the DS.

*16 meg window, though most things would not apply a window so instead 16 megs from the start of the file. No relocation (common for anything with a file system). No file verification.