Open ethanaobrien opened 9 months ago
Emscripten isn't a platform that the project (or at least I) care about, you're on your own. I'll leave the issue open, though.
@hrydgard Just curious do you have any interest in or knowledge of ways to get this running on web?
No interest
Fair enough.
Platform
libretro / Retroarch
Compiler and build tool versions
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.53 (ce5114bdd2175c7297583d3c25a53ca95d22f4ce)
Operating system version
Debian GNU/Linux bookworm 12.0 x86_64
Build commands used
Using the patches mentioned here for sub modules, and this commit, disabling
GLES
, then linking with RetroArch using gles2 causes PPSSPP to run almost flawlessly.As far as I can tell the emulation itself runs perfectly, playable* as long as you don't need video. Much better than it was a few months ago when I originally tried getting it to run.
And here's the fun part, of course compiling without GLES and targeting gles2 wont work, that was just to get it to run at all. Currently, if you build with
GLES
enabled (specifically if you pass theUSING_GLES2
definition) the page will freeze upon load. I traced the freeze here where it seems to be waiting on another thread. This only happens whenGLES
is enabled, with it disabled the emulation runs as well as the browser can handle it, which is suspiring.To build this:
git clone https://github.com/EmulatorJS/ppsspp.git
git clone https://github.com/EmulatorJS/RetroArch.git
git clone https://github.com/EmulatorJS/EmulatorJS.git
cd ppsspp/libretro/
emmake make clean && emmake make platform=emscripten -j$(nproc)
cp ppsspp_libretro_emscripten.bc ../../RetroArch/dist-scripts/
cd ../../RetroArch/dist-scripts/
emmake ./dist-cores.sh emscripten clean
EmulatorJS/data/cores/
and open the .data file with 7zip, open the.js
file (not.worker.js
( in a text editor and search forasyncifyStubs
. Remove any definitions of this. This errors because of a bug with emscripten where its defined but does not do anything. Removing this definition will fix the issue.EmulatorJS/data/cores
folderEmulatorJS
folder. Be sure to set the headers mentioned herepsp
.Through writing this (40-50 minutes) I've had ppsspp running in the browser with gles disabled (no video) and have had no crashes nor performance decreases (playing the title menu music). The only issue with the emscripten build target is gles.
A demo with gles disabled can be found here.
What happens
gles disabled log (working emulation, black screen): gles--disabled.log
gles enabled log (freezes page): gles-enabled.log
PPSSPP version affected
v1.17.1-11-gb41753896
Last working version
No response
Checklist
git submodule update --init --recursive
before building.