Add external-flash offset support (Mario); deny it for Zelda#381
Open
slash-proc wants to merge 1 commit into
Open
Add external-flash offset support (Mario); deny it for Zelda#381slash-proc wants to merge 1 commit into
slash-proc wants to merge 1 commit into
Conversation
A new `ext_offset` flag relocates the patched Mario firmware's external data from the 0x90000000 base to 0x90000000 + ext_offset, so the OFW can coexist with other data (e.g. a second OFW) on a large SPI flash. * _patch.py: `ext_offset` flag on `mario` (int_parser converter; offset bounds are validated downstream by gnw.flash). * firmware.py / patch.py: the relocation lookup shifts external-flash destinations by a per-firmware `_offset` (set on self.external in __call__); both move/copy paths use FLASH_BASE + _offset. * mario.py: repoint the memory-mapped read base, grow the OCTOSPI device size to span the offset, and offset the NVRAM save address. That last part is required for correctness: without it the save targets the un-offset 0xfe000+ext_offset (e.g. 0xd9000), which lands in the other console's external region and corrupts it. Zelda cannot support this. It has no relocatable base register and reaches its external data through absolute pointers, so its data is fixed at 0x90000000. The `zelda` command accepts `ext_offset` for parity but rejects any nonzero value with a clear ValueError.
67a3102 to
54c7107
Compare
Contributor
Author
|
hmm... I tried to get my branch up-to-date with upstream/main and I didn't realize it would affect this PR. I'm not sure what to do since the pre-commit.ci - pr check failed (not sure what it's saying failed). just let me know if there's something I need to fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new
ext_offsetflag relocates the patched Mario firmware's external data from the 0x90000000 base to 0x90000000 + ext_offset, so the OFW can coexist with other data (e.g. a second OFW) on a large SPI flash.ext_offsetflag onmario(int_parser converter; offset bounds are validated downstream by gnw.flash)._offset(set on self.external in call); both move/copy paths use FLASH_BASE + _offset.Zelda cannot support this. It has no relocatable base register and reaches its external data through absolute pointers, so its data is fixed at 0x90000000. The
zeldacommand acceptsext_offsetfor parity but rejects any nonzero value with a clear ValueError.