1
0
Fork 0
mirror of https://github.com/marcrobledo/RomPatcher.js.git synced 2025-07-17 16:38:31 +00:00

Merge branch 'master'(fork alignment) into feat/tauri-app-conversion

This commit is contained in:
Iranon 2024-07-24 09:50:53 +02:00
commit 348e125eb0
10 changed files with 102 additions and 9 deletions

View file

@ -1,4 +1,4 @@
/* UPS module for Rom Patcher JS v20220315 - Marc Robledo 2017-2022 - http://www.marcrobledo.com/license */
/* UPS module for Rom Patcher JS v20240721 - Marc Robledo 2017-2024 - http://www.marcrobledo.com/license */
/* File format specification: http://www.romhacking.net/documents/392/ */
const UPS_MAGIC='UPS1';
@ -52,6 +52,10 @@ UPS.prototype.export=function(fileName){
return tempFile
}
UPS.prototype.validateSource=function(romFile,headerSize){return crc32(romFile,headerSize)===this.checksumInput}
UPS.prototype.getValidationInfo=function(){return [{
'type':'CRC32',
'value':padZeroes(this.checksumInput,4)
}];}
UPS.prototype.apply=function(romFile, validate){
if(validate && !this.validateSource(romFile)){
throw new Error('error_crc_input');