Commit Graph

4404 Commits

Author SHA1 Message Date
sonninnos 3e599d04d3
(WIN32) Add support for mouse button swap (#14846) 2023-01-14 21:33:26 +01:00
sonninnos 639d367773
(WIN32) Fix keyboard event characters (#14844) 2023-01-14 06:46:24 +01:00
reallibretroadmin 3b6aef23e1 Silence 'value stored to variable is never read' warning 2023-01-13 16:18:20 +01:00
sonninnos 2f1a03523b
Hotkey blocking correction (#14831) 2023-01-13 04:56:14 +01:00
neil4 7213aada8d
Add Preemptive Frames to Latency Settings (#14832) 2023-01-10 07:22:14 +01:00
reallibretroadmin 3ae8e35d0e (iOS) Buildfix and cleanup some unused variables 2023-01-09 01:54:45 +01:00
libretroadmin daa9e352cc Remove asserts 2023-01-09 00:51:05 +01:00
libretroadmin 8a3686df58 Revert "Header cleanups - don't include retroarch.h everywhere"
This reverts commit 0e3b478f8c.
2023-01-08 09:05:46 +01:00
libretroadmin 0e3b478f8c Header cleanups - don't include retroarch.h everywhere 2023-01-08 08:56:57 +01:00
libretroadmin 41b069462d (Android) Buildfix 2023-01-07 12:10:17 +01:00
libretroadmin e447a4e8e6 Get rid of RARCH_CTL_SET_{IDLE/PAUSED} 2023-01-07 07:32:16 +01:00
reallibretroadmin adee2dbe72 * Use strlcat instead of strcat
* Silence implicit conversion warnings detected in Xcode
2023-01-07 07:12:25 +01:00
libretroadmin b59a13771c Move input LUT table to input_driver.h 2023-01-05 19:30:51 +01:00
Gonzalo Peche 9efc1f500d In Android builds, add input_android_physical_keyboard configuration option and its corresponding menu entry to force a device to act as a physical keyboard.
When running on Android, RetroArch considers most devices that emit dpad events as gamepads, even if they also emit other keyboard events; this is usually the right thing to do, but it has the side effect of not letting some actual keyboards (e.g.: Logitech K480) act as such inside RetroArch. This configuration option allows users to manually select a specific input device to act as a physical keyboard instead of a gamepad, which is handy when emulating computers as opposed to consoles.
2023-01-05 04:50:37 +01:00
sonninnos 883e88fa73
Keyboard event blocking corrections (#14728) 2022-12-18 18:36:24 +01:00
Apaczer 4242a04641
add L3 & R3 mapping for MIYOO (#14741)
for Retropad

Update sdl_dingux_joypad.c
2022-12-18 04:08:16 +01:00
Denis Kopyrin a22bac091c
(macOS) Fixed cocoa keyboard not allowing to map Analog stick (#14701) 2022-12-05 16:12:19 +01:00
sonninnos 5024809c85
Device Index menu refactor (#14691) 2022-12-02 17:47:53 +01:00
LibretroAdmin c75af6194b
Extended IME and Korean OSK (#14676) 2022-11-29 04:45:55 +01:00
libretroadmin 192f4859e0 (GX) More buildfixes for Github CI 2022-11-27 23:46:30 +01:00
libretroadmin 16952aa23b (GX) Another header include buildfix 2022-11-27 23:41:21 +01:00
libretroadmin 9627e782aa (GX) Buildfixes 2022-11-27 23:37:08 +01:00
libretroadmin f062b74e26 Overlays/Input: Turn a bunch more functions static 2022-11-23 19:54:15 +01:00
libretroadmin 0cf1d86a3a (input_driver.c) Turn bunch of functions static that are never accessed outside
* Turn some variable / parameter names like 'joypad_driver_name' into 'joypad_drv_name'
so they are less likely to conflict with symbol names
2022-11-23 19:14:24 +01:00
libretroadmin aa0ae2cd3e Silence warnings 2022-11-22 18:34:04 +01:00
neil4 3b0db75782
Overlay cleanups; replace bools with flags (#14661) 2022-11-22 18:29:11 +01:00
sonninnos ce1e59615a
(WinRaw) Fix mouse position when using input overlay with mouse cursor (#14659) 2022-11-22 16:50:17 +01:00
sonninnos 9bc7bebf51
More hotkey cleanups (#14657) 2022-11-22 14:45:30 +01:00
libretroadmin 1c9d3ad0bf Silence some warnings 2022-11-21 20:56:28 +01:00
libretroadmin 6b71214ed7 Silence some signed/unsigned mismatch warnings 2022-11-21 19:34:43 +01:00
libretroadmin 6a098d37ac Use HAVE_DYLIB instead of HAVE_DYNAMIC when loading shared libraries 2022-11-21 05:37:35 +01:00
neil4 e71a5ff921
Overlay animation-related fixes (#14651)
- Fix analog drift blocking touch input (could occur on overlay_next if physical inputs shown on overlay)
- Fix overlay_next buttons lighting up in unison
- Skip meta keys in input_overlay_add_inputs (not supported by input_state_internal)
2022-11-21 04:48:34 +01:00
sonninnos 3377fd55ab
Driver + hotkey list reorder (#14646)
* Reorder driver menu and lists

* Reorder hotkey list
2022-11-20 07:26:34 +01:00
Richard c0926ad1a1
feat(iOS13): Pointer Movement Accuracy (#14641)
Co-authored-by: Richard <rf2222222@github.com>
2022-11-18 19:45:36 +01:00
libretroadmin 63153620a7 There can be builds that are statically built against a libretro core
but still have dylib support
2022-11-16 16:51:53 +01:00
sonninnos 3b921ffbfa
Fix shader toggle and add hotkey + sublabel (#14628) 2022-11-15 22:14:09 +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
GABO1423 b6563f7b5d
(UWP) Build Fix (#14617) 2022-11-12 20:06:15 +01:00
sonninnos 954d1bf605
Driver independent disconnection notification (#14600) 2022-11-07 05:51:37 -08:00
neil4 217fba48c5
minor overlay-related fixes (#14594)
input_overlay_loaded: Only update menu entries if changed

input_overlay_add_inputs: Set 'updated' for analogs when touched
2022-11-06 17:25:44 +01: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
sonninnos d4eef18f18
Addition to analog stick menu navigation (#14584) 2022-11-03 20:28:24 +01:00
DiktatorShadaloo 5587ab4f8b
Adding some usb hid drivers (#14581)
* Added usb hid controllers for the famous ZeroDelay encoder and also for "Kade: Kick Ass Dynamic Encoder" to be able to use some custom arcade sticks.

* Add accidentally missing change to Makefile

Co-authored-by: DiktatorShadaloo <diktatorshadaloo@gmail.com>
2022-11-03 03:00:42 +01:00
LibretroAdmin 1263b53dae Silence warning 2022-11-03 00:34:33 +01:00
sonninnos 1aa258faa0
Enable menu navigation also with right analog stick (#14579) 2022-11-02 07:42:36 +01:00
LibretroAdmin c4d2788c08 Rollback extended character PR - caused too many issues
and caused crashes - contributor can submit a new improved PR -
would also prefer increased readability
2022-11-02 06:23:46 +01:00
LibretroAdmin aeef3d6220 (3DS/CTR) Remove debug button combo that quites RetroArch 2022-10-31 23:02:35 +01:00
redenvelope2000 47070a64e6
Fixed macOS keyboard bindings in game focus mode. (#14570)
In the game focus mode the keyboard should not be remapped for joypads unless it is used for toggling the game focus mode.
2022-10-31 11:35:17 +01:00
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 78e7d23c14 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
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
revvv b98b9471d9 Refactored to use new multi_pad interface 2022-03-22 18:17:50 +01:00
revvv 9b00a932d5 Remove special treatment for Retrode gamepad adapter 2022-03-22 18:17:50 +01:00
Colin Kinloch d95bc2dd54 (Wayland) Dynamically load libdecor at runtime 2022-03-22 06:58:41 +01:00
Colin Kinloch 47c850c7fd (Wayland) Dedupe VK/GL code 2022-03-21 07:50:34 +01:00
Colin Kinloch 82c69995f0 (Wayland) SHM anti-collision for the splash screen 2022-03-20 18:31:30 +01:00
Colin Kinloch 065fb5acee (Wayland) Skip splash screen if window is not ready 2022-03-18 16:29:49 +01:00
jdgleaver ea77410037 Add 'Manage Remap Files' submenu + automatically save input remaps when closing content 2022-03-16 18:59:49 +01:00
revvv 492a83e6d5 Wii: Fix find_connection_entry(): needs unsigned int
Otherwise the USB gamepad cannot be found, if VID/PID has leading zero.
For example: Retrode gamepad adapter:
             vid=1027 (0x403) pid=38849      (0x97c1) becomes
             vid=1027 (0x403) pid=-26687 (0xffff97c1)
2022-03-15 17:43:46 +01:00
jdgleaver b08314cf60 Prevent 'global' configuration of input libretro device type 2022-03-15 17:43:28 +01:00
Colin Kinloch 86ca2006ea
(Wayland) Fallback to shm_open when memfd_create fails (#13740) 2022-03-14 19:20:29 +01:00
Nikos Chantziaras b094c58081
Add hotkey for toggling sync to exact content framerate (#13725)
* Add hotkey for toggling sync to exact content framerate

* CHANGES.md: add sync to exact content framerate toggle hotkey
2022-03-10 17:21:08 +01:00
Colin Kinloch 3b08d63b23
(Wayland) Initial drag and drop (wl_data_offer) support (#13515) 2022-03-09 16:34:47 +01:00
twinaphex 9bcee062ff Cleanups/warnings 2022-03-07 19:32:01 +01:00
Vladimir Serbinenko c11a798467
Series of djgpp fixes (#13705)
* features_cpu: Fix clock for djgpp

* frontend_dos_set_fork: Fix wrong id names

* dos_input: Fix missing indexing

* dos_joypad: Fix wrong id name

* Fix menu drawing

Menu is already prescaled to VGA_WIDTH x VGA_HEIGHT in vga_menu_frame. We need
to always use those dimensions

* Change dos compilation from griffin to common

* Set vga menu size to 320x200

* Add DOS compilation in gitlab-ci.yml
2022-03-05 15:53:18 +01:00
Tony e8e8404741
(WinRaw) Enable mouse overlay control (#13688) 2022-03-01 09:45:07 +01:00
Tony f0d9add1b2
(DInput/WinRaw) Ignore 'unknown/undefined' key (#13660) 2022-02-24 07:10:47 +01:00
Colin Kinloch 6dec52fda7
(Wayland) Fix wayland vulkan not reacting to initial resize (#13640)
(Wayland) Correct log stamps for GL or Vulkan

(Wayland) Fix style issues and sync formatting on identical code in GL and Vulkan
2022-02-22 08:58:46 +01:00
yoshisuga bc02f8319e
[iOS] New iOS 13 project to support Swift; Custom keyboard and touch mouse support (#13435)
* Support for Swift, added emulator keyboard

* fixed toggle key handling using magic number hack for now

* fixed keyboard transparency slider for now with suboptimal fix; add gesture recognizer to hide/show keyboard

* Support CocoaView extensions in Swift; move keyboard delegate impl and setup to swift extension

* moved keyboard view model creation out of EmulatorKeyboard

* implement key pressed delegate in swift extension

* added input method for directly sending RETROK_* codes to support a touchscreen keyboard; assign keyboard model delegates; updated keyboard layout (added F1-F12 keys); change shift, control and alt keys to be modifiers

* enable focus mode when custom keyboard is shown; enable/disable overlay when custom keyboard is toggled

* Specify -DHAVE_OPENGLES2 instead of -DHAVE_OPENGLES3 since glsym_es3.h does not compile in iOS 14.5
Fix tvOS build using compiler flags

* Create new project for iOS 13 deploy target; add check for deploy target to conditionally compile for new iOS 13 specific feature (custom keyboard)

* force disable core info caching for iOS, use opengl es2 for debug

* Add flag for iOS custom keyboard - 3-finger swipe up to show, 3-finger swipe down to hide

* use OpenGLES2 instead; using ES3 results in compile time errors on iOS 14.5

* code cleanup

* Updated references to -DDONT_WANT_ARM_ASM_OPTIMIZATIONS flag

* Add JIT support for non-jailbroken devices

* iOS: Add support for touch mouse handler

* Added a HAVE_IOS_TOUCHMOUSE preprocessor macro so that it builds under the iOS11_Metal xcode project

* Changed click-and-drag behavior to double tap hold and drag

* Visual improvements to the emulator keyboard: updated colors, improved key-press effect
2022-02-22 08:21:34 +01:00
Colin Kinloch b2527b43e8
(Wayland) Show window early to get screen info (#13591)
* (Wayland) Show window early to get screen info

* Report current monitor size on initial get_video_size call

* Fullscreen to monitor selected in settings

* Fullscreen on current monitor when setting is set to automatic

* Fallback to shm_open when memfd_create is not supported
2022-02-18 19:59:41 +01:00
Autechre b45a192416
Revert "(Wayland) Show window early to get screen info (#13582)" (#13590)
This reverts commit 4bb2c14293.
2022-02-01 12:47:53 +01:00
Colin Kinloch 4bb2c14293
(Wayland) Show window early to get screen info (#13582)
* Report current monitor size on initial get_video_size call

* Fullscreen to monitor selected in settings

* Fullscreen on current monitor when setting is set to automatic
2022-02-01 10:30:34 +01:00
Tony 6d5d2e722d
Logging cleanups (#13579) 2022-01-31 18:05:23 +01:00
Colin Kinloch a431760829
(Wayland) Release keys and mouse buttons on lost focus (#13567) 2022-01-29 19:57:06 +01:00
twinaphex 60eaf14afc C89_BUILDFIX 2022-01-29 10:55:31 +01:00
Dystopian 0afdb2a0cf
Improve udev logging (#13549) 2022-01-29 10:57:38 +01:00
Francisco Javier Trujillo Mata 86b47b4859
[PSP] Update Retroarch to latest PSPDev status (#13544)
* Added newlib changes

* Add action to launch PPSSPP simulator

* Remove legacy config for the stack and heap

* Add pthread

* Simplify kernel_functions and improve references to HAVE_KERNEL_PRX

* Add some flags

* Improve audio init/deinit

* Improve exit by clicking home

* Add CI for PSP1

* Update PSP.yml
2022-01-25 03:50:18 +01:00
Ryan Kuba 6ae1270e5c
remove test for standard mapping in controller detection (#13528) 2022-01-24 16:31:03 +01:00
Keith Bowes 38e74ee3cf
Restores mouse-grab toggling in Wayland. (#13537)
* Fixes mouse-grab toggling in Wayland.

Fixes #13536

* Indicate that input_wl_grab_mouse is a necessary function.

It might prevent it from being removed again in future cleanups.
2022-01-24 16:22:21 +01:00
twinaphex 5241d3e5d6 Cleanups 2022-01-20 06:09:43 +01:00
twinaphex cc756e4126 Silence some warnings 2022-01-19 19:08:22 +01:00
Dystopian 2095fc53f8
Fix webOS build and run (#13480) 2022-01-12 07:12:34 +01:00
Cthulhu-throwaway 9579810579
Build fix for --disable-menu (#13419) 2021-12-26 15:18:57 +01:00
Aleksey Samoilov f17deb90c7
[Wayland] Fix toplevel close (#13415) 2021-12-25 11:19:27 +01:00
Colin Kinloch 0168fe0303
(Wayland) Ignore mouse clicks on window decoration (#13412) 2021-12-25 04:08:22 +01:00
Colin Kinloch f0392474f2
(Wayland) Add libdecor for client side decoration (#13397) 2021-12-24 14:20:45 +01:00
twinaphex 393e42a497 (Wayland) Buildfix 2021-12-24 05:25:30 +01:00
Colin Kinloch c48d533950
(Wayland) Add scroll wheel support (#13398) 2021-12-24 03:42:33 +01:00
Nikos Chantziaras 0357b6c922
Add on-screen statistics toggle hotkey (#13381)
* Add on-screen statistics toggle hotkey

* CHANGES.md: Add technical statistics hotkey
2021-12-21 00:03:35 +01:00
Cthulhu-throwaway 690c802921
Netplay Stuff (#13375)
* Netplay Stuff

## PROTOCOL FALLBACK
In order to support older clients a protocol fallback system was introduced.
The host will no longer send its header automatically after a TCP connection is established, instead, it awaits for the client to send his before determining which protocol this connection is going to operate on.
Netplay has now two protocols, a low protocol and a high protocol; the low protocol is the minimum protocol it supports, while the high protocol is the highest protocol it can operate on.
To fully support older clients, a hack was necessary: sending the high protocol in the unused client's header salt field, while keeping the protocol field to the low protocol. Without this hack we would only be able to support older clients if a newer client was the host.
Any future system can make use of this system by checking connection->netplay_protocol, which is available for both the client and host.

## NETPLAY CHAT
Starting with protocol 6, netplay chat is available through the new NETPLAY_CMD_PLAYER_CHAT command.
Limitations of the command code, which causes a disconnection on unknown commands, makes this system not possible on protocol 5.
Protocol 5 connections can neither send nor receive chat, but other netplay operations are unaffected.
Clients send chat as a string to the server, and it's the server's sole responsability to relay chat messages.
As of now, sending chat uses RetroArch's input menu, while the display of on-screen chat uses a widget overlay and RetroArch's notifications as a fallback.
If a new overlay and/or input system is desired, no backwards compatibility changes need to be made.
Only clients in playing mode (as opposed to spectating mode) can send and receive chat.

## SETTINGS SHARING
Some settings are better used when both host and clients share the same configuration.
As of protocol 6, the following settings will be shared from host to clients (without altering a client's configuration file): input latency frames and allow pausing.

## NETPLAY TUNNEL/MITM
With the current MITM system being defunct (at least as of 1.9.X), a new system was in order to solve most if not all of the problems with the current system.
This new system uses a tunneling approach, which is similar to most VPN and tunneling services around.

Tunnel commands:
RATS[unique id] (RetroArch Tunnel Session) - 16 bytes -> When this command is sent with a zeroed unique id, the tunnel server interprets this as a netplay host wanting to create a new session, in this case, the same command is returned to the host, but now with its unique session id. When a client needs to connect to a host, this command is sent with the unique session id of the host, causing the tunnel server to send a RATL command to the host.
RATL[unique id] (RetroArch Tunnel Link) - 16 bytes -> The tunnel server sends this command to the host when a client wants to connect to the host. Once the host receives this command, it establishes a new connection to the tunnel server, sending this command together with the client's unique id through this new connection, causing the tunnel server to link this connection to the connection of the client.
RATP (RetroArch Tunnel Ping) - 4 bytes -> The tunnel server sends this command to verify that the host, whom the session belongs to, is still around. The host replies with the same command. A session is closed if the tunnel server can not verify that the host is alive.

Operations:
Host -> Instead of listening and accepting connections, it connects to the tunnel server, requests a new session and then monitor this connection for new linking requests. Once a request is received, it establishes a new connection to the tunnel server for linking with a client. The tunnel server's address and port are obtained by querying the lobby server. The host will publish its session id together with the rest of its info to the lobby server.
Client -> It connects to the tunnel server and then sends the session id of the host it wants to connect to. A host's session id is obtained from the json data sent by the lobby server.

Improvements (from current MITM system):
No longer a risk of TCP port exhaustion; we only use one port now at the tunnel server.
Very little cpu usage. About 95% net I/O bound now.
Future backwards compatible with any and all changes to netplay as it no longer runs any netplay logic at MITM servers.
No longer operates the host in client mode, which was a source of many of the current problems.
Cleaner and more maintainable system and code.

Notable functions:
netplay_mitm_query -> Grabs the tunnel's address and port from the lobby server.
init_tcp_socket -> Handles the creation and operation mode of the TCP socket based on whether it's host, host+MITM or client.
handle_mitm_connection -> Creates and completes linking connections and replies to ping commands (only 1 of each per call to not affect performance).

## MISC
Ping Limiter: If a client's estimated latency to the server is higher than this value, connection will be dropped just before finishing the netplay handshake.
Ping Counter: A ping counter (similar to the FPS one) can be shown in the bottom right corner of the screen, if you are connected to a host.
LAN Discovery: Refactored and moved to its own "Refresh Netplay LAN List" button.

## FIXES
Many minor fixes to the current netplay implementation are also included.

* Remove NETPLAY_TEST_BUILD
2021-12-19 16:58:01 +01:00
arpruss e5e6f343ac
convert abs mouse from screen to viewport coordinates; fix relative m… (#13258)
* convert abs mouse from screen to viewport coordinates; fix relative mouse code to work in screen mode

* C89 compatibility

* revert accidental include
2021-12-18 17:52:27 +01:00
Tony 8cc423e036
Logging cleanups (#13370) 2021-12-17 18:04:24 +01:00
Francisco Javier Trujillo Mata 1cd0938cc3
[PS2] Improve Compilation (#13359)
* Allow parallel compilation in PS2

* Allow to compile with griffin or common compilation in PS2

* Enable dummy core to be used in other platforms

* Use threads in YML config

* Add the compilation to PS2 in GitHub Actions
2021-12-15 19:01:56 +01:00
twinaphex bfeffb2423 Fix local header path includes 2021-12-04 16:11:02 +01:00
gblues bf9706395d
Fix gamepad disconnect on unrecognized HID device (#13321)
== DETAILS
So, the reason the gamepad was getting deregistered was
because adapter free code wasn't properly handling null-interface
adapters, causing the gamepad to match erroneously and get
deregistered.

This doesn't fix the weird "Generic SNES USB" detection issue,
but it should make it non-fatal.

Co-authored-by: Nathan Strong <nstrong@tripwire.com>
2021-12-04 12:43:58 +01:00
gblues 1dd15ac516
WIIU: Fix keyboard support (#13308)
== DETAILS
The problem was caused by changing the driver lookup point. The deferred
lookup resulted in the WIIU trying to treat the keyboard as a gamepad which ...
didn't work.

This change short-circuits at the connection event by ignoring mouse &
keyboard connection events.

Tested this with a dev build.

Co-authored-by: Nathan Strong <nstrong@tripwire.com>
2021-12-02 12:43:19 +01:00
Aaron Ramirez 97f3fca139
Fixes a bug where the Gyroscope and Accelerometer would not be re-enabled when the app regains focus or is resumed. (#13298) 2021-11-29 16:53:13 +01:00
twinaphex b4137915e8 Move code to proper locations 2021-11-23 16:58:36 +01:00
twinaphex c2c36177b8 Move two variables to input_driver.c 2021-11-22 15:26:54 +01:00
Autechre 2b87cd9313
Create runloop.c and split up runloop code to this new file; (#13269)
* Create runloop.c and split up runloop code to this new file;
retroarch.c now 207Kb and runloop.c 301Kb

* Define empty runloop_secondary_core_destroy
2021-11-22 03:27:23 +01:00
Tomáš Kelemen (vudiq) 0cf437e375
Lakka/Nintendo Switch: disable rumble gain
Rumble gain breaks controlls on Nintendo Switch port of Lakka, probably
due to issue in the driver).

Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-06-switch_disable_rumble_gain.patch
2021-11-18 00:36:11 +01:00
Jean-André Santoni 6a99832a4d
Lakka: Patch to fix keyboard typing
Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-01-xkb-fix.patch
2021-11-18 00:36:11 +01:00
twinaphex efa16a8fca Revert "(Netplay) Cthulhu88 -"
This reverts commit cb4028fd3d.
2021-11-12 19:00:42 +01:00
twinaphex 86f899c844 Revert "Shorten character arrays that are passed to fill_pathname_base_noext"
This reverts commit 318108ac82.
2021-11-10 08:22:19 +01:00
twinaphex cb4028fd3d (Netplay) Cthulhu88 -
* Netplay Chat menu
* Toggleable bind for chat (bound to ~ [tilde] by default)
2021-11-10 02:41:02 +01:00
twinaphex 318108ac82 Shorten character arrays that are passed to fill_pathname_base_noext 2021-11-10 00:09:33 +01:00
twinaphex 619398bbe4 Backport parts of 73c0760236 2021-11-09 23:12:57 +01:00
twinaphex f4c5852cfa Move state from global_t to input_state_t 2021-11-09 06:27:43 +01:00
twinaphex f671ce4f8c Move global->name to runloop_st 2021-11-09 06:03:00 +01:00
twinaphex 88c771fc66 Cleanups 2021-11-07 01:44:45 +01:00
twinaphex c0585fed60 (winraw_input.c) Cleanups 2021-11-06 15:07:35 +01:00
twinaphex 61d30cdc31 Move input code from retroarch.c to input_driver.c 2021-11-06 04:34:54 +01:00
grant2258 1ae36ee9a7
udev fix dolphinbar and safeguard against not adding devices with no mouse or touch buttons detected (#13143)
* udev fixes

* updates

* small updates

* fix condition

Co-authored-by: grant2258 <you@example.com>
2021-11-05 23:59:17 +01:00
twinaphex db9283b57c Silence some warnings 2021-11-05 04:49:26 +01:00
twinaphex 21beb6064a Silence some warnings 2021-11-05 03:58:26 +01:00
Jamiras 088aa7dcb9
add github action for c89 build (#13186)
* add retroarch.yml

* fix c89 errors

* attempt to add dependencies

* update comments
2021-11-05 00:05:13 +01:00
twinaphex 1a78d91348 MSVC buildfix 2021-11-03 16:50:41 +01:00
Autechre 80e0114ccf
Move collect_system_input to input_driver.c (#13183) 2021-11-03 16:48:57 +01:00
gblues 1ef78d3e3d
Any pad can control the menu (#13173)
* Any pad can control the menu

== DETAILS
I am not sure I've quite got it so that any pad can *open* the
menu, but I do have it so any pad can control it.

- split out the input processing into a separate method
- track down and squish some hairy bugs that boiled down to
  bad pointer math
- it looks like `menu_driver.c` has a mix of line endings, so I
  ran it through `dos2unix` so it has consistent line endings
  again.
- verified that this change did not impact actual cores

* optimize out cumulative_bits

* Incorporate PR feedback

Many thanks to @jdgleaver for providing these optimizations.

* apply one more optimization
2021-11-03 16:32:15 +01:00
twinaphex 5ec93d2493 (HID) Fix some warnings 2021-10-20 02:23:01 +02:00
twinaphex 1dc77507a8 Fix command stdin - courtesy of Cthulhu 2021-10-19 22:23:07 +02:00
Autechre 514534f99b
Move more state to runloop_state (#13124)
* Move more state to runloop state

* remove unused variable

* Cleanup

* Move more state to runloop_state

* Remove unused variable

* Cleanups

* move input_remapping functions over to input_driver.c

* Some buildfixes
2021-10-18 15:23:22 +02:00
grant2258 6e8a3945d5 add extra abs check for dolphinbar 2021-10-18 03:43:49 +01:00
Nathan Strong 12a44e0365 Fix crashes reported by ploggy
== DETAILS

The crashes he reported in the gbatemp thread are due to iface
being null (since it's an unsupported device) and unchecked
iface dereferences.
2021-10-17 00:13:48 -07:00
Nathan Strong 5b4b766459 Fix wiimotes regression
== DETAILS
- only call disconnect when we're actually disconnecting a remote
  (e.g. read errors or remote goes to sleep).
- clean up some compile warnings introduced by others (mainly
  unused variables)
2021-10-16 23:56:15 -07:00
Nathan Strong 81c6d3809a Finish up the OSX DS3 driver
== DETAILS
Put the finishing touches on getting the DS3 to work on Mac OSX.

Basically, there's some differences in the HID interface bewtween
wiiu and osx where OSX expects the first byte of the report to be
the report ID, while wiiu expects that byte to be trimmed off.

I was able to put this behavior in the respective HID
implementations, which eliminated the confusing packet offset
ifdefs.

And, I was able to get the LEDs working again.
2021-10-16 14:52:56 -07:00
Nathan Strong 729c219f1a Rewrite DS3 driver
== DETAILS
The DS3 driver previously only worked with the Wii U HID implementation.

I adapted this driver from the Linux driver for the DS3. It's not quite
100%--I haven't got the LEDs to work properly--but it's functional.

Going to continue tweaking it to see if I can get the LEDs to work.
2021-10-16 14:52:56 -07:00
Nathan Strong 7ed3ca7f97 WIP commit
Start trying to adapt the linux DS3 driver instead of our
hacked-together support.
2021-10-16 14:52:56 -07:00
Autechre c1b002e454
Merge pull request #13125 from grant2258/mouse
Udev pointer pressed update to support relative devices pointer pressed
2021-10-16 22:10:36 +02:00
grant2258 1fca7507dc cleanup 2021-10-16 19:36:35 +01:00
grant2258 a68e5205bd add relative left mouse button when pointer device is not abs 2021-10-16 19:26:40 +01:00
twinaphex 9184d0e114 Move hid_data to input_st 2021-10-15 16:31:31 +02:00
twinaphex f070da6dfc Move code to menu_driver.c and input_driver.c 2021-10-13 15:40:01 +02:00
Autechre 0a888f7868
Move video state to gfx/video_driver.c - reduces filesize of retroarch.c to 809kb (#13104)
* Move video state to gfx/video_driver.c - reduces filesize of retroarch.c
to 809Kb
2021-10-13 14:56:22 +02:00
jdgleaver f1ac1ad9f9 (Dingux) Fix HAS_ANALOG/HAS_MENU_TOGGLE defines in sdl_dingux joypad driver 2021-10-13 12:53:54 +01:00
Kirby Kevinson 177d05144a
Fix keyboard input on Wayland (#13102)
Fixes #13036
2021-10-11 13:20:41 +02:00
gblues dd6c70a083
Fix a couple regressions (#13101)
== DETAILS

- rewrote the HID deregistration algorithm; it should no longer
  cause issues when dealing with multiple pads of the same HID/VID
  combo
- fix initialization bug that caused wiimotes to fail to register
  without an accessory attached
2021-10-11 09:39:13 +02:00
twinaphex bcc7581250 (joypad_connection.c) Cleanups - style nits - comment out some logs
that were generating warnings
2021-10-09 16:19:54 +02:00
Salvador 58e7dd8a1a
Add Miyoo target (#12860)
* add miyoo target
2021-10-08 13:53:49 +02:00
twinaphex 3d710db798 input_state_wrapper symbol name was causing collisions with certain
cores on statically linked platforms
2021-10-08 12:50:45 +02:00
twinaphex e39bc07e31 Fix implicit declaration 2021-10-08 06:57:37 +02:00
Nathan Strong ea249b3827 Get the WIIU GCA working on Mac OSX
== DETAILS
The GCA uses a weird HID class that our current filters don't
catch, so we add it.

Needed to do a small amount of tweaking on the GCA driver to
account for iohidmanager weirdness.
2021-10-06 23:11:22 -07:00
Autechre 3f179a5762
Merge pull request #12632 from Sunderland93/remove-xdg-shell-v6
[Wayland] Remove xdg-shell-v6 protocol
2021-10-07 05:10:53 +02:00
Autechre 54cbeecbb7
Merge pull request #13075 from libretro/move-more-code-to-input-driver
Move more code over to input_driver.c
2021-10-06 12:38:21 +02:00
Nathan Strong 01e96585a3 Fix crash when connecting DS3 to Mac
== DETAILS
The OSX HID driver doesn't implement `set_protocol()` and crashes
with an NPE, so we guard it.
2021-10-05 23:57:09 -07:00
twinaphex 61ee2274e6 Move more code over to input_driver.c - BSV code in particular but
also input state function callbacks - retroarch.c code size reduced
to 874Kb
2021-10-06 05:57:39 +02:00
twinaphex 55bf2b0083 (input/connect) Style nits 2021-10-06 02:52:19 +02:00
twinaphex f81a231481 (joypad_connection) Cleanups - get rid of warning for old-style function
definition
2021-10-06 02:28:55 +02:00
Nathan Strong e8ec65ecf7 squelch format warning 2021-10-05 19:05:12 +00:00
Nathan Strong 3e91e3fbc9 fix up non-wiiu side of ifdefs for ds3 2021-10-05 18:15:19 +00:00
Nathan Strong 002c9a30c0 Implement button() for most HID drivers
== DETAILS
The HID drivers in `input/connect/` were missing an implementation
for button(), so I added it. The only exception is the wii driver,
which is really complicated and more than I wanted to try to tackle--
especially since WIIU has its own wiimote drivers.
2021-10-05 17:43:03 +00:00
Nathan Strong e02e345a28 Make GCA driver compatible with other HID drivers
== DETAILS
Use a little trickery to ensure the GCA driver continues working
with other HID implementation.

I've expanded the joypad implementation to support multi-pad devices.
However, this requires changes to each HID implementation to actually
function.

I've made the necessary changes for WIIU, but I don't have the means
of making the change in the other HID implementations.

So, I've built in a backwards-compatibilty mode for the driver.

The trick is to have an identifier byte at the top of both data structs
that the driver returns. We can then use that byte to determine which
of the structs has been passed to the pad functions and act accordingly.

In the GCA case, for non-wiiu platforms, it will simply expose port 1
of the GCA and the other 3 ports do nothing.
2021-10-05 09:47:03 -07:00
Nathan Strong 2715b4c9c0 get gamecube adapter working 2021-10-05 09:23:08 -07:00
Nathan Strong c832828ddb Figured out the cause of crash
== DETAILS
cause of crash: trying to deference init when it's null
the reason it was going into deregister: the HID/VID lookup was
failing because it wasn't getting initialized first
cause of 2nd crash: the "end of pad list" method looked for an entry
with a magic value, so we add an end marker
2021-10-05 09:23:08 -07:00
Nathan Strong a4d8ce7753 Try to support multi-pad HID devices
== DETAILS
I tried to modify the joypad connection interface to support
multi-pad HID devices ... it doesn't work. I'm not sure why.
2021-10-05 09:23:08 -07:00
Nathan Strong 9846ebb171 enable GCA adapter, minor cleanup
== DETAILS

I'm going to need to re-implement the abstraction between HID device
and gamepad; the changes here lay down some foundation for that work.

- reduce logging priority of some statements I modified while debugging
- factor out the pad driver lookup into its own method
- fix so the pad driver list isn't re-initialized every invocation
- add the button() method for the GCA driver
2021-10-05 09:23:08 -07:00
Nathan Strong 5da1cd08ff Unify the HID driver architecture
== DETAILS
When I first implemented the Wii U HID architecture, I ended up
having to design my own implementation because, at the time, I did
not have a way to read the HID device string to allow the existing
code to successfully detect the gamepad.

After spending some time experimenting, I've figured out how to
do this. And that means I can better align the HID driver with other
platforms.

change summary:

- create a single state structure for all three sub-types of wiiu pads
  (kpad, wpad, and hid)
- eliminate confusing duplicate pad lists
- eliminate confusing duplicate HID pad drivers (ds3, gamecube
  adapter, etc)
- ensure the ds3 driver still works
2021-10-05 09:23:08 -07:00
Nathan Strong 9edb449471 wip commit 2021-10-05 09:10:41 -07:00
p-sam 54d2ac9f43 libnx: Splitted Joycons button mapping
- Minus/Plus is always Plus when splitted (JOYPAD_START)
- StickR/StickL is always StickL when splitted (JOYPAD_L3)
2021-10-01 20:18:54 +02:00
twinaphex fde3406d1b Get rid of input_event_get_osk_ptr/get_osk_grid 2021-10-01 07:37:33 +02:00
Autechre 8807e2957e
Input refactors pt3 (#13053)
* Move more internal state over to input_driver.c and menu_driver.c -
retroarch.c now down to 893kb
- Remove now unused p_rarch pointers in functions
2021-10-01 07:18:30 +02:00
twinaphex e9a4e811ac Move more code and variables from rarch_state out to input_driver
and menu_driver
2021-10-01 00:41:50 +02:00
twinaphex 49fbed2423 Get rid of input_mouse_grabbed - move retroarch types to
retroarch_types.h
2021-09-30 23:22:50 +02:00
twinaphex 12c81bc073 Replace input_state_get_ptr call 2021-09-30 21:31:37 +02:00
twinaphex dbe414e1e1 move input_poll_overlay to input_driver.c 2021-09-30 21:29:35 +02:00
twinaphex ddceb51f89 Get rid of some needless getters/setters 2021-09-30 21:10:12 +02:00
twinaphex ef875f6102 Create input_state_get_ptr - move to input_driver.c -
also moved over the functions that had a dependence on this
state - retroarch.c reduced to 979kb now
2021-09-30 20:54:56 +02:00
twinaphex e886e908d5 Create consistent naming conventions - use retroarch_ instead
of rarch_ for some functions for all functions coming from retroarch.h
2021-09-28 12:56:10 +02:00
twinaphex 8ef9065c86 Get rid of menu_driver_is_alive - we don't want these one/two-line getters/setters anymore 2021-09-28 10:27:00 +02:00