Fixes for improved RPL support
@Exzap agreed upon me reviving his #325 PR with the suggested changes.
To rephrase his PR a bit, this is meant to address two problems that prevents RPLs from being usable:
- LR isn't correctly restored in __rpl_start leading to an endless loop or crash. This PR adds the assembly that was missing.
- The current behavior is that RPLs use wutmalloc, which assumes that MEMGetSizeForMBlockExpHeap can be used to determine the size when reallocating memory. This adds a separate wutmalloc implementation that only RPLs will use, which co-allocates a header alongside memory so that RPLs can now reallocate memory.
I've tested the changes with RPX files that both use the custom heap and override preinit_user to use the wutmalloc implementation. This PR allows Aroma plugins/modules to continue to have access to the regular malloc implementation, while RPLs are now fully functional. After that, follow up PRs can be made to address some of the minor issues that are left to complete the RPL support in wut.
Hi! Just bumping this PR, seems like this would allow for the glsl compiler to be a thing. Trying to find a way to compile some shaders from macos and it's been an adventure.
Wondering what might be needed for this PR to be merged?
Trying to find a way to compile some shaders from macos and it's been an adventure.
For the time being you could use Docker/VM and use the linux binary from the latest CafeGLSL release. Unfortunately it doesn't really solve the ability to dynamically compile shaders, which is what things like retroarch would need. Merging this PR shouldn't have any downsides, but I think that since it's not the full rework that would be required for proper RPL support it just hasn't happened yet. But it would be interesting to hear something official!
Trying to find a way to compile some shaders from macos and it's been an adventure.
For the time being you could use Docker/VM and use the linux binary from the latest CafeGLSL release. Unfortunately it doesn't really solve the ability to dynamically compile shaders, which is what things like retroarch would need. Merging this PR shouldn't have any downsides, but I think that since it's not the full rework that would be required for proper RPL support it just hasn't happened yet. But it would be interesting to hear something official!
Thanks, I completely disregarded the Docker part. Will do. Been banging my head around just to get some textures into some 3d models.
I would love to have this merged because RPL support is useful for making wii u game mods with assembly edits to load the module, in my case Color Splash