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

Author Topic: What format should I use to create my patch?  (Read 1732 times)

RadicalR

  • RHDN Patreon Supporter!
  • Jr. Member
  • *****
  • Posts: 57
    • View Profile
What format should I use to create my patch?
« on: January 28, 2013, 11:54:33 pm »
I'm going to be creating some patches for a project that I've been working on. I need to patch several floppy disk images. Before I used IPS with no problems, but I didn't know if time has marched on, and there was a better format out there. I know there was something called UPS or something of the like.

Please enlighten me on what would be the best one to use. Thanks.

Zynk

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 903
  • WIP Roll-chan: The Wily Wars
    • View Profile
Re: What format should I use to create my patch?
« Reply #1 on: January 29, 2013, 05:46:58 am »
I recently used the beat patcher with my very first submission. Maybe you should check that out.
Lunar ips is still used here today for mostly nes roms afaik.

FAST6191

  • Hero Member
  • *****
  • Posts: 2469
    • View Profile
Re: What format should I use to create my patch?
« Reply #2 on: January 29, 2013, 09:37:20 am »
Is your game below 16 megs and with no trace of a filesystem/need for things like adding and removing sections? Can you trust the end users of your hack to provide it with the correct version of the ROM (properly dumped, no flash cart headers, no interleaved whatever)?
If so then many will probably thank you for using IPS still- it is still largely the only format many emulators will support for "in place"/"soft" patching.

Is your game larger than 16 megs, does it have a filesystem (this is where your floppy discs might come unstuck), do you need to hold the hands of your users vis a vis having the proper starting point ROM and who cares about soft patching emulators when space is so cheap? Then we get to talk other methods and there are loads. All four should be available in the utilities section of this site.
For my money it comes down to four formats and a big asterisk
UPS - made as a replacement for IPS it lacks some of the features of the formats to come but found fans among the GBA hackers (where games went to 32 megs), N64 hackers (again games over 16 megs) and some SNES hackers (where ROM images are all sorts of formats I guess). I can not say I would suggest it over the ones to come but I am not going to diss it either.
Xdelta - a general patching system. Well liked among DS ROM hackers and many other systems.
BSDiff - another general patching system and rival to xdelta in the real world. Most notably used by a lot of the DS Scene for their trainers and some other patches but not so much among ROM hackers from what I have seen.
PPF - made for the original playstation I believe (playstation patching format being the expanded name). Fans on the wii, the playstation and a few of the home consoles.

The asterisk- on filesystems. New consoles (which is to say playstation and up, DS and up) use filesystems to hold smaller files, this is a massive bonus for most people hacking those systems (it makes tracing slightly harder though so not a complete universal bonus) but does rather often leave the ROM in a completely different order to that which things started in (the game likely does not care though*). Add in an increased use of compression and use of filesystem encryption and said new systems can benefit from including a program to unpack (and decompress and decrypt as necessary) and another to patch the individual files before putting it all back together. Patches here can be far smaller as well- though BSDiff and XDelta can scan around to find the new locations their searching methods are far from flawless.

*some games on the DS have the base locations as sacred for various reasons, depending upon how you want to look at it spiral tracking antipiracy methods probably count here in some regards and there was also the curious case of Star Wars KOTOR (might have been the sequel) on the original xbox which did have the original optical disc optimised for seek and general read times which then degraded when the file by file dumping method was used and the game burned back to DVD. That is less of a patching problem and more of a hacking problem so moving on swiftly.

Anything else that is not a filesystem method (with a possible minor exception for PAR2 under certain conditions) I would not bother with unless you can make a convincing case for it. I reserve the right to add beat ( http://www.romhacking.net/utilities/893/ ) to that list at a later date, it has some nice ideas but the real world has perhaps not caught up yet.

In a world where people routinely use all manner of operating systems and emulators run on everything I can not condone having exe patching programs unless you have a very strong case for it (options that can not be replicated by saying if you want this then use this patch, if you also want say an improved font then also use this....). This is somewhat at odds with the filesystem stuff I mentioned a couple of paragraphs back where such programs are almost universally windows based. Command line options for most consoles exist though so you can build batch files/shell scripts and try to put together packages that way, similarly more or less universal programming languages exist (web languages, python and java being the main examples) so you can try your hand at those.

Zoinkity

  • Hero Member
  • *****
  • Posts: 557
    • View Profile
Re: What format should I use to create my patch?
« Reply #3 on: January 29, 2013, 10:08:46 am »
UPS wasn't ever really used for N64 hacks.  They had APS, which is its own beast.

One advantage of beat (bps) is that you can patch a whole directory, as in every file within a directory, using just one patch.  If you were to patch the original floppies themselves it might prove useful, especially since it can confirm you're applying to the right disk and that the contents are okay. 
Delta patchers like beat, xdelta, and bsdiff are useful if information is shifted around.  Delta patching only stores altered data; it doesn't store anything that was only moved.

There's nothing wrong with IPS though, especially if it's what your audience expects.