From c1293bb3ed6a206d799e18fafc5583939bb37d5a Mon Sep 17 00:00:00 2001 From: Marc Robledo Date: Sun, 21 Jul 2024 11:12:39 +0200 Subject: [PATCH] show expected ROM source if patch can validate source, for issue #69 --- index.html | 5 +++-- js/RomPatcher.js | 45 ++++++++++++++++++++++++++++++++++++++++++-- js/formats/bps.js | 8 +++++++- js/formats/pmsr.js | 8 +++++++- js/formats/rup.js | 12 +++++++++++- js/formats/ups.js | 6 +++++- js/locale.js | 14 ++++++++++++++ style/RomPatcher.css | 2 +- 8 files changed, 91 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 0e30fe1..12f7b2b 100644 --- a/index.html +++ b/index.html @@ -82,7 +82,7 @@ }] } ];*/ - --> + -->
@@ -125,6 +125,7 @@
+
@@ -180,7 +181,7 @@
- Rom Patcher JS v2.8.1 by Marc Robledo + Rom Patcher JS v2.9 by Marc Robledo
See on GitHub Donate diff --git a/js/RomPatcher.js b/js/RomPatcher.js index fe8551c..73ea8d1 100644 --- a/js/RomPatcher.js +++ b/js/RomPatcher.js @@ -1,4 +1,4 @@ -/* Rom Patcher JS v20230406 - Marc Robledo 2016-2023 - http://www.marcrobledo.com/license */ +/* Rom Patcher JS v20240721 - Marc Robledo 2016-2024 - http://www.marcrobledo.com/license */ const TOO_BIG_ROM_SIZE=67108863; const HEADERS_INFO=[ @@ -112,7 +112,13 @@ function parseCustomPatch(customPatch){ if(typeof customPatch.crc==='number'){ patch.validateSource=function(romFile,headerSize){ return customPatch.crc===crc32(romFile, headerSize) - } + }; + patch.getValidationInfo=function(){ + return [{ + 'type':'CRC32', + 'value':padZeroes(customPatch.crc,4) + }] + }; }else if(typeof customPatch.crc==='object'){ patch.validateSource=function(romFile,headerSize){ for(var i=0; i