Hardware Memory Limits#6609
Draft
unreference wants to merge 56 commits into
Draft
Conversation
This was referenced May 11, 2026
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.
Part 3/3 of Hardware Memory Limits, blocked on OTRExporter #47. Requires a compatible OTR generated with the updated OTRExporter to test.
SoH uses larger structs and a doubled THA budget which eliminates the pressure needed for heap manipulation glitches such as unloading Darunia's statue in Goron City, unloading the Royal Family's tomb in Graveyard, and unloading the barrier in Ganon's Castle. This feature aims to restore those glitches by emulating the original hardware memory constraints. A shadow heap mirrors every ZeldaArena allocation at original platform sizes.
ZELDA_ARENA_MALLOCis mirrored into a shadow arena at original struct sizes, extracted from the ROM's overlay tables.I tested the three heap manipulations mentioned above on NTSC 1.0, NTSC 1.1, NTSC 1.2, PAL 1.1, and PAL GC Debug. I cross-referenced allocations to verify the arena emulation. In all instances tested, they all lined up with how it would perform on hardware.
Unrelated fix: Old format saves with a randomizer section but no sohStats crash on JSON deserialization after the randomizer data is erased. Addressed by guarding the access with
contains()checks and falling back to zeroed version info. The bug exists in upstream and is included here because it blocks testing.