Closed flagrama closed 2 years ago
Yes, it is intended. In some cases patches that require a valid checksum may work with ROMs that do not validate. People sometimes may have slightly different ROMs (different header, small bits changed here and there, etc) that can still be compatible with those patches. So I decided to just let warn the user the ROM is not valid, but still be able to patch.
As for the custom patcher... There are also reasons on why patches are downloaded as soon as user selects them:
CUSTOM_PATCHER
has a zip file containing multiple patches, it must be downloaded beforehand in order to look for the patches inside. Back when the first custom patcher version compatible was released, you could provide the names and even their CRC32 for every patch inside the zip file. However, it was discarded as it forced author to specify every patch and also it wasn't compatible with RHDN, which is used when clicking on Patch Online Now! and it's impossible to know if zip file contains one or various patches unless you download and unzip it.Okay, sounds like there are some valid reasons to do both the current way, and if the person hosting the custom patcher wants to make these changes for whatever reason they can just do so since it isn't too difficult.
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 apatchFileCrc
storedvalidateSource
checks equality of the hashes to enable the Apply button, if there are both apatch
and aromFile
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 theselectedPatch
and changing the selected patch will invokevalidateSource
.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?