Skip to content

Conversation

ComplexPlane
Copy link
Owner

WIP Practice Mod support for merge-heaps.

merge-heaps is a WIP patch for Workshop Mod which combines SMB2's segmented, adjacent heaps into one continuous heap. This consolidates all unused heap space by the game, making available a large amount of additional space for levels, backgrounds, etc. Apparently it may improve performance in some cases as well - further investigation needed there I suppose.

merge-heaps violates the prior assumption that RELs will be allocated at consistent memory addresses. This has a couple implications:

  • Symbol maps must use REL-relative offsets to properly support dynamic linking against RELs which may be allocated anywhere. Support for this was added to the Ghidra-SuperMonkeyBallTools plugin exporter and elf2rel a while back, and so a new symbol map is included in this PR.
  • Absolute addresses which reference RELs other than mainloop.rel cannot be used. Instead, they are converted from "vanilla" addresses to "relocated" addresses at runtime. This allows vanilla addresses to continue to be used, which are handy for cross-referencing with the vanilla game.

TODO

Currently the game crashes when booting and I'm not sure why.

@ComplexPlane ComplexPlane changed the title Merge Heaps Merge Heaps Support Dec 2, 2023
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.

1 participant