1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-03 08:48:42 +00:00
Commit Graph

605 Commits

Author SHA1 Message Date
libretroadmin
850f1ff6f7 Put comment back 2024-06-16 16:56:19 +02:00
libretroadmin
4eb8b772ec (task_content.c) content_file_override_set - use strtok_r instead
of string_list
2024-06-16 16:54:57 +02:00
Eric Warmenhoven
7379d33801
tvOS Top Shelf (#16302)
This puts the History and Favorites playlists (up to five items each)
in the Top Shelf menu. In order for this to be enabled you must build
it yourself and change the app identifiers for the TV app and Top
Shelf extension, and add both of them to an app group.
2024-02-27 23:20:32 -08:00
Jesse Talavera-Greenberg
cbf49a0b77
XDelta patch support (Take 2) (#15915)
* Add xdelta in deps

* Include <assert.h> in xdelta3.h

- Otherwise the static_assert calls can fail

* Build xdelta3 in Makefile.common

* Add xdelta support to the softpatching infrastructure

- The patching itself isn't fully implemented yet

* Adjust how xdelta3.h checks the sizes of some types

- Now checks max values instead of relying on autotools

* Add some enums that were excluded by the cherry-pick

* Remove stray whitespace

* Adjust SIZE macros in xdelta3.h

- Move them outside the XD3_USE_LARGEFILE64 block
- Add more SIZE declarations
- Make SIZEOF_UNSIGNED_LONG_LONG contingent on the presence of ULLONG_MAX

* Reintegrate xdelta support

* Enable support for xdelta's secondary compressors

- Necessary for some patches

* Fix some format specifiers

* Remove unnecessary files from xdelta

* Include xdelta3.h with a relative path

* Add xdelta3 headers to HEADERS variable

* Gate Xdelta support behind HAVE_XDELTA

- HAVE_XDELTA is on by default
- HAVE_PATCH is still required for HAVE_XDELTA to be meaningful
- Support is mostly contingent on the availability of LZMA
- Anything modern should be okay
- Legacy platforms (e.g. DOS) may need to have Xdelta support disabled
- At least until some other solution can be found

* Disable HAVE_XDELTA on platforms where the build recently failed

- These come from looking at the failed builds on GitHub
- These are guesses, and may turn out to be wrong

* Fix a potential memory leak

- Whoops, looks like I need to call two cleanup functions
- xd3_close_stream exists separately from xd3_free_stream

* Split the --help printout for --xdelta into its own strlcat call

- GCC was complaining about #ifdefs within macro arguments being non-portable

* Fix some incorrect printf format specifiers

* Modify Xdelta to adhere to C89

- It's mostly using RetroArch's INLINE macro instead of the inline keyword

* Slight cleanups

* Remove a stray comma that was hindering C89 builds

* Add XDelta support to CHANGES.md

* Change how the xdelta patch's name is computed

- To be in line with other recent refactoring

* Fix an incorrect merge

- Whoops, this part was from before I figured out how to get the size of a patched file

* Explain the song-and-dance behind computing a patched file's size

* Define some XDelta3-related constants to 0 on 32-bit platforms

* Adjust some Xdelta-related macro definitions

- Exclude the encoder, since we're not making patches
- Move some #defines to after inclusion of <stdint.h>, to fix undefined behavior
- Remove _WIN32_WINNT overrides, since they were for code that we're not using

* Fix Xdelta support

* Wrap an encoder-only function in `#if XD3_ENCODER`
2023-11-23 20:19:07 -08:00
libretroadmin
cd8fffe5d3 Rename all local variables for retro_system_info to sysinfo 2023-07-15 07:45:20 +02:00
libretroadmin
cf0d0e93a6 rarch_system_info_t local vars should be renamed from 'system'
to 'sys_info' to avoid false positive code analysis errors
2023-07-15 07:22:38 +02:00
libretroadmin
d514f1ded3 Avoid false positives with code analysis tools - rename
variables called 'system'
2023-07-05 03:29:49 +02:00
Bernhard Schelling
2c9bc8d850 Fix "variable set but not used" when HAVE_PATCH is not defined 2023-06-19 18:18:01 +02:00
libretroadmin
edecf0cb2d Replace more strlcat calls with strlcpy 2023-06-18 19:25:24 +02:00
libretroadmin
631301b3f7 * Cut down on strlcat calls when possible and replace them with clever
usage of strlcpy (when position/offset of previous strlcpy/snprintf call
is known. strlcat implementation in libretro-common makes implicit strlen
call, using strlcpy avoids this
* Reduce a bunch of local char variables by use of said clever usage,
should save up on local stack size usage
2023-06-18 12:06:12 +02:00
libretroadmin
3871ac4455 * Add FIXME LOCALIZE notes
* Some snprintf optimizations
2023-04-30 17:26:57 +02:00
libretroadmin
61c986ddfa Buildfix 2023-01-22 21:44:39 +01:00
libretroadmin
e798f99fea Several RARCH_CTL switches don't belong to retroarch state but
runloop state, hence remove
2023-01-22 20:16:14 +01:00
libretroadmin
378e90e745 retroarch.h functions should be namespaced 'retroarch_' instead
of 'rarch_'
2023-01-22 16:58:22 +01:00
sonninnos
127c676048
Cleanup runloop_environment logging + readability (#14855) 2023-01-16 01:49:25 +01:00
libretroadmin
daa9e352cc Remove asserts 2023-01-09 00:51:05 +01:00
libretroadmin
3277d7b8fa (Emscripten) Add HAVE_PATCH support for Emscripten
(Patch) if HAVE_PATCH is not defined, silence warnings
2023-01-07 05:15:36 +01:00
libretroadmin
5ac8cc0b6a * Rename retroarch_path_set_redirect to runloop_path_set_redirect
* move more retroarch path functions to runloop.c - because they
are related to the runloop state instead of retroarch state
2023-01-06 21:21:31 +01:00
LibretroAdmin
f5133d8cc4
Revert "Add Xdelta support for softpatching (#14706)" (#14743)
This reverts commit aaad220836.
2022-12-19 03:29:46 +01:00
Jesse Talavera-Greenberg
aaad220836
Add Xdelta support for softpatching (#14706)
* Add xdelta in deps

* Include <assert.h> in xdelta3.h

- Otherwise the static_assert calls can fail

* Build xdelta3 in Makefile.common

* Add xdelta support to the softpatching infrastructure

- The patching itself isn't fully implemented yet

* Adjust how xdelta3.h checks the sizes of some types

- Now checks max values instead of relying on autotools

* First crack at xdelta softpatching support

- There may be undiscovered edge cases or bugs

* Add xdelta in deps

* Include <assert.h> in xdelta3.h

- Otherwise the static_assert calls can fail

* Build xdelta3 in Makefile.common

* Add xdelta support to the softpatching infrastructure

- The patching itself isn't fully implemented yet

* Adjust how xdelta3.h checks the sizes of some types

- Now checks max values instead of relying on autotools

* First crack at xdelta softpatching support

- There may be undiscovered edge cases or bugs

* Remove trailing commas from the enums I modified

- C89 doesn't allow them

* Remove stray whitespace

* Adjust SIZE macros in xdelta3.h

- Move them outside the XD3_USE_LARGEFILE64 block
- Add more SIZE declarations
- Make SIZEOF_UNSIGNED_LONG_LONG contingent on the presence of ULLONG_MAX

* Add some RARCH_DBG calls for xdelta patching

* Enable support for xdelta's secondary compressors

- Necessary for some patches

* Fix some format specifiers

* Remove unnecessary files from xdelta

* Include xdelta3.h with a relative path

* Add xdelta3 headers to HEADERS variable

* Gate Xdelta support behind HAVE_XDELTA

- HAVE_XDELTA is on by default
- HAVE_PATCH is still required for HAVE_XDELTA to be meaningful
- Support is mostly contingent on the availability of LZMA
- Anything modern should be okay
- Legacy platforms (e.g. DOS) may need to have Xdelta support disabled
- At least until some other solution can be found

* Disable HAVE_XDELTA on platforms where the build recently failed

- These come from looking at the failed builds on GitHub
- These are guesses, and may turn out to be wrong

* Fix a potential memory leak

- Whoops, looks like I need to call two cleanup functions
- xd3_close_stream exists separately from xd3_free_stream

* Split the --help printout for --xdelta into its own strlcat call

- GCC was complaining about #ifdefs within macro arguments being non-portable

* Fix some incorrect printf format specifiers

* Modify Xdelta to adhere to C89

- It's mostly using RetroArch's INLINE macro instead of the inline keyword
2022-12-19 01:10:04 +01:00
libretroadmin
2c42912185 More header cleanups 2022-12-05 15:15:07 +01:00
sonninnos
10a74657c3
Move SRAM init to content init (#14653) 2022-11-21 15:24:58 +01:00
LibretroAdmin
44cb5be2ef (task_content.c) Cut down on code duplication 2022-10-25 16:32:16 +02:00
sonninnos
03c901dfb8
Playlist + database changes: (#14531)
- Cleanup 'entry_slot'
- Fallback label + logging
2022-10-18 21:32:54 +02:00
LibretroAdmin
a153738bbd Create retroarch_get_flags and use it 2022-10-12 13:27:54 +02:00
LibretroAdmin
41de5ec80b Cleanups for runloop_state grabbing 2022-10-10 20:32:46 +02:00
LibretroAdmin
076a1a398c (Runloop) Turn some boolean variables into flags 2022-10-10 04:37:17 +02:00
LibretroAdmin
479e3b23d9 Turn content_get_status into content_get_flags 2022-10-09 20:32:39 +02:00
LibretroAdmin
d5a6c4f150 (content) use flags for content_state
(xaudio2) Use flags
2022-10-09 10:20:43 +02:00
LibretroAdmin
fcbd72dbf3
Use flags pt4 (#14497)
* * Use flags for rarch_state
* Get rid of ^M linebreaks in retroarch_types.h

* Buildfixes for consoles

* (audio driver) use flags instead of bools

* (video) Use flags instead of bools

* Rewrite input driver state bools into flags
2022-10-08 10:39:15 +02:00
LibretroAdmin
30eb0edcf8 Use flags for some structs instead of tons of bools - less state/variables to bookkeep,
less memory used
2022-10-06 06:53:13 +02:00
sonninnos
4806105a2c
Logging cleanups (#14393) 2022-09-06 18:48:58 +02:00
LibretroAdmin
003cea5d42 Fix some 'implicit conversion loses precision' warnings 2022-09-01 15:15:48 +02:00
LibretroAdmin
575e331fd1 If we already know the length of the string, use strldup instead.
Avoids the internal strlen call inside strdup, and strdup is a deprecated
function starting from MSVC2005 anyways.

NOTE: Do NOT pass STRLEN_CONST as n parameter to strldup, it needs to
be at least +1 character higher than the strlen return value of the same
string
2022-08-25 16:31:54 +02:00
LibretroAdmin
5bb3fbab93 Fix mistake in prior commit - should be concatenated to string 2022-08-25 15:17:31 +02:00
LibretroAdmin
6caa139700 (cheevos.c) Fix some function prototypes for C
Rewrite some snprintfs as strlcpy/strlcat/manual assignment - only
use snprintf if we actually need the formatting
2022-08-25 15:08:02 +02:00
LibretroAdmin
6126a86259 Try to avoid sprintf/strcat/strcpy calls as much as possible in
RetroArch codebase
2022-08-24 13:49:05 +02:00
LibretroAdmin
c04201927b
Don't make libretrodb dependent on errno anymore (#14340)
* Don't make libretrodb dependent on errno anymore
2022-08-23 19:36:52 +02:00
LibretroAdmin
b2634ea588 * Create fill_pathname_join_special - and specify fill_pathname_join
as deprecated.
* Use fill_pathname_join_special in the vast majority of cases where
we can ensure out_path is a new empty string
* Get rid of some extension concatenation with strlcat where encountered
* Some general cleanups with NULL termination of strings that get immediately
passed to strlcpy/strlcpy-adjacent functions
2022-08-04 14:19:38 +02:00
LibretroAdmin
f79875536a (libretro-common) Move file_crc32 out of encoding_crc32.c - we don't want file I/O
code in encodings/encoding_crc32.c
2022-08-01 14:04:01 +02:00
libretroadmin
69a2d124c0 Don't do NULL termination on string if we pass it off to strlcpy
and/or a file_path function that uses strlcpy under the hood
2022-07-24 05:39:51 +02:00
LibretroAdmin
29774f5b7a
Small opts (#14186)
* (joypad_connection) Small optimizations -
* Turn functions static where possible
* Hose strlen call out of loop

* (input_driver.c) General cleanups:
* Some small code/style nits

task_screenshot.c:
* Move widget callback function for screenshots to task_screenshot.c

(file_path.c):
* Turn get_pathname_num_slashes into static function
* path_linked_list_free - always returns true, so get rid of return value
* path_linked_list_new - fix function signature
* path_get_archive_delim - do not NULL-terminate string, already done by strlcpy later on

General:
* Slight optimizations - use int/size_t for loop counter variable instead of unsigned
* Take advantage of fact that strlcpy already NULL-terminates, so don't do this explicitly
outside if we're just going to end up calling strlcpy/fill_pathname_join on it anyway
2022-07-19 10:01:33 +02:00
libretroadmin
adf9994828 Deprecate fill_pathname_base_noext 2022-07-11 20:13:44 +02:00
libretroadmin
05fb6fd9a3 task_push_load_content_playlist_from_menu - cleanup error_string 2022-07-09 18:43:44 +02:00
libretroadmin
3b2b4ea49d (task_content.c) Cleanups - remove error_string where not used 2022-07-09 18:41:18 +02:00
libretroadmin
a9b074fa0a Rewrite content_file_list_init - check return value first before assigning it 2022-07-09 13:32:38 +02:00
libretroadmin
274ce86d89 content_file_list_init - size < 1 will never happen, checked outside
before calling the function
2022-07-09 13:24:01 +02:00
libretroadmin
4d3587a2e8 Cleanups in task_content.c -
split up some code between HAVE_MENU and whatnot
2022-07-09 02:07:34 +02:00
libretroadmin
fbd37f8926 Consistency in variable naming conventions - rename temp_path to tmp_path
for uniformity with rest of code
2022-07-05 19:06:38 +02:00
libretroadmin
cd36af1d24 Use NAME_MAX_LENGTH for some char array variables that have a fixed
width of 256
2022-07-03 13:59:23 +02:00