Commit Graph

2187 Commits

Author SHA1 Message Date
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
0c42e339e1 Silence some warnings that popup in Xcode 2023-01-04 18:42:35 +01:00
zoltanvb
1334bd0408
Localization improvements. (#14753)
- enable localization of audio mixer sublabel
- resolve 2 localization FIXME items
- enable better localization of controller connect/disconnect/config messages
2022-12-22 16:54:14 +01:00
LibretroAdmin
f5133d8cc4
Revert "Add Xdelta support for softpatching (#14706)" (#14743)
This reverts commit aaad220836.
2022-12-19 03:29:46 +01:00
libretroadmin
7a4a860680 Revert "Don't rely on ENOSPC - relies on errno.h"
This reverts commit f6c2e4d292.
2022-12-19 03:22:07 +01:00
libretroadmin
f6c2e4d292 Don't rely on ENOSPC - relies on errno.h 2022-12-19 03:17:09 +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
573a82c0c8 Buildfix for Miyoo 2022-12-05 15:46:44 +01:00
libretroadmin
2c42912185 More header cleanups 2022-12-05 15:15:07 +01:00
libretroadmin
04f510d503 Cleanup header includes 2022-12-05 15:10:19 +01:00
neil4
3b0db75782
Overlay cleanups; replace bools with flags (#14661) 2022-11-22 18:29:11 +01:00
sonninnos
10a74657c3
Move SRAM init to content init (#14653) 2022-11-21 15:24:58 +01:00
neil4
3de186e374
Overlays: Ignore hitboxes with zero area (#14619)
I.e. Set 'reach_x' or 'reach_y' to zero to ensure no hitbox math is done

nits
2022-11-13 10:46:41 +01:00
sonninnos
68401205f2
Add option for pause on controller disconnect (#14601) 2022-11-08 12:46:09 +01:00
sonninnos
954d1bf605
Driver independent disconnection notification (#14600) 2022-11-07 05:51:37 -08:00
sonninnos
9796024f3d
(XInput) Ensure disconnection notification (#14592)
* (XInput) Ensure disconnection notification

* Prefer display_name in autoconfig disconnect notification
2022-11-06 02:34:03 +01:00
neil4
b47fb0b807
Overlays: Add 'reach' and 'exclusive' for hitboxes (#14591)
Allows stretching hitboxes and handling their overlap

reach_up, reach_down, reach_left, reach_right:
- Stretches in one direction:
reach_x, reach_y
- Stretches symmetrically

exclusive:
- If true, blocks input from overlapped hitboxes
range_mod_exclusive:
- Similar, but only applies when this hitbox is extended by range_mod
- After range_mod takes effect, has priority over 'exclusive'

E.g. This creates a D-Pad area and extends its hitbox left & right 50%, up 15%, and down 30%. Then applies range_mod_exclusive:
overlay0_desc0 = "dpad_area,0.15,0.57,rect,0.166228,0.295516"
overlay0_desc0_reach_x = 1.5
overlay0_desc0_reach_up = 1.15
overlay0_desc0_reach_down = 1.3
overlay0_desc0_range_mod = 2.0
overlay0_desc0_range_mod_exclusive = true
2022-11-05 21:32:22 +01:00
LibretroAdmin
db6e0b1f42 Removed credits - requested by author 2022-11-01 21:40:13 +01:00
LibretroAdmin
07378abbdf (task_save) Use flags instead of booleans
(task_screenshot) Start reducing amount of parameters
2022-10-30 18:41:41 +01:00
AKuHAK
c3914d1c85
(database) Added serial scanning for PS2 (#14566)
reworked ps1 magic numbers
PS1 scan: fixed not scanned LSP titles, added PSX.EXE titles, extended ps1 serial variations
2022-10-30 17:21:48 +01:00
neil4
2de52baf74
Overlays: Add eightway area types (#14565)
- New descriptors: 'dpad_area' and 'abxy_area'
- Each has a diagonal sensitivity setting, 100% being 8-way symmetry
- Buttons can be redefined in the cfg file

E.g. This would create a d-pad area, then redefine it to use analog directions:
overlay0_desc0 = "dpad_area,0.85,0.57,rect,0.166228,0.295516"
overlay0_desc0_up = "r_y_minus"
overlay0_desc0_down = "r_y_plus"
overlay0_desc0_left = "r_x_minus"
overlay0_desc0_right = "r_x_plus"
2022-10-30 06:31:27 +01:00
neil4
1dd165a3bf
Fix overlay next_index for unnamed targets (#14562) 2022-10-29 16:33:34 +02: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
sonninnos
bbd6c0ae9a
Add delay to savestate notifications (#14514) 2022-10-15 11:29:07 +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
cc3a339011 (Runloop) Use more flags 2022-10-10 19:54:54 +02:00
Bernhard Schelling
c9bbe7683f
Add View feature (#14467)
* Add View feature
Add saving of a filter set in the Explore menu into a so called "View" file which then gets listed alongside playlists.
This also adds the ability to filter a category by range in the Explore menu and not just filter on exact matches.

* Menu improvements for explore and views

* Collapse ozone sidebar in view

* Fix problems with the sidebar in explore/view

* Ignore view files in the Qt playlists menu

* Add missing semicolon

* Support downloading thumbnails in views
2022-10-10 06:36:02 +02:00
LibretroAdmin
076a1a398c (Runloop) Turn some boolean variables into flags 2022-10-10 04:37:17 +02:00
LibretroAdmin
2218ea1d96 Buildfix for libnx 2022-10-10 01:49:31 +02:00
LibretroAdmin
2cddea21f8 * Cleanups
* Less pointer grabbing (dispwidget_get_ptr)
2022-10-09 22:53:39 +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
f40d157571
Use flags pt3 (#14491)
* (Vulkan) Use flags for vulkan_emulated_mailbox

* Use flags for vk_texture

* dispgfx_widget - use flags instead of bools

* (Autoconfig) Use flags
2022-10-07 11:08:17 +02:00
LibretroAdmin
91119d038f
(gfx_display/gfx_animation) Use flags instead of bools (#14488)
* (gfx_display/gfx_animation) Use flags instead of bools
* (task_save) Use flags instead of bools
2022-10-07 00:10:32 +02:00
LibretroAdmin
4f071e47c7 screenshot_task_state - use flags instead of bools 2022-10-06 20:57:07 +02:00
LibretroAdmin
951b98fe1b
Bools to flags (#14486)
* (D3D11) Use flags instead of bools

* (RPNG) Use flags

* Simplify rpng_is_valid

* (rpng_is_valid) Prevent potential NULL pointer dereference
(D3D11) Some whitespacing changes/code nits

* (task_pl_thumbnail_download.c) Simplify some code
2022-10-06 19:26:38 +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
4fe477ee39
Avoid 'video_gpu_screenshot' with savestates (#14464) 2022-10-03 15:13:01 +02:00
sonninnos
4806105a2c
Logging cleanups (#14393) 2022-09-06 18:48:58 +02:00
Bobby Smith
82cac0f9ba
Fix Redump bin/cue scan for some DC games + add RVZ/WIA scan support for GC/Wii (#14380) 2022-09-06 01:52:01 +02:00
sonninnos
c4c55077a1
Allow On-Demand Thumbnails in Explore menu (#14385) 2022-09-05 00:01:38 +02:00
LibretroAdmin
654203be0a (Autosave) Change/improve exit behavior of autosave thread -
if condition variable is signaled, the loop is ran another
last time so we can do a final check/save before stopping the thread.
Old commit courtesy of tobiasjakobi
2022-09-03 00:21:58 +02:00
LibretroAdmin
2463a63c78 (task_save.c) Miscellaneous cleanups:
* Remove unused return type of one function
* Remove some TODO/FIXME notes
* Small style nits
2022-09-02 23:35:48 +02:00
LibretroAdmin
003cea5d42 Fix some 'implicit conversion loses precision' warnings 2022-09-01 15:15:48 +02:00
LibretroAdmin
60030e373e
Reduce snprintfs + assorted cleanups (#14369)
* Reduce snprintf and/or use them only for concatenating the
string formatting of numbers/values
* Reduce snprintfs
* Use snprintf for concatenation at parts
* * We don't need to NULL-terminate strings that get passed to strlcpy/strlcat
and friends
* Use snprintf for concatenation in certain instances
* Do away with some string intermediary copies where we can avoid it
* Fix warning unused variable
* * Reduce snprintf calls
* Rewrite snprintf calls into strlcpy where possible
* Use snprintf for concatenation when necessary
* Do away with some string intermediary copies in task_translation.c
* run_translation_service - make switch slightly smaller
2022-09-01 04:17:07 +02:00
LibretroAdmin
08154e2656 (task_autodetect.c) Use snprintfs for concatenating strings (and only
use them for formatting numbers/values)
2022-08-29 14:05:16 +02:00
LibretroAdmin
19c72a413f (gfx_thumbnail_path.c) Cache localized string
(menu_displaylist.c) Some optimizations:
* Make sure val_d is never bigger than 16, it should just
contain a number. 16 is more than plenty (and probably too big even)
* Hose val_d out of loops if its value never changes inside the loop
* Attempt to avoid calling msg_hash_to_str inside loops unnecessarily
2022-08-27 13:20:29 +02:00
LibretroAdmin
87de6bda46 (input_autoconfigure_disconnect_handler) Simplify some code 2022-08-27 09:22:20 +02:00
LibretroAdmin
61e24132bf (task_save.c) Simplification in control flow
(snprintf) Try to reduce or simplify snprintf calls, only tend to
use it for processing integers/numbers and avoid it for regular
string concatenation (NOTE: we try to be a bit safer about it to
address earlier cited criticism, although we don't consider concatenating
3 or 4 characters at the end to be insecure)
(msg_hash_to_str) Try to avoid duplicate calls to the same localized
string when we can just cache the results once instead locally
2022-08-27 07:55:02 +02:00
LibretroAdmin
7507e20703 Revert "(RJSON) Combine multiple consecutive rjsonwriter_raw calls into one"
This reverts commit 82efa5a3d6.
2022-08-26 14:44:29 +02:00
LibretroAdmin
82efa5a3d6 (RJSON) Combine multiple consecutive rjsonwriter_raw calls into one
- significantly reduces the amount of function calls
2022-08-26 13:55:52 +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
f5ac33c0b6 Simplify task_database_cue.c code -
* Was copying pre_game_id into several memory buffers for no real reason,
gets rid of some unnecessary strncpy calls this way too
2022-08-25 07:15:27 +02:00
LibretroAdmin
88187e7ef2 * Start getting rid of strncpy
* steam.c - cleanups:
  * Use string_to_lower from libretro-common/stdstring.c instead of
    its own version
  * Some stylistic changes
  * Rewrite strncpy calls into strlcpy/strlcat/manual assignment
  * Make it C89 compliant
  * Some unused variables
2022-08-25 06:51:39 +02:00
LibretroAdmin
8017410098 task_database_cue_get_token - correct to 'if (rv < 0)' instead 2022-08-25 05:52:42 +02:00
LibretroAdmin
c841e191f7 (task_database_cue.c) Put this conditional back 2022-08-25 05:36:48 +02:00
LibretroAdmin
da13fb0f48 Don't include errno.h in files that don't justify its use 2022-08-25 05:19:30 +02:00
LibretroAdmin
39241699a0 Drop errno dependency in database_cue_get_token - was some legacy
code that is probably not needed
2022-08-25 04:51:00 +02:00
lucasmr
808fc7f389
Refactor task_database_cue.c (#14349) 2022-08-25 04:42:23 +02:00
LibretroAdmin
56a6c50728 (task_database_cue.c) Get rid of some strcmps 2022-08-24 16:32:55 +02:00
LibretroAdmin
c79904f8b3 (task_database_cue.c) More simplifications 2022-08-24 16:21:45 +02:00
LibretroAdmin
f2d8b67f23 (task_database_cue.c) Simplifications:
- unsafe strcpy/strcat/sprintf were used, so pass 'len' parameters
to detect_{system} functions so that we can use the safer strlcpy/strlcat
calls instead
- thanks to strlcat/strlcpy return values, we can do less string concatenations
and get the same results
- some other miscellanous cleanups
2022-08-24 16:08:06 +02:00
LibretroAdmin
fdc563e6f7
Remove errno dep (task_database_cue.c) (#14341)
* (task_database_cue.c) Turn some functions static - some general cleanups

* Start removing errno dependency on task_database_cue.c
2022-08-24 15:15:21 +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
fc861c167c - Get rid of some strerror usage
- Get rid of errno.h include in task_audio_mixer.c
- Rename get_token so it has less chance to conflict with other symbols
2022-08-23 19:58:20 +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
Jamiras
85c44f9245
more thread-awareness in task callbacks (#14337)
* more thread-awareness in task callbacks
2022-08-23 15:11:11 +02:00
LibretroAdmin
10a351228b * Rewrite some snprintfs
* task_steam.c - add license header
2022-08-20 19:17:28 +02:00
LibretroAdmin
4c4bec11f7 NULL termination already happens in strlcpy 2022-08-10 02:45:27 +02:00
LibretroAdmin
a6e210e9db Get rid of some strlcats 2022-08-08 22:41:32 +02:00
LibretroAdmin
0594df8cce Remove some unused variables 2022-08-04 22:41:17 +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
Cthulhu-throwaway
3aa1811ca9
(Network) Add getnameinfo_retro (#14278) 2022-08-04 13:22:49 +02:00
LibretroAdmin
e7f3432e48 Replace some trivial strlcat usage - use return value of preceding
strlcpy then simply append the extension to it at this location
2022-08-04 03:45:09 +02:00
LibretroAdmin
e4bff7c12c Move rjsonwriter helper inline functions over to separate file rjson_helpers.h 2022-08-01 17:41:34 +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
Cthulhu-throwaway
20c4407928
Add HAVE_IFINFO macro (#14265) 2022-08-01 07:51:02 +02:00
LibretroAdmin
f711940339 (task_database_cue.c) Use STRLEN_CONST macro for last param to
string_is_equal_fast instead of hardcoded magic numbers - sizeof
is compile-time so should be at no detriment to performance
2022-07-30 18:31:05 +02:00
kikmon
44f5cb2935
Improved success rate of Serial scanning on PS1 by adding support for the xx.xxx format (#14256)
Co-authored-by: papa <papa>
2022-07-30 18:22:04 +02:00
LibretroAdmin
19e4b8c0ca Fix DEBUG codepath 2022-07-30 12:50:59 +02:00
LibretroAdmin
592f9384b0 Silence code analysis warnings by Xcode - unused variables - nothing
done with value set - etc
2022-07-29 08:29:43 +02:00
LibretroAdmin
4afe0c55d5 (autoconfig) Go back to prior behavior 2022-07-28 18:21:06 +02:00
Cthulhu-throwaway
29f0ba2e71
(Network/Vita) Add net_ifinfo support (#14225) 2022-07-26 16:10:23 +01:00
Cthulhu-throwaway
8d4a64ab96
(Netplay) Disallow netplay start when content is not loaded for static core platforms (#14220) 2022-07-26 07:21:57 +02:00
libretroadmin
8ac1a36259 Don't do NULL termination on strings when passing to strlcpy and/or
a file_path function that calls strlcpy under the hood
2022-07-26 07:01:10 +02:00
kikmon
45d78f2a60
[PS1 Serial Scanning] (#14219)
Changed return value of detect_ps1_game function to actuially return a
failure when the Serial couldn't be extracted.
Scanner will then fallback on crc check, and usually ends up finding the
games in the database.

Co-authored-by: papa <papa>
2022-07-25 22:41:32 +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
Cthulhu-throwaway
cc7c310aa1
(Netplay) Refactor fork arguments (#14208) 2022-07-24 04:26:50 +02:00
Cthulhu-throwaway
eb36c35ebf
(Netplay) Fix content reload deadlocks on static core platforms #2 (#14202) 2022-07-23 03:08:26 +02:00
Cthulhu-throwaway
09d9366bc0
(Netplay) Fix content reload deadlocks on static core platforms (#14196) 2022-07-22 02:36:24 +02:00
libretroadmin
3cf7e881ec Get rid of unnecessary log spam about non-required/non-essential files/directories 2022-07-21 03:48:11 +02:00
libretroadmin
2cf6f6ce8f * Don't do NULL termination on string if we pass it to strlcpy
* Cleanups in connmanctl.c - abuse of strlcat, strlcpy should
precede it first and/or other more optimal ways of setting the path
2022-07-21 01:47:34 +02:00
libretroadmin
4b5c7856e6 Remove some more explicit NULL-termination when we're calling a
string function that calls strlcpy under the hood
2022-07-19 20:43:12 +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