Commit Graph

3881 Commits

Author SHA1 Message Date
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
libretroadmin 60e5858d51 fill_pathname_application_dir - use path_basedir instead of
path_basedir_wrapper
2024-12-18 23:39:24 +01:00
libretroadmin e53fb82066 Sync libretro-common 2024-12-18 23:00:50 +01:00
libretroadmin 6b801333e7 file_path - change function signatures - output char array always
is named 's', and size of it 'len'
2024-12-18 21:43:33 +01:00
Eric Warmenhoven 2650712cb3
Small tweaks to fill_pathname_application_path (#17268) 2024-12-18 11:29:58 -08:00
libretroadmin 4521f6bcb2 Cleanups 2024-12-18 20:15:58 +01:00
Eric Warmenhoven 4351ea3098
apple: fix reinit of gcd task queue (#17262) 2024-12-16 06:00:45 -08:00
zoltanvb 5cfaf09f55
Support for analog L2/R2 values when a DS3 controller is used with PS Vita. (#17261) 2024-12-15 09:24:13 -08:00
Eric Warmenhoven 62c725579a
apple: use gcd for task queue (#17248) 2024-12-11 22:55:46 -08:00
Eric Warmenhoven 6475791e07
iOS: fix reopening a recently-creatd file, and build flag cleanup (#17223) 2024-12-01 10:48:52 -08:00
libretroadmin 2809421d4e Revert "static variables are initialized to '0' automatically as per C rules"
This reverts commit 2a0984b6e4.
2024-11-19 03:03:13 +01:00
libretroadmin 82e4504968 Revert "(pt. 2) static variables are initialized to '0' automatically as per C rules"
This reverts commit 47410df7a3.
2024-11-19 03:03:05 +01:00
libretroadmin 47410df7a3 (pt. 2) static variables are initialized to '0' automatically as per C rules 2024-11-18 15:59:46 +01:00
libretroadmin 2a0984b6e4 static variables are initialized to '0' automatically as per C rules 2024-11-18 15:33:34 +01:00
Eric Warmenhoven 876cc19d49
griffin: include all audio filters (#17177) 2024-11-09 08:44:39 -08:00
LibretroAdmin e45bc853ec
Revert "Pointer confinement support (opt-in) (#17169)" (#17173)
This reverts commit 90ee413a81.
2024-11-07 07:31:47 -08:00
zoltanvb 90ee413a81
Pointer confinement support (opt-in) (#17169)
New environment set call to enable a bit more sensible handling of
absolute pointing devices (pointer and lightgun). With the
confinement enabled, pointing devices will not return neither
-0x8000 nor (0,0), which was anyway dependent on the input driver,
instead they will stay at the extreme edge.
2024-11-06 15:19:08 -08:00
sonninnos 8790178ae2
Win32: Filebrowser 'Show Hidden Files' corrections (#17140) 2024-10-30 17:56:47 -07:00
zoltanvb 66eead3afa
Move cacert.h out of deps/, since it does not belong there. (#17122) 2024-10-26 06:44:45 -07:00
pstef 790deebe42
Silence GCC 14 warning [-Warray-bounds=] (#17110)
* Silence GCC 14 warning [-Warray-bounds=]

GCC reports a couple of warnings like this example:
libretro-common/cdrom/cdrom.c:395:14: warning: array subscript 6 is outside array bounds of 'unsigned char[6]' [-Warray-bounds=]
  395 |       cmd[6] = cmd[3];
      |       ~~~~~~~^~~~~~~~
libretro-common/cdrom/cdrom.c: In function 'cdrom_unlock':
libretro-common/cdrom/cdrom.c:1268:18: note: at offset 6 into object 'cdb' of size 6
 1268 |    unsigned char cdb[] = {0x1E, 0, 0, 0, 0x2, 0};

The static analysis heuristic doesn't consider the fact that the writes to cmd[6] and later only happen under the condition that `if (cmd[0] == 0xBE || cmd[0] == 0xB9)` and that in all of those cases the array passed is wide enough. So this is a false positive.

Nevertheless, there seems to be an easy way to silence the warning without disabling it: just require all arrays passed to be at least 9 bytes long and explicitly set the size of those arrays that have been shorter to 9.

* Work around the requirement of C89

I used a C99 construct, but this is easy to work around
with a run-time check.

* Restore the check for non-null cmd

It was obsoleted in a previous version, but is needed back now.

---------

Co-authored-by: pstef <3462925+pstef@users.noreply.github.com>
2024-10-21 14:45:23 -07:00
Eric Warmenhoven 7ae8597765
macOS: Create App Store build (#17074) 2024-10-04 12:46:51 -07:00
Viačasłaŭ 3019b926c2
Fix typos (#17068) 2024-10-01 17:36:33 -07:00
Eric Warmenhoven b557bc9523
Fixing compiler warnings (#17001) 2024-09-14 13:11:20 -07:00
zoltanvb 39c48f7310
Support RETRO_ENVIRONMENT_GET_FILE_BROWSER_START_DIRECTORY (#17002) 2024-09-14 12:15:27 -07:00
libretroadmin 23bd9686e5 Silence unused variable warnings 2024-09-11 15:48:43 +02:00
Vladimir Serbinenko dd489312ea
Enable chd hashing on libnx (#14034) 2024-09-11 06:29:59 -07:00
Emanuel Haupt 7a0d568f04
Incorporate FreeBSD port patches (#16221)
This commit imports a series of patches from the FreeBSD port of RetroArch to
improve build compatibility and address specific issues encountered in the
FreeBSD environment. These patches, sourced from the FreeBSD Ports collection
(https://cgit.freebsd.org/ports/tree/games/retroarch/files), have been adapted
and tested to ensure they integrate seamlessly with the current build process.
2024-09-10 18:11:40 -07:00
Jay Paul e61b3ae2ba
Sort Remaps by Connected Controller (#16747)
* sort remaps by connected controller if option is enabled

* ensure dir name is valid based on input device name

* Fix comments

* Fix forbidden mixed declarations and code

* fixing build errors

* fix additional build warning/error

* Resolved code review change requests

* Changed strlcat to strlcpy as per recommendation

* Retrigger checks

* Use proper path separator.

* Ensure default value is toggled off.

* Ensure that gamepad device name is valid.
2024-09-10 17:39:35 -07:00
libretroadmin 29f011acef * Inline find_last_slash
* explore_load_icons - fill_pathname_slash is equivalent to usage
of strlen here, no need to call strlen
2024-09-10 16:02:06 +02:00
libretroadmin 046c2375e7 Downsize big char arrays in shader structs - a lot of these get
allocated on the stack so this would cost a lot of memory
2024-09-10 07:03:50 +02:00
libretroadmin f4ed638347 Rewrite libretro-common task_queue, use flags 2024-09-10 02:42:07 +02:00
libretroadmin 7f87a46744 More downsizing of variables 2024-09-09 16:18:32 +02:00
libretroadmin b8391e233f * PATH_MAX_LENGTH redefined from 4096 to 2048
* Massive reduction in heap space allocation, going from settings struct
264kb to 119Kb
* Use NAME_MAX_LENGTH for base paths/names, etc
* Use DIR_MAX_LENGTH for directory sizes
2024-09-09 05:47:32 +02:00
libretroadmin 9efb498bde (config_file) Use flags 2024-09-08 18:12:12 +02:00
Jesse Talavera c0715fc420
Fix incorrect documentation for `retro_audio_sample_batch_t` (#16965)
retro_audio_sample_batch_t returns the number of processed frames, *not* samples.

- See `audio_driver_sample_batch` in `audio_driver.h`
2024-09-07 07:58:52 -07:00
libretroadmin 22f4441cdd C89 buildfix 2024-09-05 17:44:05 +02:00
libretroadmin 0f7a665439 Resync libretro-common 2024-09-05 11:49:08 +02:00
libretroadmin 4b86886d30 (libretro-common) stdstring - get rid of these pointless functions 2024-09-05 11:44:57 +02:00
Jesse Talavera 518d719f38
Fix a build error on iOS (#16903)
- Includes certain newly-required headers
- Makes the use of the `IOS` macro consistent with other platform checks
2024-08-21 12:57:02 -07:00
libretroadmin afc9cb509a CXX_BUILDFIX buildfixes 2024-07-20 19:42:45 +02:00
libretroadmin 60e0dd839a iC comments 2024-07-20 17:54:44 +02:00
Keith Bowes 4683e83d9a
Add support for mbedtls v3 (#16763)
v2 is not going to receive security fixes after 2024

Fixes #16672
2024-07-18 06:25:29 -07:00
libretroadmin 7c6054573e (rhmap) use custom strdup 2024-07-06 00:00:29 +02:00
libretroadmin 57c790646f Buildfix 2024-06-29 03:48:50 +02:00
libretroadmin 47ec7c0782 Try to avoid strdup to avoid portability issues 2024-06-29 03:46:06 +02:00
libretroadmin 40c889b562 Add header include for rhmap.h 2024-06-29 03:25:33 +02:00
Ash Logan 27f337d5a0 (libretro-common) Use inline assembly for PowerPC libco
This puts the code into the binary's .text section, which is needed
for platforms without the ability to map it as RWX (WiiU). Using
GNU/AT&T syntax for the assembly here.
2024-06-25 08:16:52 -05:00
Joseph C. Osborn e51a316cfd tidy up intfstream_truncate ifdefs. 2024-06-18 13:13:59 -05:00
Joseph C. Osborn 42f066a842 add intfstream_truncate for file streams
Will return 0 for non-file streams.  I didn't want to mess around with
memory_stream (which could in theory have a truncate impl that sets
size) because there were globals and stuff and I got nervous (also
truncate might *grow* a file if the new length is longer than the old
one and then I'd have to think about realloc, etc).
2024-06-18 13:13:59 -05:00
libretroadmin c4685e8c31 Cut down on strlcats 2024-06-16 19:15:07 +02:00
libretroadmin e2e6602ac2 Buildfix 2024-06-16 15:39:35 +02:00
libretroadmin 3cdadbef8c (dylib.c) Avoid strlcat usage, camelcase variable name removal
and C comments
2024-06-16 15:10:11 +02:00
libretroadmin c741c9d9a9 Remove unused variables 2024-06-15 16:44:41 +02:00
libretroadmin f574a3a68e (archive_file) Don't know why this won't compile for MSVC -
<compat/posix_string.h> gets included which should redefine strtok_r
for MSVC usage but it just doesn't work and fails at linking stage, will have to figure this out
later
2024-06-15 16:34:19 +02:00
libretroadmin c02d8b8475 Slight change in header include 2024-06-15 16:28:30 +02:00