RomPatcher.js icon indicating copy to clipboard operation
RomPatcher.js copied to clipboard

Support For Multiple Files For Multiple ROM Patches?

Open SamuelBanya opened this issue 1 year ago • 6 comments

Hey there,

Just an idea, any plans for supporting multiple files?

Ex: I provide a single Super Mario World rom and upload multiple patch files for various ROM hacks I want to patch the base game with.

Thanks

SamuelBanya avatar Jan 05 '25 16:01 SamuelBanya

afaik this can be done with zip files only, it would be nice having a builtin option for simple files too.

As alternative, it should be doable via a custom dropbox invoking this method.

eadmaster avatar Mar 12 '25 15:03 eadmaster

@eadmaster

So, would that zip file contain all of the random IPS patches for the base Super Mario World ROM file in that case?

SamuelBanya avatar Mar 12 '25 15:03 SamuelBanya

yep, you must list all the IPS patches inside the zip file via an array like this:

RomPatcherWeb.initialize(myPatcherSettings, {
	file: 'my_patches.zip', //zip containing patches
	patches: [ //information about patches inside the zip
		{
			file: 'my_main_patch.ips', //required
			name: 'My game improvement hack (Base)',
		},
		{
			file: 'my_optional_patch_1.ips',
			name: 'Alternate colors',
			description: 'Check this to change main characters\' colors',
			optional: true
		},
		{
			file: 'my_optional_patch_2.ips',
			name: 'Hard mode',
			description: 'Check this to alter game\'s difficulty',
			optional: true
		},
		/* ... */
	]
});

I'm currently trying to implement the same feature using simple separate files and a custom dropbox, but i guess it requires some rewrite in the main class, because you cannot reinit RomPatcherWeb after the page is loaded.

eadmaster avatar Mar 12 '25 16:03 eadmaster

Interesting! So would the resulting output be a zip file of the IPS patched ROMs in that case?

SamuelBanya avatar Mar 12 '25 17:03 SamuelBanya

No, you always get 1 single output file.

eadmaster avatar Mar 12 '25 18:03 eadmaster

I ran into something similar - saw a bunch of rom hacks I wanted to try. Ended up building a docker solution that takes multiple patches and outputs multiple roms. So a one:many relationship, being one rom and multiple patches. Threw in a pull request: https://github.com/marcrobledo/RomPatcher.js/pull/95

rainthefrog avatar Dec 03 '25 03:12 rainthefrog