1
0
Fork 0
mirror of https://github.com/marcrobledo/RomPatcher.js.git synced 2025-09-25 17:36:56 +00:00

refactor: resorted all EBP and BDF references

This commit is contained in:
Marc Robledo 2025-09-22 10:11:44 +02:00
parent fd6e589184
commit 91e522e247
7 changed files with 29 additions and 27 deletions

View file

@ -9,9 +9,10 @@ A ROM patcher made in Javascript.
* BPS
* RUP
* PPF
* EBP
* BSDiff (.bdf, .bspatch)
* Paper Mario Star Rod (.mod)
* VCDiff (.xdelta, .vcdiff)
* BSDiff (.bdf, .bspatch) (patch only)
* can patch and create patches
* shows ROM CRC32, MD5 and SHA-1 before patching
* can remove headers before patching

View file

@ -6,7 +6,7 @@
*/
var PRECACHE_ID = 'rom-patcher-js';
var PRECACHE_VERSION = 'v32';
var PRECACHE_VERSION = 'v321';
var PRECACHE_URLS = [
'/RomPatcher.js/', '/RomPatcher.js/index.html',
'/RomPatcher.js/manifest.json',
@ -19,19 +19,18 @@ var PRECACHE_URLS = [
'/RomPatcher.js/rom-patcher-js/modules/BinFile.js',
'/RomPatcher.js/rom-patcher-js/modules/HashCalculator.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.ips.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.bdf.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.bps.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.ups.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.aps_n64.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.aps_gba.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.rup.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.ppf.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.bdf.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.pmsr.js',
'/RomPatcher.js/rom-patcher-js/modules/RomPatcher.format.vcdiff.js',
'/RomPatcher.js/rom-patcher-js/modules/zip.js/z-worker.js',
'/RomPatcher.js/rom-patcher-js/modules/zip.js/zip.min.js',
'/RomPatcher.js/rom-patcher-js/modules/zip.js/inflate.js',
'/RomPatcher.js/rom-patcher-js/modules/bz2/bz2.js',
/* Rom Patcher JS core (web assets) */
'/RomPatcher.js/rom-patcher-js/assets/icon_alert_orange.svg',
'/RomPatcher.js/rom-patcher-js/assets/icon_check_circle_green.svg',

View file

@ -83,7 +83,7 @@
<div class="row m-b" id="rom-patcher-row-file-patch">
<div class="text-right"><label for="rom-patcher-input-file-patch" data-localize="yes">Patch file:</label></div>
<div class="rom-patcher-container-input">
<input type="file" id="rom-patcher-input-file-patch" class="empty" accept=".ips,.ups,.bps,.aps,.rup,.ppf,.mod,.ebp,.xdelta,.vcdiff,.zip" disabled />
<input type="file" id="rom-patcher-input-file-patch" class="empty" accept=".ips,.ups,.bps,.aps,.rup,.ppf,.ebp,.bdf,.bspatch,.mod,.xdelta,.vcdiff,.zip" disabled />
</div>
</div>
<div class="row m-b" id="rom-patcher-row-patch-description">
@ -157,7 +157,7 @@
<button id="button-settings" class="btn-transparent"><img src="./webapp/icon_settings.svg" loading="lazy" class="icon settings" /> <span data-localize="yes">Settings</span></button>
</div>
Rom Patcher JS <small><a href="legacy/" rel="nofollow">v3.2</a></small> by <a href="/">Marc Robledo</a>
Rom Patcher JS <small><a href="legacy/" rel="nofollow">v3.2.1</a></small> by <a href="/">Marc Robledo</a>
<br />
<img src="./webapp/icon_github.svg" loading="lazy" class="icon github" /> <a href="https://github.com/marcrobledo/RomPatcher.js/" target="_blank">See on GitHub</a>
<img src="./webapp/icon_heart.svg" loading="lazy" class="icon heart" /> <a href="https://www.paypal.me/marcrobledo/5" target="_blank" rel="nofollow">Donate</a>

View file

@ -7,7 +7,7 @@
*
* MIT License
*
* Copyright (c) 2016-2024 Marc Robledo
* Copyright (c) 2016-2025 Marc Robledo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -113,12 +113,12 @@ const RomPatcher = (function () {
patch = RUP.fromFile(patchFile);
} else if (header.startsWith(PPF.MAGIC)) {
patch = PPF.fromFile(patchFile);
} else if (header.startsWith(BDF.MAGIC)) {
patch = BDF.fromFile(patchFile);
} else if (header.startsWith(PMSR.MAGIC)) {
patch = PMSR.fromFile(patchFile);
} else if (header.startsWith(VCDIFF.MAGIC)) {
patch = VCDIFF.fromFile(patchFile);
} else if (header.startsWith(BDF.MAGIC)) {
patch = BDF.fromFile(patchFile);
}
if (patch)
@ -255,7 +255,6 @@ const RomPatcher = (function () {
} else if (format === 'aps') {
patch = APS.buildFromRoms(originalFile, modifiedFile);
} else if (format === 'rup') {
if(metadata)
patch = RUP.buildFromRoms(originalFile, modifiedFile, metadata && metadata.Description? metadata.Description : null);
} else if (format === 'ebp') {
patch = IPS.buildFromRoms(originalFile, modifiedFile, metadata);
@ -407,7 +406,7 @@ if (typeof module !== 'undefined' && module.exports) {
BPS = require('./modules/RomPatcher.format.bps');
RUP = require('./modules/RomPatcher.format.rup');
PPF = require('./modules/RomPatcher.format.ppf');
BDF = require('./modules/RomPatcher.format.bdf');
PMSR = require('./modules/RomPatcher.format.pmsr');
VCDIFF = require('./modules/RomPatcher.format.vcdiff');
BDF = require('./modules/RomPatcher.format.bdf');
}

View file

@ -48,9 +48,9 @@ const RomPatcherWeb = (function () {
'modules/RomPatcher.format.bps.js',
'modules/RomPatcher.format.rup.js',
'modules/RomPatcher.format.ppf.js',
'modules/RomPatcher.format.bdf.js',
'modules/RomPatcher.format.pmsr.js',
'modules/RomPatcher.format.vcdiff.js',
'modules/RomPatcher.format.bdf.js',
'modules/zip.js/zip.min.js',
'RomPatcher.js'
];
@ -1176,7 +1176,7 @@ const ZIPManager = (function (romPatcherWeb) {
const ZIP_MAGIC = '\x50\x4b\x03\x04';
const FILTER_PATCHES = /\.(ips|ups|bps|aps|rup|ppf|mod|ebp|xdelta|vcdiff|bdf|bspatch)$/i;
const FILTER_PATCHES = /\.(ips|ups|bps|aps|rup|ppf|ebp|bdf|bspatch|mod|xdelta|vcdiff)$/i;
//const FILTER_ROMS=/(?<!\.(txt|diz|rtf|docx?|xlsx?|html?|pdf|jpe?g|gif|png|bmp|webp|zip|rar|7z))$/i; //negative lookbehind is not compatible with Safari https://stackoverflow.com/a/51568859
const FILTER_NON_ROMS = /(\.(txt|diz|rtf|docx?|xlsx?|html?|pdf|jpe?g|gif|png|bmp|webp|zip|rar|7z))$/i;

View file

@ -1,4 +1,4 @@
/* Rom Patcher JS v20240302 - Marc Robledo 2016-2024 - http://www.marcrobledo.com/license */
/* Rom Patcher JS v20250922 - Marc Robledo 2016-2025 - http://www.marcrobledo.com/license */
self.importScripts(
'./RomPatcher.js',
@ -11,9 +11,9 @@ self.importScripts(
'./modules/RomPatcher.format.bps.js',
'./modules/RomPatcher.format.rup.js',
'./modules/RomPatcher.format.ppf.js',
'./modules/RomPatcher.format.bdf.js',
'./modules/RomPatcher.format.pmsr.js',
'./modules/RomPatcher.format.vcdiff.js',
'./modules/RomPatcher.format.bdf.js'
'./modules/RomPatcher.format.vcdiff.js'
);

25
test.js
View file

@ -32,6 +32,9 @@
- EBP test
- Patch: https://forum.starmen.net/forum/Community/PKHack/NickBound/page/1#post2333521
- ROM: EarthBound (USA).sfc [CRC32=dc9bb451]
- BDF test
- Patch: https://www.romhacking.net/hacks/5813/
- ROM: Tetris (World) (Rev 1).gb [CRC32=46df91ad]
- xdelta test
- Patch: https://www.romhacking.net/hacks/2871/
- ROM: New Super Mario Bros. (USA, Australia).nds [CRC32=0197576a]
@ -89,7 +92,7 @@ const TEST_PATCHES = [
patchDownload: 'http://ngplus.net/InsaneDifficultyArchive/www.insanedifficulty.com/board/index9837.html?/files/file/65-final-fantasy-tactics-advance-x/',
outputCrc32: 0x49a5539a
}, {
title: 'Tekkaman Blade translation',
title: 'RUP - Tekkaman Blade translation',
romFile: 'Uchuu no Kishi - Tekkaman Blade (Japan).sfc',
romCrc32: 0x7e107c35,
patchFile: 'Tekkaman Blade v1.0.rup',
@ -105,22 +108,22 @@ const TEST_PATCHES = [
patchCrc32: 0x271719e1,
patchDownload: 'https://forum.starmen.net/forum/Community/PKHack/NickBound/page/1#post2333521',
outputCrc32: 0x5065b02f
}, {
title: 'NSMB Hack Domain Infusion',
romFile: 'New Super Mario Bros. (USA, Australia).nds',
romCrc32: 0x0197576a,
patchFile: 'nsmb_infusion10a.xdelta',
patchCrc32: 0xa211f97c,
patchDownload: 'https://www.romhacking.net/hacks/2871/',
outputCrc32: 0x9cecd976
}, {
title: 'Tetris - Rosy Retrospection',
}, {
title: 'BDF - Tetris - Rosy Retrospection',
romFile: 'Tetris (World) (Rev 1).gb',
romCrc32: 0x46df91ad,
patchFile: 'rosy_retrospection.bdf',
patchCrc32: 0xcc61564a,
patchDownload: 'https://www.romhacking.net/hacks/5813/',
outputCrc32: 0x3d400209
}, {
title: 'VCDIFF - NSMB Hack Domain Infusion',
romFile: 'New Super Mario Bros. (USA, Australia).nds',
romCrc32: 0x0197576a,
patchFile: 'nsmb_infusion10a.xdelta',
patchCrc32: 0xa211f97c,
patchDownload: 'https://www.romhacking.net/hacks/2871/',
outputCrc32: 0x9cecd976
}
];