Skip to content

Fix WASM libretro core build failing at runtime - #2983

Open
Ferk wants to merge 1 commit into
nesbox:mainfrom
Ferk:wasmfix
Open

Fix WASM libretro core build failing at runtime#2983
Ferk wants to merge 1 commit into
nesbox:mainfrom
Ferk:wasmfix

Conversation

@Ferk

@Ferk Ferk commented Aug 21, 2026

Copy link
Copy Markdown

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 as u64 callback().

Wasm indirect calls are type-checked at runtime, so the mismatch traps with indirect call signature mismatch.

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.
@joshgoebel

Copy link
Copy Markdown
Collaborator

Did this break somewhere along the way or has it neverr worked?

@Ferk

Ferk commented Aug 30, 2026

Copy link
Copy Markdown
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.

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.

2 participants