Skip to content

Tool: Makes header editor work with archived/soft-patched ROMs.#31

Open
Fiskbit wants to merge 1 commit intomasterfrom
fiskbit-header-editor-save
Open

Tool: Makes header editor work with archived/soft-patched ROMs.#31
Fiskbit wants to merge 1 commit intomasterfrom
fiskbit-header-editor-save

Conversation

@Fiskbit
Copy link
Copy Markdown
Member

@Fiskbit Fiskbit commented Apr 13, 2026

The NES header editor is currently unable to save a ROM if it was loaded from an archive (such as .zip) or if the ROM was soft-patched. This is because the editor reloads the ROM from disk to then apply the new header and save a copy, but the C# compnent is not able to open archives or apply patches. If the ROM file is in an archive, it throws an Unexpected Error and fails.

This change instead makes the editor use the current PRG and CHR ROM. This means it doesn't need to reload the ROM, so it can save it regardless of how it was loaded. It also means that it saves any changes that have been made to the ROM in the session, either by self-flashing or by editing them via tools, which could be seen as a pro or a con. Also, because Mesen does not currently use misc ROM, it is unable to include that in the saved ROM, but this is something we could feasibly add later.

This change was written by Sour.

The NES header editor is currently unable to save a ROM if it was loaded from an archive (such as .zip) or if the ROM was soft-patched. This is because the editor reloads the ROM from disk to then apply the new header and save a copy, but the C# compnent is not able to open archives or apply patches. If the ROM file is in an archive, it throws an Unexpected Error and fails.

This change instead makes the editor use the current PRG and CHR ROM. This means it doesn't need to reload the ROM, so it can save it regardless of how it was loaded. It also means that it saves any changes that have been made to the ROM in the session, either by self-flashing or by editing them via tools, which could be seen as a pro or a con. Also, because Mesen does not currently use misc ROM, it is unable to include that in the saved ROM, but this is something we could feasibly add later.

This change was written by Sour.
Copy link
Copy Markdown

@NovaSquirrel NovaSquirrel left a comment

Choose a reason for hiding this comment

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

Code looks good and the changes worked fine when I tested them

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