Commit Graph

3835 Commits

Author SHA1 Message Date
LibretroAdmin 2782d55aa1
Revert "Workerized emscripten retroarch (WIP) (#17484)"
This reverts commit cacd5a9a23.
2025-01-30 21:35:40 +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
Eric Warmenhoven fd8ba559d7
net_http: fix memleak (#17487) 2025-01-30 04:06:59 +01:00
BinBashBanana ed1810de86
Emscripten improvements (#17422) 2025-01-29 05:29:16 +01:00
Eric Warmenhoven 12f66bebb7
net_http: expire dns lookup failures more quickly (#17481) 2025-01-28 23:27:51 +01:00
Eric Warmenhoven d00ee5a70b
net_http: handle redirects (#17482) 2025-01-28 23:27:28 +01:00
Eric Warmenhoven d2eb49ccbc
net_http refactor (#17460)
* net_http: refactor net_http_new

The goal is to move calls to getaddrinfo() and connect() into
net_http_update(). This will make it possible for them to be replaced
with non-blocking alternatives later.

The net_http calling pattern right now allows callers to create the
http_connection_t, call net_http_new() which creates the http_t from
the http_connection_t, free the http_connection_t, and then start
calling net_http_update(). In order to preserve that, the http_t needs
to copy the values out of the http_connection_t on create. This also
preserves the http_connection_t values instead of freeing them, so the
connection would be able to be used later.

* net_http: implement dns cache

* net_http: separate out address resolution, connect, and request send

* net_http: perform getaddrinfo on separate thread

* net_http: implement basic connection pool

* net_http: refactor receive calls to read faster, do fewer reallocs

* net_http: build fix for platforms without SSL

* net_http: build fix for non-griffin builds

* net_http: build fix for non-threaded platforms
2025-01-23 01:29:47 +01:00
LibretroAdmin b443d9974a Cleanup 2025-01-21 00:17:18 +01:00
LibretroAdmin 1ecd83b0ab Change returntype of random to size_t 2025-01-20 23:59:09 +01:00
sonninnos 391ba55b81
Add playlist random selector (#17441)
* Add playlist random selector

* Buildfix attempt

* ORBIS buildfix attempt
2025-01-20 18:25:41 +01:00
LibretroAdmin a6c8c6c7ef Cleanups 2025-01-19 23:57:15 +01:00
LibretroAdmin 3549d8378c Style nits 2025-01-19 22:15:34 +01:00
LibretroAdmin 984d591573 Silence some warnings 2025-01-18 01:48:33 +01:00
LibretroAdmin b211adaaca Function argument name standardization 2025-01-17 19:55:32 +01:00
LibretroAdmin b47e09534c Less string copies 2025-01-17 13:10:17 +01:00
LibretroAdmin 1e83bfb971 Reduce char arrays 2025-01-17 12:55:45 +01:00
LibretroAdmin 31b7812720 Function argument name standardization 2025-01-17 04:16:12 +01:00
LibretroAdmin a9b0e45013 (glslang_utill.c) One less string copy per iteration 2025-01-17 03:01:59 +01:00
LibretroAdmin 86c9a43b08 Use path_get_extension_mutable 2025-01-16 21:09:19 +01:00
LibretroAdmin a5c9d9520f * Use fill_pathname_basedir where possible
* Move static variable to only function where it's used
* Change signature of file_path.c function
2025-01-15 22:17:59 +01:00
LibretroAdmin b2072dd3be Use strldup where possible, avoid strcpy_literal 2025-01-15 16:36:49 +01:00
LibretroAdmin 9da7af46c3 len variable/argument name standardization 2025-01-15 16:04:25 +01:00
LibretroAdmin 047e04ed3e Standardize local len variable naming conventions 2025-01-15 15:00:12 +01:00
LibretroAdmin 47d888364d Standardize len variables - argument should always be named 'len',
while local len variables should have '_' prefix
2025-01-13 21:53:49 +01:00
LibretroAdmin 3c3611af6f Resync libretro-common 2025-01-13 15:37:59 +01:00
Eric Warmenhoven fcda24be29
Files in archives should always be marked as such (#17390) 2025-01-11 02:51:04 +01:00
LibretroAdmin fc48ecaa1d Local 'len' variables need to prefixed with '_', inner-loop len
variables need to be prefixed with '__'
2025-01-07 02:57:24 +01:00
LibretroAdmin a98ab483cb Restore archive_file_7z.c 2025-01-07 02:22:57 +01:00
Eric Warmenhoven 53d9452439
Change config_get_path/array return back to bool (#17333) 2025-01-02 14:35:33 +01:00
LibretroAdmin 1e656261b0 Local len variables need to have '_' prefix 2024-12-30 14:03:58 +01:00
Viačasłaŭ 945d3ebc5f
Fix memleak (#17307) 2024-12-29 18:57:45 +01:00
LibretroAdmin 4297f02544 Use returntype for fill_pathname_basedir 2024-12-28 23:11:24 +01:00
Eric Warmenhoven ef1b325978
Change return types for some path functions to size_t (#17303) 2024-12-28 22:26:30 +01:00
LibretroAdmin 9d15900979 Small cleanups: * Prevent some unneccessary strlcpy calls and intermediary string copies * Name local length variables for strings '_len', parameter/argument 'len' 2024-12-28 22:22:07 +01:00
LibretroAdmin 18c85b5ccd Cleanups -
* Less string copies
* Some general cleanups
* Add extra param to runloop_message_queue_push so we can pass size_t
of the message
* Consistent conventions for local variable usage for certain things
2024-12-27 15:13:45 +01:00
LibretroAdmin ed58e4a8d8 Conventionalize len variables:
* In function arguments, use 'size_t len'
* Inside the function, use '_len'
* If you need a seciondary len variable inside the function, use '__len'
2024-12-27 05:51:33 +01:00
libretroadmin 51e706007b String handling cleanups 2024-12-25 19:06:04 +01:00
libretroadmin 83a187784a Remove dependency on strlcpy for rjson.c 2024-12-24 21:09:15 +01:00
libretroadmin 8074a833aa Cleanups/less string copies and indirection 2024-12-24 21:07:31 +01:00
libretroadmin 279270ae5f string_list_join_concat_special - specialized version without bounds
check
2024-12-24 06:14:26 +01:00
libretroadmin 02bcbffbab fill_pathname - one less string copy 2024-12-24 00:08:04 +01:00
libretroadmin 2b94bccad2 (fill_pathname_join_delim) - no longer use strlen 2024-12-23 23:42:56 +01:00
libretroadmin cdef3ff9f7 strftime - write directly into string instead of using intermediary copies 2024-12-23 07:10:03 +01:00
libretroadmin 442b9bc3da Syntax style nits 2024-12-23 05:44:40 +01:00
libretroadmin 99c7e08445 Don't use string_trim_whitespace 2024-12-23 00:51:01 +01:00
libretroadmin ca7e53e3ca string_replace_substring - move out implicit strlen 2024-12-23 00:40:09 +01:00
libretroadmin 6b8466f87a menu_driver_set_thumbnail_system/menu_driver_get_thumbnail_system
just small wrapper functions, remove
2024-12-22 04:53:04 +01:00
zoltanvb 072d949346
Pointer handling sanitization - wayland and libretro.h changes (#17277)
Adapt the sanitized pointer handling, discussed at #17196:

Wayland driver specific changes:
- make sure pointer position is always within [-0x7fff,0x7fff]
  by using the confined wrapper
- enable lightgun to report -0x8000 if pointer is really offscreen
- remove extra "inside" checks
- report same pointer/lightgun coordinates for all ports
- simplify pointer and lightgun handling

Other changes:
- unify "offscreen" condition through input_driver.c
- slight tuning of pointer conversion in video_driver.c
- update libretro.h with explanation and pointer offscreen value
- small fixes on remote retropad test screen
2024-12-21 13:28:27 -08:00
libretroadmin c492e46d96 Change function signature of fill_pathname_parent_dir 2024-12-19 20:51:33 +01:00
libretroadmin d94cc3af72 Simplify fill_pathname_application_path 2024-12-19 20:17:09 +01:00