Commit Graph

3861 Commits

Author SHA1 Message Date
pstef b25cb6ea63 Use int32_t for x86_cpuid flags and handle MSVC types
Change the flags parameter to int32_t for explicit sizing. Add a check
and cast for MSVC __cpuid compatibility when int is 32-bit.

This silences a -Wincompatible-pointer-types warning where int32_t is
long int.
2025-04-10 21:10:45 +00:00
LibretroAdmin 82d8b9630a
Merge pull request #17750 from BinBashBanana/master 2025-04-10 03:35:45 -07:00
pstef 1f26793fde 3DS: enable mbedTLS 2025-04-06 18:48:10 +00:00
pstef 70aaa0a55c Fix non-griffin build for 3DS and make it the default
While here:
* remove input_overlay and task_overlay from linking blacklist
* move -Werror to CC invocation since C++ refuses to use it
* copy the quiet build mode from the main Makefile and make it the
  default
* temporarily define DEPRECATED for gpu_old.h to allow succesful build
* replace the call to command_event() with one to retroarch_main_quit()
  in a failure case
* add missing uncompr.o in Makefile.common for HAVE_BUILTINZLIB
2025-04-06 18:35:41 +00:00
pstef 3130717626 Don't redefine _SHIFTL and _SHIFTR macros 2025-04-06 00:59:15 +00:00
pstef 71ddadfcfb Fix crash in net_http_resolve() in single-thread mode
Pass the right object to the resolving function
2025-04-02 21:32:11 +00:00
BinBashBanana 05cefc9a4d AudioWorklet driver, misc. emscripten fixes 2025-03-28 19:41:40 -07:00
LibretroAdmin f0aeeb7732
Merge pull request #17734 from pstef/silence-warnings 2025-03-25 21:44:30 -07:00
pstef 052acd4e38 Reorder arguments in calls to calloc
to silence calloc-tran sposed-args warnings.
2025-03-25 20:15:20 +00:00
pstef 50ecf3877c Fix UI freeze when threaded rendering is enabled on 3DS
Before this change, there was at least one scenario in which the UI
would seemingly freeze and a restart was needed. That's when an update
of cores was attempted with threaded rendering enabled.

Fixes https://github.com/libretro/RetroArch/issues/17727
2025-03-25 17:18:29 +00:00
pstef 281dff8956 Silence a stringop-overflow warning
Guard against an unlikely case.
2025-03-25 16:55:39 +00:00
pstef 39495ced67 Silence a type-limits warning
Before this change, an 8-bit value was guaranteed to be lesser than the
size of this array (256). Instead of removing the check, I make it
meaningful by reducing the size of the array.
2025-03-25 16:55:39 +00:00
pstef b85bcb8e48 Adjust types of index and maxindex to unsigned 2025-03-20 16:21:27 +00:00
pstef f7285ff405 Silence warning: left shift of negative value
Import the change from upstream 16c83cd5fc4c18954c1b6e3de16c37ba
2025-03-19 20:09:15 +00:00
pstef a27d49b6f2 Silence GCC stringop-overflow
At optimization level -O3, GCC generates a warning about its own
optimizations, likely due to loop unrolling. Manually unroll the loop to
eliminate any ambiguity and prevent the warning.
2025-03-19 19:57:50 +00:00
pstef fc9f0b04be CTR: Silence a couple of GCC 14 warnings 2025-03-16 01:01:04 +00:00
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 366612fb82 Revert "Fix some string appending"
This reverts commit 65b9ea4e76.
2025-02-11 23:48:12 +01:00
LibretroAdmin 65b9ea4e76 Fix some string appending 2025-02-11 23:08:55 +01:00
Eric Warmenhoven b0999db885
properly initialize variable (#17555) 2025-02-11 16:09:05 +01:00
LibretroAdmin c57c4fbd1a Style nits 2025-02-10 13:59:25 +01:00
LibretroAdmin 72efcab3e7 Silence more warnings 2025-02-09 21:11:35 +01:00
LibretroAdmin 91aa8034b1 Style nits/conventions 2025-02-09 16:43:51 +01:00
LibretroAdmin 0be8fe8e3f Style nits 2025-02-09 16:07:15 +01:00
Rob Loach 7ba205ba34 common: Move audio_mixer_sound user_data to above the types union 2025-01-31 16:29:18 -05:00
Rob Loach 355b277c11
common: Add a user_data pointer to audio_mixer_sound (#17488) 2025-01-31 03:41:07 +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
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