marcrobledo / RomPatcher.js

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

.DIFF / .PATCH support? #32

Closed NintendoManiac64 closed 2 years ago

NintendoManiac64 commented 2 years ago

Apparently the ".DIFF" / ".PATCH" format has been the go-to solution for like 50 years in terms of source code patching rather than binary patching. I don't suppose it'd be too difficult to add it then?

Basically there's an open-source piece of software that people have created patch fixes for in .DIFF format, but me and my lack of code savvy-ness is making things a bit difficult to get this working which made me wonder why an easy-to-use patcher doesn't exist for the format if it's as prevalent as it sounds (my guess is that it's kind of a "for coders by coders" and so nobody ever ran into the situation of a non-coding-savvy user needing to run such a file)

foxsouns commented 2 years ago

@NintendoManiac64 .diff files basically define changes to be made from the source repo, in a way very similar to the rom patch files this tool is known for implementing, however .diff is not for roms, so i dont think it would make sense to include it.

however, if you were trying to do this on the link you gave, and are stuck on browser, i would personally try to use replit.com for this.

make a replit thing, clone the repo with git clone https://github.com/EbonJaeger/nosquint.git, download the diff file to replit and unzip it using wget https://github.com/EbonJaeger/nosquint/files/7556382/nosquint_nofuel.zip && unzip nosquint_nofuel.zip, and then run cd nosquint && git am ../whatever_the_path_to_the_thing_is.diff && ./build-xpi.sh, obviously changing the part after ../ to the file name. this should put the extension somewhere within nosquint/, i think nosquint/dist

NintendoManiac64 commented 2 years ago

however .diff is not for roms, so i dont think it would make sense to include it.

I know of people that have used BPS and xDelta as a way to update and/or mod native PC games and such since the formats work with any sort of singular file whether it be a rom, an archive, an image, etc.

I say this because, AFAICT, the .DIFF file is patching a singular .JAR file, and therefore I don't really see how that's any different from how ROM patch files patch a singular file.

foxsouns commented 2 years ago

i see. well then, i am trash at js, so let's hope someone who isnt will pick this up.

EbonJaeger commented 2 years ago

I say this because, AFAICT, the .DIFF file is patching a singular .JAR file

I'm only chiming in here to try to prevent further confusion.

.diff (or also commonly .patch) files simply patch a (non-compiled) source code file. As far as I can tell, this repo is for patching binary archives or ROMs (compiled code and assets), which is significantly different and only tangentially related at best.

I think I understand the source of the confusion in that the linked repo (a web browser extension) is distributed and installed as a complete archive, similar to a ROM. The difference is that the technologies used (JavaScript, HTML, etc.) are all non-compiled languages and are simply bundled together, unlike a ROM which I would assume is the result of a compilation process.

In this particular case, one is operating at the source level (.diff with NoSquint), and the other at the compiled level (ROM).

In the event that you need to patch text or source files like this. I'm sure there are plenty of tools available that are suited to that task, such as Git if it's a source code repository, or diff/patch if you're on Linux.

NintendoManiac64 commented 2 years ago

In this particular case, one is operating at the source level (.diff with NoSquint), and the other at the compiled level (ROM).

Perhaps it's my general lack of understanding of coding stuff but, from my perspective as a user, the input and output is not any different - a singular patch file is applied to a singular pre-existing file to transform it into a different singular file.

I mean, I actually just a week or two ago used xDelta patches as a way to supply a fix for an hour-long MP4 video file of all things where its audio and video would go out of sync.

foxsouns commented 2 years ago

@NintendoManiac64: coming back and necroposting here to say that diff/patch isnt xdelta; diff/patch works by changing textual stuff, and everything supported here changes binary stuff. they dont work the same and are used for different purposes. as said above: use a diff tool for these files, and replit will work if you desperately need a web-browser solution for this.