Fix WASM libretro core build failing at runtime - #2983
Open
Ferk wants to merge 1 commit into
Open
Conversation
TIC-80’s API expects callbacks shaped like u64 callback(void*), but the libretro wrapper defined those callbacks as u64 callback(). Wasm indirect calls are type-checked at runtime, so the mismatch traps with indirect call signature mismatch.
Collaborator
|
Did this break somewhere along the way or has it neverr worked? |
Author
|
It probably never worked for this specific edge case, it's only a problem for the WASM build of the libretro core but I expect most people use a retroarch native build, not the Retroarch Web Player (where the same problem is also reproducible), and the error only happened at runtime so you have to actually test it to notice it... I stumbled into it because I'm experimenting with a web player for libretro myself and I wanted to include the TIC-80 core. |
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.
I had to make this change to get the TIC-80 wasm build for libretro to load games successfully, otherwise it fails at runtime.
TIC-80’s API expects callbacks shaped like
u64 callback(void*), but the libretro wrapper defined those callbacks asu64 callback().Wasm indirect calls are type-checked at runtime, so the mismatch traps with indirect call signature mismatch.