4155 Commits

Author SHA1 Message Date
LibretroAdmin
5705ff95cb (Cocoa) Revert this until reported issue with Game Focus is resolved 2022-10-30 23:39:02 +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
LibretroAdmin
ffd3d195b5 Another C++ comment that had to be converted to C-style comment 2022-10-29 19:18:22 +02:00
LibretroAdmin
8825eea884 Style nits 2022-10-29 19:13:17 +02:00
LibretroAdmin
55daddf286 * Fix C++ comments - turn them into C comments for C files
* Some other additional style nits along the way
2022-10-29 19:05:39 +02:00
Kangmo-Ahn
3a744b7dae
Extended character ime (#14559)
* Update Makefile

* Update win32_common.c

* Update input_driver.c

* Update gfx_thumbnail_path.c
2022-10-29 19:01:30 +02:00
LibretroAdmin
4854643ead (input_driver.c) Small cleanups 2022-10-29 18:52:10 +02:00
LibretroAdmin
fc78f96a3a (X11) Turn boolean variables into flags 2022-10-26 19:30:36 +02:00
LibretroAdmin
8a0491b282 (Dinput) Fix Mouse L button behavior 2022-10-26 19:25:38 +02:00
LibretroAdmin
92a2c0f71a (Dinput) Turn boolean variables into flags 2022-10-26 19:22:35 +02:00
redenvelope2000
89d9fe9981
Fixed RETROK_LMETA not working on macOS port. (#14538)
The RETROK_LMETA key was not defined in the rarch_key_map_apple_hid[].
2022-10-20 15:59:14 +02:00
redenvelope2000
c161c35738
Fixed Z/X keys not working on the macOS port. (#14539)
Need to check keyboard_mapping_blocked before using apple_key_state[].
2022-10-20 15:59:03 +02:00
LibretroAdmin
22f43a4b75 C89_BUILD buildfix 2022-10-20 04:30:28 +02:00
Dyllan Kobal
6ade32336a Fixed error for UWP 2022-10-19 18:52:21 +02:00
Dyllan Kobal
55ce774527 Fixed the way devices were previously indexed 2022-10-19 18:52:21 +02:00
Keith Bowes
72a076a58d
Fixed compiling with --disable-menu (#14535) 2022-10-19 03:30:52 +02:00
neil4
b98c53ddb7
Improve haptic feedback for input overlays (#14517)
Repurpose vibrate_on_keypress to enable device's standard keypress feedback on overlay key/button state changes

- Add keypress_vibrate function ptr to input_driver_t (only implemented on Android for now)
- (Android) Remove APP_CMD_VIBRATE_KEYPRESS
- (Android) Add doHapticFeedback, called directly to avoid latency
2022-10-16 09:58:09 +02:00
LibretroAdmin
e62abac647 Add BSV movie flags 2022-10-15 14:32:26 +02:00
LibretroAdmin
da68e73f94 Get rid of some RARCH_CTL_ commands 2022-10-10 20:14:54 +02:00
LibretroAdmin
076a1a398c (Runloop) Turn some boolean variables into flags 2022-10-10 04:37:17 +02:00
LibretroAdmin
d506210fbe
(menu_driver.c) Use flags instead of bools (#14500)
* (menu_driver.c) Use flags instead of bools
2022-10-08 22:52:18 +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
d0c6dfee0b Cleanup bitmask setting 2022-10-05 18:43:58 +02:00
LibretroAdmin
5ad204bea5 (Wayland) Turn more functions static 2022-10-03 03:38:56 +02:00
LibretroAdmin
91f4892cbe (wayland) Cleanups; turn functions static and other nits 2022-10-03 03:36:12 +02:00
LibretroAdmin
ace21d28f7 Fix C++ comments 2022-10-01 17:56:16 +02:00
LibretroAdmin
1571035fb7 (DS3/connect) Fix some warnings 2022-09-26 16:12:31 +02:00
gblues
a4b934b71a
Fix some HID bugs (#14435)
* Fix Sixaxis gamepad operation

== DETAILS
It looks like commit 78e7d23c144c862d65ae1bf7ee41a1228bdfa380 broke
the DualShock. Sorry, @revvv, but this is probably going to break the
Retrode driver. We'll need to figure out a different solution.

* Fix a bunch of HID implementations

== DETAILS
As mentioned in the previous commit, the thing that broke the DS3
driver was a change to the wiiu HID handler, which did some pointer
math on the data buffer.

The thing is.. there's no reason to do that pointer math. Yet, I found
the same thing on almost every other HID driver: OSX, libusb, wiiusb.
The only other HID driver that did not do this was the Bluetooth
HID driver.

It doesn't make any sense. The only reason it doesn't crash is because
the memory right before the buffer is valid memory.

Change summary:
- remove the weird pointer math from all HID controllers
- remove the `#ifdef apple ...` in the ds3 and gamecube adapter
  drivers, because it's no longer needed.
- in the pad packet handlers, decrement data buffer offset references
  to account for the removal of the buffer manipulation.

* Fix DualShock 4

== DETAILS
Should've only subtracted 1, not 2; and now the pad works.

Also, added a PID to cover newer model DS4s. I picked "R2" out of the air
for the constant.

Tested on Mac OS

* Really really fix iohidmanager_set_report

A huge apology to @23rd for insulting your fix. I was wrong to call you
wrong.

That left the question: why did that change break the DS3?

Well, it's because `IOHIDDeviceSetReport` expects the report buffer to be
just the report. All of RA's HID SetReport calls include the report number
in the first byte, so we have to trim that off.

We actually do this in a different invocation of `IOHIDDeviceSetReport`
elsewhere in the file! This commit applies that same logic to
`iohidmanager_set_report`

This has two benefits:

1. The DS3 works
2. The DS3 no longer requres the user to press the PS button to activate
   it the first time. You plug it in and it Just Works, just like on Wii U.
2022-09-26 14:32:49 +02:00
23rd
171a79e879
Fixed sending of report id to HID device on macOS. (#14430) 2022-09-19 18:01:27 +02:00
gblues
cdd39a6364
MacOS: Fix Sixaxis (DS3) support (#14402)
* MacOS: Fix sixaxis on MacOS 12.x

== DETAILS
Mac OS 12.x "Monterey" dropped some built-in support for the
Sixaxis controller--exactly what changed is unclear, but other
projects reported similar issues with the OS.

This commit ports the work done on SDL, which is basically to
read two feature reports after writing out the activation report.
I think we did this at one point in the past, but it got lost
among HID driver rewrites.

I've tested this locally and it resolves the issue; after connecting
the sixaxis and pressing the Playstation button, the pad is registered
and works successfully.

I have not tested this on other platforms.

* Gracefully handle incomplete HID implementations

== DETAILS
Not all HID drivers implement all HID methods; since this controller
has a magic sequence that requires the ability to set and get HID
reports, we need to make sure we don't crash if we're running on
an incomplete implementation.

- Add a null check for the driver methods and log useful info if checks
  fail
- Fix minor formatting
2022-09-11 09:40:38 +02:00
LibretroAdmin
2dec44188b (connect_ps3.c) Buildfixg 2022-09-09 23:58:00 +02:00
LibretroAdmin
2bdb5d488b (connect/ps3) Remove unused variable, style nits 2022-09-09 21:26:47 +02:00
LibretroAdmin
f5fc1fb24e Fix build 2022-09-09 19:26:21 +02:00
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