snes9xgit / snes9x

Snes9x - Portable Super Nintendo Entertainment System (TM) emulator
http://www.snes9x.com
Other
2.57k stars 449 forks source link

Emscripten build #695

Open werwolf2303 opened 3 years ago

werwolf2303 commented 3 years ago

Is it possible that there will be an emscripten build at some point?

patrickcorrigan commented 3 years ago

I'm also interested in this

patrickcorrigan commented 3 years ago

It looks like there is an emscripten port of the libretro core

patrickcorrigan commented 3 years ago

Are there build instructions?

ghost commented 2 years ago

For compiling on Ubuntu, I downloaded snes9x source. Then ran these lines:

git clone https://github.com/libretro/RetroArch Retroarch --depth 1 --branch master

git clone https://github.com/emscripten-core/emsdk emsdk --depth 1
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh

cd ../snes9x/libretro

emmake make -f Makefile platform=emscripten
cp *.bc ../../Retroarch/dist-scripts

cd ../../Retroarch/dist-scripts
chmod a+x dist-cores.sh
emmake ./dist-cores.sh emscripten

And I got some files. Retroarch\pkg\emscripten\snes9x_libretro.wasm Retroarch\pkg\emscripten\snes9x_libretro.js

patrickcorrigan commented 2 years ago

@kalita-kan Nice, just tried building there and I get

ports:INFO: retrieving port: zlib from https://github.com/madler/zlib/archive/v1.2.11.zip
make: *** [Makefile.emscripten:121: obj-emscripten/retroarch.o] Error 1
make: *** Waiting for unfinished jobs....
emcc: error: Unexpected hash: 9ec7c573fac2cd4d6ba64dd4dfd7330f317be75367575013da4004d7da7ff51b70b85783dc8533df081e70527135cdbf2ffc12b40f2d011fd7fbe6cb52d2f47d
If you are updating the port, please update the hash.

What version of emscripten are you using?

eliot-akira commented 2 weeks ago

Here's a working WASM fork of libretro/snes9x2005 that I found: snes9x2005-wasm (built files and demo).