Edits to binary files like retro video game roms can be tracked with patch files. When a patch file is made, it records all changes in the bytes between versions of a binary file. Using a patch file will take all the changes recorded on it and apply them to a binary file— it’s like loading a changelog.

See this guide for another, less technical description of this process that covers this in macOS.

Creating a Patch

Example with Sprites

image.png

Here I edit some map sprites in Final Fantasy V, changing the Moogle sprites. (This is done in SNES Tiles Kitten. Many guides to this tool are in this note site, so search for them if you’re interested.)

Once I’ve made the changes I want to capture in the patch file, I can use LunarIPS to compare this “After” rom file to the “Before” rom file and generate a patch.

So the “before” file is opened in LunarIPS…

image.png

Then the “After” changes file is selected… The one that’s modified with new sprites.

image.png

Finally I choose a good descriptive name for this patch file.

image.png

Now, the IPSPeek tool can examine every single change recorded in this new patch file. This is helpful to do after making a patch to be sure that no changes exist that you don’t want.

Every single contiguous run of modifed bytes in the patch file is listed separately in IPSPeek.

image.png

Choosing a row will show all the bytes that are modified at that offset.

image.png

Context

Making a patch from a Before and After pair of rom files is very useful because you can publish or pass out copies of the patch file (an .ips file) and other people can double click on it to write your modifications to their copy of the game rom.