Skip to content

Fix vtable relocation check on Ryujinx#76

Merged
WuBoytH merged 1 commit intoHDR-Development:masterfrom
plyrthn:ryujinx-vtable-fix
Mar 27, 2026
Merged

Fix vtable relocation check on Ryujinx#76
WuBoytH merged 1 commit intoHDR-Development:masterfrom
plyrthn:ryujinx-vtable-fix

Conversation

@plyrthn
Copy link
Copy Markdown
Contributor

@plyrthn plyrthn commented Mar 25, 2026

On Ryujinx, svcQueryMemory reports heap addresses as being inside the module's address range, which causes get_memory_state() to return the wrong result for vtables that have already been relocated to the heap. Any subsequent guard call on an already-relocated vtable would then try to relocate it again. This broke custom moveset NROs on Ryujinx.

Adds a static registry of relocated vtable addresses. Guard functions check this before calling get_memory_state(), so already-relocated vtables always pass the check correctly.

Fixes: #73

@WuBoytH
Copy link
Copy Markdown
Contributor

WuBoytH commented Mar 26, 2026

The pain of switch emulators.

Have you checked to see if this works on console as well?

@plyrthn
Copy link
Copy Markdown
Contributor Author

plyrthn commented Mar 26, 2026

Hahaha very agreed, I'm actually gonna push up another fix for the Tetromino mod too since that's hitting a different crash...

And no I haven't! Don't have a switch capable of it anymore. Would have to rely on yourself, or someone else! I can provide an artifact if that would work?

@WuBoytH
Copy link
Copy Markdown
Contributor

WuBoytH commented Mar 27, 2026

Honestly, it should be fine. I didn't know what .retain() actually did so I thought you were just letting memory pile up for no reason.

@WuBoytH WuBoytH merged commit c24ae5a into HDR-Development:master Mar 27, 2026
@plyrthn plyrthn deleted the ryujinx-vtable-fix branch March 27, 2026 14:27
@plyrthn
Copy link
Copy Markdown
Contributor Author

plyrthn commented Mar 27, 2026

Forgot to reply, yeah it shouldn't cause any issues, thank you! Hoping this means no more nro character issues on emu given those are taking off recently. :)

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.

Smashline has panicked

2 participants