Skip to content

Added multi character patching#10

Open
obeyandre wants to merge 3 commits intobenoitryder:masterfrom
obeyandre:rompatcher
Open

Added multi character patching#10
obeyandre wants to merge 3 commits intobenoitryder:masterfrom
obeyandre:rompatcher

Conversation

@obeyandre
Copy link
Contributor

Allows the user to patch any or all character slots at the same time, generate mod.json to build a ROM, and/or patch a loaded ROM (supporting both offline and online ROM versions).

It no longer goes by the currently loaded character and a slot number input, which required the user to guess the slot that will be compatible. The user selects which characters they want to patch based on defaults loaded from the config.json, or any they have imported or saved.

@obeyandre
Copy link
Contributor Author

KNOWN_ROM itn6my is the standalone Super_Tilt_Bro_(E).nes version 2.5 ROM from the downloads page. It is the first download option and it is not bundled with the enhanced fceux, so the Online game mode is disabled. Offline only mods use a different offset for the mod banks.

Copy link
Owner

@benoitryder benoitryder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating your proposal will probably take some time. I'll continue working on it in later days.
Cosmetic changes in code aside, I want to make some changes to avoid harcoding the character names, define a dedicated component for character preview, few cosmetic/UI changes, ...

I have left few questions for things that I don't understand in your proposal.

this.patcher.constructor.patchCharacterData(patchedData, this.characterSlot, this.tree);
for(i=0; i<this.characterSlots.length; i++) {
if(this.characterSlots[i] && this.characterSlots[i].data) {
const slot = isOnline ? i : i-4;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the -4? Where it comes from and why it's needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the RomPatcher class, there is a static property:
static FIRST_MOD_BANK = 0x4 + 0x11;
This property is used to when patching a ROM, but it only matches Online Enabled ROMs. Offline only ROMs would have the value:
static FIRST_MOD_BANK = 0x0 + 0x11;

The -4 corrects for the Offline only ROM, otherwise you would get a corrupted ROM as output.

<span v-if="romError" style="color: red">{{ romError }}</span>
<span v-else-if="romData">A ROM is loaded ({{ romName }})</span>
<span v-else-if="romData">A ROM is loaded ({{ romName }})
[<input type="checkbox" v-model="this.romIsOnlineEnabled" style="width: 11px; height: 11px"/> Online Enabled?]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the "online enabled" information relevant here? It seems needed internally, but does it change something for the user who wants to patch a ROM?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is relevant. There are only two KNOWN_ROMS listed from the version 2.5 release, so you could disable the checkbox or hide for those since you already know how to patch them correctly.

If the user uploads a ROM not in that list, it assumes it is Online Enabled. If that is not the case, the user needs to be able to swap to correct the patching process to get a proper ROM output.

Other logic to Identify the type of ROM automatically would be preferable.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling or hiding the checkbox if the type is known seems a good idea. This could avoid errors/mistakes will still allowing to patch a custom ROM for users who know what they are doing.

@obeyandre
Copy link
Contributor Author

stbdownload

If you download the game, this is the breakdown for the ROM types. The Offline ROM is the first choice and is for general use in any emulator. The Online ROM is packaged with a rainbow mapper enabled fork of FCEUX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants