mupen64plus-libretro-nx
mupen64plus-libretro-nx copied to clipboard
Add emscripten support built against patched 2.0.34 emsdk
This is an update of toadkings PR here and I cannot take credit for these changes https://github.com/BinBashBanana using toadkings old PR got this all working: https://github.com/libretro/mupen64plus-libretro-nx/pull/132
This needs to be built against a specific version of emscripten that has webgl patched.
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 2.0.34
./emsdk activate 2.0.34
wget https://raw.githubusercontent.com/BinBashBanana/webretro/master/source/patches/emscripten.patch
patch -u -p0 -i emscripten.patch
source emsdk_env.sh
On the retroarch side should be built without ASYNC flagged as is currently defined here: (can be deleted) https://github.com/libretro/RetroArch/blob/master/Makefile.emscripten#L61C1-L63C6
And with the additional flags:
-s TOTAL_STACK=268435456 -s TOTAL_MEMORY=536870912 -s FULL_ES3=1 -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2
The results are very good even on a low end client machine:
https://github.com/libretro/mupen64plus-libretro-nx/assets/1852688/a0feb40d-acba-4281-a887-cb7cdcfc0c2f
I can rewrite the guards Retroarch side as well but having a viable bc file is the first step.
Let me know if this is possible to mainline I do not have a deep enough understanding of the codebase to see if there are any breaking changes for other ports here, but most of it looks non obtrusive with guards.
I need to check whatever i merged to my main branches already, most things still reside in emscripten_testing branch iirc
Gonna start on this soon
Rebased & Backported some changes onto emscripten_testing branch
Am I reading this correct that you are working on dynarec in emscripten? That is one of the biggest pain points of nearly every core, the SIMD extensions lacking. Hoping for a breakthrough.
Am I reading this correct that you are working on dynarec in emscripten? That is one of the biggest pain points of nearly every core, the SIMD extensions lacking. Hoping for a breakthrough.
Ahead of time tho, I implemented it through cached interpreter for now so i can compile in parts of the game into the core directly.
Also SIMD seems to work decently with this
-msimd128 -ftree-vectorize -mfpu=neon
This is progressing quite well, still too many changes to push it all but thought i give a small update
Hi, i don't know if this is the right place. But i thought i try it and ask. How does it look? It would be really cool to have this core also as emscrpten port :)! Thank you!
Hi, i don't know if this is the right place. But i thought i try it and ask. How does it look? It would be really cool to have this core also as emscrpten port :)! Thank you!
Its looking good, working on getting it on the last toolchain ver next