Commit Graph

52 Commits

Author SHA1 Message Date
Joe Osborn 56014a27d6
Enable pthreads on Emscripten (#17586)
* workerized RA

* Workerized (non-async) web player, using OPFS

This patch eliminates the need for asyncify and uses modern filesystem
APIs instead of the deprecated, unmaintained BrowserFS.

This is a WIP patch because it won't fully work until these two
Emscripten PRs land and are released:

https://github.com/emscripten-core/emscripten/pull/23518
https://github.com/emscripten-core/emscripten/pull/23021

The former fixes an offscreen canvas context recreation bug, and the
latter adds an equivalent to BrowserFS's XHR filesystem (but without
the hazardous running-XHR-on-the-main-thread problem).

The biggest issue is that local storage of users who were using the
old version of the webplayer will be gone when they switch to the new
webplayer.  I don't have a good story for converting the old BrowserFS
IDBFS contents into the new OPFS filesystem (the move is worth doing
because OPFS supports seeking and reading only bits of a file, and
because BrowserFS is dead).

I've kept around the old libretro webplayer under
pkg/emscripten/libretro-classic, and with these make flags you can
build a non-workerized RA that uses asyncify to sleep as before:

make -f Makefile.emscripten libretro=$CORE HAVE_WORKER=0 HAVE_WASMFS=0 PTHREAD=0 HAVE_AL=1

I also moved the default directory for core content on emscripten to
not be a subdirectory of the local filesystem mount, because it's
confusing to have a subdirectory that's lazily fetched and not
mirrored to the local storage.  I think it won't impact existing users
of the classic web player because they already have a retroarch.cfg in
place.

* Get fetchfs working without manifest support

* makefile fixes

* fix scaling, remove zip dependency

* Support asset/cheats/etc downloaders for emscripten

- Add http transfer support for emscripten
  - At the task_http level, not the net_http level --- so no netplay
    or webdav.
- Change default paths to be more like other platforms
- Gives us smaller bundles and a faster boot time
- Had to work around a task queue bug on Emscripten
  - I made the smallest possible change to do it, but it may be better
    to fix in rthread.c

* Load an emscripten file_packager package on first run

If no ozone assets are present, load a libretro_minimal package
created using Emscripten's built-in file packager.

* updated readme, removed indexer from wasmfs libretro-web

* Put back zip dependency, load asset bundle into opfs on first run

* fix upload path

* Remove unused function

* easy testing setup for two multithreaded conditions

1. make PROXY_TO_PTHREAD=1 (slower)
2. make PROXY_TO_PTHREAD=0 (bad audio, because doesn't sleep in
openal.c)

* Remove condition on sleep in openal

also make input_driver check existence of drv->axis, drv->button
before calling them.

* Fix resizing under EGL

* Don't force config file path on emscripten

* Add time.h include to netplay, default HAVE_NETPLAYDISCOVERY to 0

* Remove nearly all proxied joypad calls under emscripten

* Fix file uploads under firefox

* Fix safari API uses, but Safari still hangs in OPFS filesystem mount

I think this can be fixed by moving the backend creation off the main
thread.

* Move filesystem init into emscripten C entry point

* Setup filesystems off of main thread

* re-set default player to async

Also improve Safari compatibility under proxy-to-pthread condition

* Safari upload file fixes

* Remove some excess prints

* Fix typo
2025-02-20 00:59:25 +01:00
LibretroAdmin 2870a0a8ad
Revert "Workerized emscripten retroarch (WIP) (#17484)" (#17492)
This reverts commit cacd5a9a23.
2025-01-30 21:35:58 +01:00
Joe Osborn cacd5a9a23
Workerized emscripten retroarch (WIP) (#17484)
* workerized RA

* Workerized (non-async) web player, using OPFS

This patch eliminates the need for asyncify and uses modern filesystem
APIs instead of the deprecated, unmaintained BrowserFS.

This is a WIP patch because it won't fully work until these two
Emscripten PRs land and are released:

https://github.com/emscripten-core/emscripten/pull/23518
https://github.com/emscripten-core/emscripten/pull/23021

The former fixes an offscreen canvas context recreation bug, and the
latter adds an equivalent to BrowserFS's XHR filesystem (but without
the hazardous running-XHR-on-the-main-thread problem).

The biggest issue is that local storage of users who were using the
old version of the webplayer will be gone when they switch to the new
webplayer.  I don't have a good story for converting the old BrowserFS
IDBFS contents into the new OPFS filesystem (the move is worth doing
because OPFS supports seeking and reading only bits of a file, and
because BrowserFS is dead).

I've kept around the old libretro webplayer under
pkg/emscripten/libretro-classic, and with these make flags you can
build a non-workerized RA that uses asyncify to sleep as before:

make -f Makefile.emscripten libretro=$CORE HAVE_WORKER=0 HAVE_WASMFS=0 PTHREAD=0 HAVE_AL=1

I also moved the default directory for core content on emscripten to
not be a subdirectory of the local filesystem mount, because it's
confusing to have a subdirectory that's lazily fetched and not
mirrored to the local storage.  I think it won't impact existing users
of the classic web player because they already have a retroarch.cfg in
place.

* Get fetchfs working without manifest support

* makefile fixes
2025-01-30 19:58:18 +01:00
BinBashBanana ed1810de86
Emscripten improvements (#17422) 2025-01-29 05:29:16 +01:00
zoltanvb e71a1620b0
Update core list based on what is compiled for 1.20.0 stable version. (#17404) 2025-01-12 17:34:01 +01:00
Dionoid c04bbd6d65
Added M2000 to core selection dropdown (#16479) 2024-04-29 18:29:39 -07:00
Joe Osborn 0f4166a59f
Use ZipFS for web player asset bundle (#15924)
* wip

* fix mount path

* Fix path for zip bundle

* fix case where idbfs sets up correctly and filesystem initializes too early

* Use partfiles to keep each zip small

* use bufferview slices instead of resize to support firefox
2023-11-17 11:25:45 -08:00
LibretroAdmin 6378a3aea2
Update index.html (Emscripten) - Remove banner 2023-07-17 15:46:22 +02:00
Vladimir Serbinenko 96ddb301b6 Fix x1 name in emscripten 2022-03-16 18:08:20 +01:00
Vladimir Serbinenko 4d2178fafc Add missing emscripten cores 2022-03-15 17:44:00 +01:00
Philippe Simons 8a8c2da042
emscripten: add jumpnbump core (#13720) 2022-03-09 15:31:31 +01:00
Vladimir Serbinenko 2c289a6212
Add FreeChaf to emscripten (#13529) 2022-01-24 16:30:35 +01:00
Vladimir Serbinenko c9a72fadab
EMSCRIPTEN: Add wasm4 and jaxe (#13483) 2022-01-12 22:35:10 +01:00
mahoneyt944 647e39afaa
add mame2003 / mame2003-plus 2021-07-04 18:23:38 -04:00
Jean-André Santoni 56e40e8204 Add lutro to web.libretro.com 2021-05-02 13:04:20 +07:00
Autechre 7450f049e7
Update index.html 2021-01-09 17:05:35 +01:00
twinaphex 1c9f60f98d (Emscripten) Add Mr.Boom 2020-08-02 22:25:55 +02:00
Toad King 14c67fde7f emscripten: recreate input event listeners properly
There's a new (undocumented -_-) API for removing event listeners in emscripten
now, so use that when recreating input listeners. Fixes mouse events breaking
when loading cores.
2020-01-18 12:51:21 -06:00
Toad King 776568a429 fix images not loading in menu in emscripten
add changes to work with latest emscripten SDK
2020-01-02 21:29:25 -06:00
Toad King 15e8be4074 changes to support upgraded emscripten SDK 2019-12-14 20:24:41 -06:00
Ömercan Kömür 0420d7f06c Update index.html (#9329) 2019-08-19 16:28:22 +02:00
Ömercan Kömür b314ea8632 Update index.html 2019-08-19 01:23:59 +03:00
Ömercan Kömür d487dd8d08
Revert "Steps for web.libretro" 2019-08-18 22:53:55 +03:00
Ömercan Kömür 1bde4043a5 Steps for web.libretro 2019-08-17 19:25:18 +03:00
Stephanie Gawroriski ca4fa56929
Add SquirrelJME to the live web core list. 2019-06-29 12:25:41 -04:00
twinaphex 36575e5d69 Update emscripten 2019-06-08 16:01:39 +02:00
meepingsnesroms 1b1dac7f40 Add Mu to Web Player 2018-11-10 07:10:01 -08:00
Zlika 6a93ad0dce Add Theodore core to emscripten 2018-11-10 14:45:20 +01:00
Rob Loach 2ff87fd663
emscripten: Add ChaiLove selection to web player 2018-09-14 09:39:20 -04:00
Toad King bd9e70f70e fix top bar not appearing in phone browsers 2018-01-18 22:57:46 -06:00
Toad King 78a3d0f828 Merge branch 'master' into more-emscripten-fixes 2018-01-15 04:09:26 -06:00
Toad King db152fede8 remove container with uneeded padding. fixes canvas being off-center in smaller windows 2018-01-14 23:45:54 -06:00
Rob Loach 443262a9cd
emscripten: Allow hiding the top menu 2018-01-14 23:57:53 -05:00
radius 346d9480f7 remove dropbox 2018-01-14 22:31:30 -05:00
Toad King 2df70cce17 make retroarch logs log to web console instead of textbox 2018-01-14 21:18:30 -06:00
Toad King a682ccd8e8 fix menu button 2018-01-14 21:02:59 -06:00
Toad King 161d758b33 don't apply class that has padding to canvas 2018-01-13 00:46:31 -06:00
Andrés a15820f86a
Update index.html 2017-12-08 10:25:00 -05:00
radius 3310939983 update icons 2017-08-09 13:04:56 -05:00
twinaphex 26fe408bb4 (Emscripten) Add button 2016-12-10 22:01:40 +01:00
Rob Loach d386f63525
[Emscripten] Add Tooltips to the buttons 2016-12-03 11:44:26 -05:00
twinaphex cb8aca97f5 (Emscripten) Add Reicast button 2016-10-10 22:42:44 +02:00
radius 4dcd08c574 (ems) useless CDN is useless 2016-09-29 08:54:50 -05:00
radius 4e33f25328 (ems) useless CDN is useless 2016-09-29 08:49:31 -05:00
Logan McNaughton 133a7bdb14 These are (pretty much) alphabetical
Makes it a little easier to find it if you don't know where they are.

Also, maybe consider only listing the cores that actually work with the Web Player? (I'm not sure which ones that is)
2016-09-24 16:52:48 -06:00
Andrés Suárez 32017c3cae Update index.html 2016-09-21 15:37:52 -05:00
radius be6bce0eb0 (ems) template fixes 2016-09-17 16:58:34 -05:00
radius 29e354a3c6 (ems) template cleanups 2016-09-17 15:13:47 -05:00
radius 64b802b47a (ems) add to the other templates too 2016-09-17 12:37:42 -05:00
radius 356c17678e (ems) add button to clean local storage 2016-09-17 12:37:42 -05:00