4172 Commits

Author SHA1 Message Date
LibretroAdmin
4cd63c20f4 (input/connect) Use calloc for setting DualShock3 struct 2022-09-09 19:22:29 +02:00
LibretroAdmin
dfff8e127a Simplify joypad_connection.c 2022-09-04 02:03:20 +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
eaae2aec46 Increase the size of formatted_number to 16 so we no longer get
-Wformat-truncation warnings (state slot would be way too big though
regardless, even the current cap at 999 is ridiculous)
2022-08-27 15:45:49 +02:00
LibretroAdmin
25b76fdb54 input_keyboard_osk_event_append and others: don't call strlen
implicitly, always leave it up to caller
font_driver_get_message_width - try to avoid scenario where 'len'
is 0
2022-08-27 15:13:56 +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
da13fb0f48 Don't include errno.h in files that don't justify its use 2022-08-25 05:19:30 +02:00
LibretroAdmin
10a351228b * Rewrite some snprintfs
* task_steam.c - add license header
2022-08-20 19:17:28 +02:00
LibretroAdmin
4c7e316aa2 Turn functions static 2022-08-17 16:47:44 +02:00
LibretroAdmin
94ed25be56
Cleanups (#14296)
- (database_info.c) Optimizations for database_info_build_query_enum() -
 it would call strlcat at the very least 3 times, normally more than that.
 Every strlcat call is at least one or more strlens. Reduce it all down
 to manual string concatenation and one strlcat
- (database_info_build_query_enum) - always NULL terminates string so no need for NULL termination done by callee
* (menu_displaylist) use smaller strings for basename paths, remove one unnecessary string
in menu_displaylist.c function
- (disk_index_file.c) Avoid another trivial string concatenation by doing
it manually after fill_pathname_join_special
- (fill_pathname_join_delim) since fill_pathname_join_delim() now has a return value, use it for 
string concatenation
- (platform_unix) - Use BUFSIZ as size for a buffer in system_property_get
- some other trivial strlcat usage replacements
2022-08-06 18:04:40 +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
9b10579a54
(Network) Fix getaddrinfo_retro (#14261) 2022-07-31 11:22:28 +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
libretroadmin
a6a4b845a4 Some string simplifications - don't NULL terminate if we pass
string to strlcpy and/or a file_path function using strlcpy under
the hood - don't do strlcpy for trivial setting of 2/3 char strings
2022-07-25 04:39:08 +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
0a12062e1c Remove unnecessary content_crc in bsv_movie_init_playback 2022-07-17 04:26:49 +02:00
libretroadmin
4b1766cf61 Silence more -Wdocumentation warnings 2022-07-15 01:12:04 +02:00
libretroadmin
eb2c3e35d4 Silence some of the warnings being generated by Objective-C 2022-07-15 00:33:08 +02:00
libretroadmin
f7194e167f use path_basename_nocompression where it is safe to do so 2022-07-12 19:14:12 +02:00
libretroadmin
d706c9c5bf Start deprecating trivial functions in file_path.c 2022-07-11 19:56:46 +02:00
libretroadmin
14afdf0e87 (Android) Backport 2020e9ce6a -
* Gingerbread support
* Touchpads support
* builtin Xperia Play autoconfig profile
2022-07-08 21:03:19 +02:00
aldebaran27
58decac935
Increase DEFAULT_MAX_PADS to 8 for ODROIDGO2, since that impacts the RG351[X] consoles. The RG351[X] have a USB host controller and can have an arbitrary number of USB gamepads. (#14122) 2022-07-02 01:06:46 +02:00
libretroadmin
38f6ad95f4 (Winraw) Get rid of some debug logs 2022-06-26 06:12:30 +02:00
sonninnos
1ad9b20b09
(WinRaw) Clear key states when unfocused (#14080) 2022-06-21 18:01:28 +02:00
LibretroAdmin
4a38831c47
Try to reduce fixed size char arrays from PATH_MAX_LENGTH to lower sizes (#14062)
* Try to reduce fixed size char arrays from PATH_MAX_LENGTH to lower sizes
2022-06-18 19:07:15 +02:00
StormedBubbles
53d0e161e1
Fix lightgun scaling on Y axis 2022-06-16 22:16:32 -04:00
sonninnos
53be17aee2 Block pointer input when overlay is pressed 2022-06-16 16:49:51 +03:00
sonninnos
8d9f772dce (WINRAW) Fix pointer device position 2022-06-16 11:34:54 +03:00
libretroadmin
85cd386cb3 (Input) Cleanups 2022-06-04 08:55:35 +02:00
libretroadmin
c9149895f5 (GCC12) Get rid of warning: the comparison will always evaluate as 'true' for the pointer operand in 'binds + (sizetype)((long long unsigned int)port * 4032)' must not be NULL [-Waddress] 2022-06-04 08:50:35 +02:00
libretroadmin
96a485f885 Move struct and macros for input to input_types.h 2022-05-29 21:58:39 +02:00
libretroadmin
9590fdd0d4 Cleanups pt.2 2022-05-22 20:29:53 +02:00
Francisco Javier Trujillo Mata
6366fcf8e3 [ORBIS] Remove legacy implementation and compile with Werror 2022-05-21 17:10:35 +02:00
Antonio Jose Ramos Marquez
9dd060dbc8 [ORBIS] some changes for input 2022-05-21 16:31:10 +02:00
OsirizX
c6d51fdb32 [ORBIS] Initial changes for PS4 2022-05-21 16:31:10 +02:00
libretroadmin
49bf60cc90 (Win32) Cleanups 2022-05-17 13:21:56 +02:00
LibretroAdmin
533d746f64
Merge pull request #13649 from phcoder/ctrl
Add a configurable workaround for Android reconnecting devices
2022-05-12 20:56:58 +02:00
jdgleaver
dbcce3f564
Analog button mapping fixes (#13913) 2022-05-05 20:47:23 +02:00
Vladimir Serbinenko
c2db12c727
Enable menu toggle button on retrofw devices (#13889) 2022-04-26 09:59:36 +02:00
Tony
044e1ec655
(WinRaw) Fix multiple light guns (#13840)
* (WinRaw) Fix multiple light guns

* Strip non-ASCII characters from mouse display names
2022-04-08 21:46:00 +02:00
Vladimir Serbinenko
2ef2ff1b36 Add a configurable workaround for Android reconnecting devices
Closes https://github.com/libretro/RetroArch/issues/3414

I have investigated the issue. The crux of the problem is that on Android there
is no way distinguishing 2 scenarios:
1) 2 identical bluetooth controllers A and B and first there are button presses
only on controller A and then on controller B
2) the same controller disconnects and reconnects.
Android doesn't give bluetooth mac address of where the touch came from, only
opaque ID and this opaque ID changes after reconnect. Hence without changes to
android this is infeasible without giving up the ability for 2 users to play on
identical controllers.

I guess that this sacrifice makes sense for affected users
2022-04-05 18:40:27 +02:00
twinaphex
c8d57fe667 (CXX_BUILD) Some CXX_BUILD fixes 2022-03-30 15:13:28 +02:00
revvv
1cd6413e24 Wii U: Fix USB get_device_name(), don't truncate to three chars 2022-03-29 18:25:27 +01:00
OsirizX
80b06c37fe [PSL1GHT] Add experimental PSMove support for ps3 2022-03-27 18:03:40 +02:00
revvv
78e7d23c14 Fix USB gamepad support
1. get_axis() didn't use AXIS_NEG_GET() / AXIS_POS_GET()
2. packet_handler() needs byte shift
3. log messages need SWAP_IF_BIG()
2022-03-27 04:35:06 +01:00
revvv
b6ae697fad Make find_connection_entry() more specific
Controllers with same VID/PID are distinguished by the device name.
1. The Wii U only sends a prefix of the device name.
2. The check preferred the device name over VID/PID which was not
   intended.

Example: The device name "USB Gamepad" is truncated to "USB" which
was mapped to "Generic SNES USB Controller", although VID/PID did not
match.
2022-03-27 04:35:06 +01:00
revvv
75f94950bf Use "Retrode" as device name
Otherwise autoconfig file can't be found on the Wii U:
VID/PID are not available, so it has to match with 'input_device' and I
don't want to add additional autoconfig files with different
'input_device' strings.
2022-03-27 04:35:06 +01:00
twinaphex
03ce03eb81 Remove unused variable 2022-03-25 16:19:39 +01:00
sonninnos
6fcf291df4 Fix analog stick not working with 'Unified Menu Controls' 2022-03-24 13:46:57 +01:00
Colin Kinloch
60fab1c4a1 (Wayland) Create wl_data_device only when wl_seat and wl_data_device_manager exist 2022-03-23 06:52:16 +01:00