marcrobledo / rompatcher.js Goto Github PK
View Code? Open in Web Editor NEWAn IPS/UPS/APS/BPS/RUP/PPF/xdelta ROM patcher made in HTML5.
Home Page: https://www.marcrobledo.com/RomPatcher.js/
License: Other
An IPS/UPS/APS/BPS/RUP/PPF/xdelta ROM patcher made in HTML5.
Home Page: https://www.marcrobledo.com/RomPatcher.js/
License: Other
I used the online patcher to apply this hack https://www.romhacking.net/hacks/1950/ and the browser crashed when i was patching the CD 2 of the game.
The patch works using ppf-o-matic 3.0
I tried to use the English translation patch (a BPS file) for Super Famicom Wars rom using the patcher, but I got this error. Am I doing anything wrong?
Uncaught RangeError: Offset is outside the bounds of the DataView
at DataView.getUint8 (<anonymous>)
at MarcBinFile.readByte (RomPatcher.js:291)
at BPS.apply (bps.js:82)
at applyPatchFile (RomPatcher.js:140)
at HTMLButtonElement.onclick ((index):65)
ebp
is used for Earthbound hacks.
Info:
https://github.com/Lyrositor/EBPatcher
https://forum.starmen.net/forum/Community/PKHack/EarthBound-Patcher-and-EarthBound-Hack-Vault
Hello!
I was wondering, if it was possible to implement something like an online patcher with patch file already placed on server. Say, for translation group trying to distribute it's patch, it would be cool to have a styled nice page with just one input for ROM file and button 'apply patch'.
I was trying to add additional onload function for getting this patch online. Something like:
var blob = null;
var xhr = new XMLHttpRequest();
xhr.open("GET", "./1.ips");
xhr.responseType = "blob";//force the HTTP response, response-type header to be blob
xhr.onload = function()
{
blob = xhr.response;//xhr.response is now a blob object
openPatchFile(blob);
}
xhr.send();
But only succeeded on local file. As soon as I place all the files on server I cannot get proper blob for processing.
Thank you for this excellent tool, it's very useful.
Please consider adding support for BDF format, as implemented by bsdiff and its bspatch tool.
The code is available under permissive license at https://github.com/mendsley/bsdiff
I cant patch my N64 game
This patches may support applying IPS, UPS, APS, and BPS patches, but it only supports creating IPS, UPS, and APS patches - support for creating BPS patches is notably absent.
This is kind of unfortunate as I'm trying to find a BPS patch creation utility that actually functions correctly with GameCube games and their 1.35GB size - beat just sits there doing nothing while Floating IPS throws up an error saying "files are too big" even though BPS as a format supposedly has no file size limit...
Currently, this patcher is heavily tied to the interface that you see publicly in the demo. So much so that it even calls specific DOM elements by id in the main patcher js.
It would be nice to separate the logic of the actual patcher itself from the GUI elements so that it can be easily imported and used on other websites and not, very specifically, the one provided.
Additionally, the patcher seems to require a very specific structure, with a js folder at root, etc. Quite a few of the internal scripts (particularly as it relates to creating workers in RomPatcher.js
for example) rely on this specific structure. It would be nice if imports were a lot less absolute and more relative, so that we might be able to import these in arbitrary folders irrespective of position relative to the root directory (so, for example, static/Rompatcher/js/RomPatcher.js
should work rather than just /js/RomPatcher.js
).
Some old rom hacks use double .ips patches, which is supported by SPATCH. It extends IPS format to support different filesizes in the old days before widely use of some better patch format like UPS. Considering it is not widely used anymore nowadays, this feature request is only to support some really old rom patches, so it doesn't have a high priority.
Links:
Note: the example above includes patches in both IPS and UPS patch format for you to compare patched ROMs.
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.
This patch is not being applied correctly.
It is probably affecting other BPS patches too.
Often a patch requires a specific ROM. Maybe headered, maybe unheadered.
Eg. Seiken Densetsu 3.
But your tool doesnt check for headers so it's possible to patch the wrong ROM?
I'd like to convert whole ROMs to IPS style for a Retron5.
I'm working on a Node.js command line app that needs to have IPS patching functionality. This repo has a lot of great functionality, but from what I can tell, it assumes consumption in the browser with a GUI. Would be nice to be able to do stuff like this:
// Node.js script
let romPatcher = require('RomPatcher')
romPatcher.patch(inputRomPath, inputIpsPath, outputRomPath)
// the above writes to outputRomPath using Node.js fs module
whats with this tool? lots of ppl reccemend it to be useful & works 100% for them yet when i try to use it to patch zelda ocarina of time with any patch i get this error instantly i could have used every single one i could find for the game even if i dump it with the real game card id still get the same results are the roms at fault or the patches im trying to use?
Because of this, it's impossible to patch J2ME video-games.
On an iPhone, I access the page and if I click the “patch file” button I can browse the files in my Files app but the IPS file is not selectable. I can however select the ROM by clicking in “ROM file”.
Im trying to apply Final fantasy tactics advance X patch, but it doesnt allow me
When using setMessage
it doesn't set a data-localize
attribute on the element the message is added to. Due to this if you change the language after setMessage
has set a message it will still appear in the previously selected language.
I think ideally instead of msg
you take in the localization key instead, then set data-localize
to that key and set the message by passing the key to _
inside of setMessage
.
I can write up a quick PR if this implementation sounds good to you.
I added .xdelta support, borrowed from https://github.com/google/xdelta3-decoder-js.
It works with http://www.romhacking.net/hacks/3810/, but seems to fail with https://www.romhacking.net/hacks/2871/. It creates a 8mb file full of garbage, when it should be 32mb (like the source ROM).
I commented all xdelta code for now, but I commited the needed files for anyone who wants to take a look.
I came here thanks to Rocket Edition it makes sense to recognize the site back in the readme.
I'm actually encountering errors when trying to create patches, using Chrome 65.0.3325.181. Worth pointing out that the errors aren't handled so it fails silently and the UI simply appears to be unresponsive.
This is the most common and occurred in multiple scenarios (different ROMs, trying to create both IPS and UPS). For example, trying to create a patch from "Metroid (U).nes" to MDbTroid, both IPS and UPS:
RomPatcher.js:239 Uncaught RangeError: Offset is outside the bounds of the DataView
at DataView.getUint8 (<anonymous>)
at MarcBinFile.readByte (RomPatcher.js:239)
at createIPSFromFiles (ips.js:154)
at createPatchFile (RomPatcher.js:132)
at HTMLButtonElement.onclick ((index):103)
This comes up if the source and modified ROM are the same.
ips.js:72 Uncaught TypeError: Cannot read property 'truncate' of undefined
at IPS.export (ips.js:72)
at createPatchFile (RomPatcher.js:144)
at HTMLButtonElement.onclick ((index):103)
| IPS.export | @ | ips.js:72
| createPatchFile | @ | RomPatcher.js:144
| onclick | @ | (index):103
I wanted to ask if I could use this on a website of mine that is related to hacking arcade games? I provide new revisions of older Midway games and the method for distribution is patches to the original ROMs. Some more info on setup would be much appreciated if you have the time as well. Thank you for your time Marco.
-Paul
This isn't a feature request but more a quick discussion on if one or both parts of the title would be features the patcher would be better off with. I've written both for my own purposes and was wondering if they would be appreciated in a PR before I clean it up to do so.
The changes are as follows:
CUSTOM_PATCHER
object are stored to be compared later.romFile
and a patchFileCrc
stored validateSource
checks equality of the hashes to enable the Apply button, if there are both a patch
and a romFile
the Apply button is also enabled if their hashes match. Otherwise it disabled.fetchPatch
has been made a Promise which is required to avoid trying to apply a patch before it is downloaded due the async nature of Javascript.fetchPatch
usages have been replaced with saving the CRC of the selectedPatch
and changing the selected patch will invoke validateSource
.Only the Apply button being disabled with an invalid CRC affects the normal patcher, and both features would be pretty easy to implement independently if one of them isn't desired.
Is there a reason to apply to a ROM that doesn't match the CRC32? It seems kind of silly to apply a patch in this case as it is usually just more likely to break the ROM. However, if there is a valid reason to do so I can understand.
I think regardless of the above question it would be nice if the custom patches were only downloaded on demand when the user actually wants to use it instead of downloading each on the select box being changed to save on server bandwidth. Is there any reason you wouldn't want this?
Dear Marc,
Please try to create a BPS patch from these two files: https://we.tl/t-sqb2zBb9KX
Original: Tomb Raider - The Last Revelation (USA) (Rev 1).bin
Final: Tomb Raider - The Last Revelation (USA) (Rev 1) - TR4 Improved [Fix by Farglior v1.0].bin
I know these are big files, but to me they just expose some underlining problem with the BPS linear patch creation algorithm that could happen with smaller ones.
Best,
Juan
with most files, esp smw romhacks, it makes more sense to name it the name of the patch than to name it a generic smw patched thing. i might dive through the source code myself and find what makes the name, but i am garbage at js and would rather leave it to someone who knows what theyre doing.
Is it possible to check uploaded ROM against required checksum listed on RHDN patch page?
This way we can avoid more incorrect ROM patching.
Hello! Sorry for my bad english. Сurrently only one patch can be applied. I very want to apply several predefined patches at once. Сan you make this feature?
just a suggestion, it would be pretty cool to add your own header name to the ROM, just so it doesn't get labelled as andother version of a game you already have in an emulator like zSNES
When creating a patch can we be allowed to use Nintendo ds rom files as large as 64.0 mb
When loading a file on Safari 15.0/macOS 11.6, I get:
[Error] SyntaxError: Invalid regular expression: invalid group specifier name
(anonymous function) (zip.js:7)
[Error] ReferenceError: Can't find variable: ZIP_MAGIC
_parseROM (RomPatcher.js:188)
(anonymous function) (MarcFile.js:26)
The line corresponds to
RomPatcher.js/js/formats/zip.js
Line 7 in 458d729
This works on Firefox 95.0.1.
I have no idea why you used nine year old code, incomplete based on some short glances, from a school related project as a base for Xdelta3 format support, but I recommend you use official source material instead. v3.1.0 is an appropriate version to use, majority of offline Xdelta patching solutions use this version already. The secondary compression formats are important here given some patches out in the wild actually use them, not to mention are backwards compatible with older versions of Xdelta3 when using front end solutions like Xdelta UI (uses v3.0u). Patches made with newer versions of Xdelta3 do not work with the online patcher since the code used doesn't understand the newer algorithm format that these newer patches are in. Due to this issue, it actually makes it difficult for some users out there who do not have access to a computer or uses an operating system that doesn't have a compiled patcher solution of sorts to work with.
Side note, v3.1.1 exists under the current source page, but it's kind of buggy, hence why v3.1.0 is a more appropriate version to use, so chances are you'll want to examine the GPL based source.
Sources:
https://github.com/jmacd/xdelta (Current)
https://github.com/jmacd/xdelta-gpl (Original)
When creating a patch it would be neat to have maybe several (all) patchfiles.
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)
ASM Is The Format Of Patches That LunarIPS Uses For "WIP Hacks", Meaning They're Held At Addresses, Could Support For These Types Of Files Be Added Please?
It would be useful to have the patched ROM automatically renamed to the original name of the patch file, rather than "Original ROM (patched).ext". As it is now, I find myself always renaming the output files afterwards to the name of the patch.
So how it could be:
Input:
OriginalGame.sfc
CustomGame2023.bps
Output:
CustomGame2023.sfc
Where MyCustomGame2023.sfc is the output.
Hello, can we use xdelta-wasm for xdelta?
https://kotcrab.github.io/xdelta-wasm/
https://github.com/kotcrab/xdelta-wasm
thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.