Commit Graph

4404 Commits

Author SHA1 Message Date
libretroadmin 3f3262fba3 (PS3) Cleanups - don't assume GLSL is the default shader for PSL1GHT 2023-02-23 10:43:33 +01:00
LibretroAdmin 491c495249
Unify ps3 (#15014)
* Unify PS3 input driver

* Fix builds

* Add missing variable

* (PS3/Keyboard) Add more missing defines
2023-02-23 00:35:46 +01:00
OsirizX c0ccb8cda3
(PSL1GHT) Code cleanup (#15006)
* (PSL1GHT) Use RSX_SHADER_STOCK_BLEND and RSX_SHADER_MENU defines

* (PSL1GHT) Cleanup compiler warnings

* (PSL1GHT) Make sure we compile with librt
2023-02-22 08:14:38 +01:00
serakeri e0c9781b50
(MFi) Prevent crash when controller player index is unset (-1) (#14999) 2023-02-21 06:10:00 +01:00
serakeri 347ea8157c
Various memory access fixes to prevent crashes (#14459) (#15000)
Prevent double free and null dereference when the controller is quickly reconnected.
Handle error when controller device query returns null instead of crashing.
2023-02-21 06:09:36 +01:00
libretroadmin 35fa25bed6 (PS3) Start turning PS3 input drivers more the same 2023-02-20 18:09:57 +01:00
libretroadmin 761b87a61b (MFi) Get rid of warning 2023-02-20 16:54:50 +01:00
libretroadmin 03096cbda7 (MFi) Get rid of warning 2023-02-20 16:51:15 +01:00
libretroadmin 33ba9777a0 (MFi) Fix typo 2023-02-20 16:47:42 +01:00
libretroadmin a6c19b083a (MFi) Should fix MFi input issue - also took the time to refactor some code 2023-02-20 16:46:04 +01:00
libretroadmin 2ee501809e (PSL1GHT) turn public functions static 2023-02-20 16:24:32 +01:00
libretroadmin 4620b55476 (RSX/PSL1GHT) Cleanups and getting rid of warnings - array bounds exceeding
was troublesome so bumped up max shaders to 10 for now, some style nits in
RSX video driver, variable center_y could be uninitialized so fixed that
in psl1ght_input.c
2023-02-20 16:13:23 +01:00
libretroadmin 07c073b717 (PSL1GHT) Don't redefine MAX_MICE define 2023-02-20 15:35:00 +01:00
libretroadmin a4dda41739 (PSL1GHT) Buildfixes/warning fixes 2023-02-20 15:33:54 +01:00
libretroadmin b872de4fb1 (PSL1GHT) Fix some warnings 2023-02-20 14:50:54 +01:00
libretroadmin 2d2d96660a Cleanups 2023-02-20 13:21:17 +01:00
libretroadmin 66aebcabea (input drivers) Cleanups 2023-02-20 12:54:26 +01:00
libretroadmin 334cb3d5d4 (joypad drivers) Cleanups 2023-02-20 10:46:28 +01:00
libretroadmin 52a800a520 (Wayland input) Cleanups 2023-02-20 10:26:14 +01:00
libretroadmin 93de4f3c4f (Joypad drivers) Cleanup dos_joypad.c 2023-02-20 10:18:48 +01:00
libretroadmin 6f26f37cec Simplify axis state code for joypad drivers 2023-02-20 10:10:07 +01:00
libretroadmin 5ae2b9f753 (UWP) Cleanups/style nits
(Joypad drivers) Cleanup/slim down axis code
2023-02-19 19:32:05 +01:00
libretroadmin 8b200f552d Simplify axis state code of other input joypad drivers 2023-02-19 19:05:32 +01:00
libretroadmin e367f87767 Simplifications to axis_state functions for some driver joypad files 2023-02-19 18:42:40 +01:00
libretroadmin da51b441f4 (wiiu_hid) More buildfixes 2023-02-19 13:20:09 +01:00
libretroadmin 94745eaf31 (WiiU) wiiu_hid - buildfixes 2023-02-19 13:01:11 +01:00
libretroadmin e1521dd86d (X11 input) Silence warning 2023-02-19 12:44:04 +01:00
libretroadmin 42a0618812 (udev_joypad.c) Cleanups 2023-02-19 12:42:06 +01:00
libretroadmin 96d39a78cc (Wayland) Silence implicit declaration warnings 2023-02-19 12:29:07 +01:00
reallibretroadmin 78e935b7a9 (IOHIDManager) Buildfix 2023-02-19 12:20:11 +01:00
libretroadmin 6728d5a2fa (Subsystem) Cleanups 2023-02-19 12:15:45 +01:00
libretroadmin 1d9cb216ca Silence some warnings/LTO issues 2023-02-19 10:21:37 +01:00
libretroadmin 4d305bf3e8 Buildfixes for Android and Wayland 2023-02-19 10:09:50 +01:00
libretroadmin 963bb92f95 (Input) Style nits/code simplifications 2023-02-19 06:30:14 +01:00
warmenhoven c242586ea7
tvOS improvements (#14983)
The initial popup screen advertising the web server did not prevent
keys from passing through, so interactions with the alert would also
be handled by the menu. The alert would pop up any time there was a
network reconfiguration; now it only pops up once per run. Added a way
to turn off the webserver advertisement alert permanently.

Also fixed a bug around filtering the Siri remote out, and turning
controllers off while the app is running.
2023-02-15 11:59:06 +01:00
warmenhoven c52d3484eb
Fix turning off rumbling (#14979) 2023-02-14 20:37:16 +01:00
warmenhoven c3526132ad
iOS9/iOS11 build fix: Link against CoreHaptics (#14977)
Also address a couple warnings
2023-02-14 05:35:38 +01:00
warmenhoven 5685b5a9a1
mFI on OSX (#14975)
This adds mFI as a controller driver for OSX, as well as adding rumble
support for mFI controllers. Also add support for the Home button.

Also fixed a couple warnings.
2023-02-13 21:49:35 +01:00
OsirizX 0549223677
(PSL1GHT) Add improvements to the RSX driver (#14965)
* remove var error in psl1ght input

* (psl1ght) add modern_alpha_blend and modern_opaque rsx shaders

* (psl1ght) add perf improvements to the rsx driver

* add rsx gfx for psl1ght

* (psl1ght) set rsx as a compatible video driver

* Do xmb menu scaling for psl1ght

* (psl1ght) update Makefile to use latest shaders and more UI menu options
2023-02-10 08:29:45 +01:00
Joe Osborn 155e99b92c
add keyboard recording support to bsv (#14933)
* add keyboard recording support to bsv

BSV movies recorded in older RA *WILL NOT* replay properly after this
patch.  While looking to see if the core actually uses a keyboard
device could mitigate this, it is an unavoidable consequence of using
BSV, a format which carries no metadata whatsoever.

* Fix for loop declarations and some whitespace

---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-02-01 00:22:00 +01:00
Joe Osborn 5dbdde4316
BSV ergonomics improvements (#14929)
* BSV ergonomics improvements

- Date stamp toggled recordings instead of overwriting or using save
slot number
- Properly stop movie on playback EOF; also pause emulation
- Add recording flag to match playback flag in bsv state enum
- Rename bsv "movie path" to "movie auto path" to clarify role
- Allow stopping movie playback before EOF using record toggle hotkey
---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-31 05:34:26 +01:00
sonninnos a055bcd16b
Do not block input overlay hotkeys (#14923) 2023-01-29 14:52:03 +01:00
warmenhoven 2946e6704b
Fix a crash in for BT HID devices. (#14922)
pad_connection_destroy() frees slots, no need to free it again.
2023-01-29 14:51:36 +01:00
Joe Osborn 951f5a76a5
Add bsv to emscripten builds (#14905)
* Add bsv to emscripten builds

BSV has no external dependencies so this addition should be fine.

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-26 05:46:39 +01:00
Joe Osborn f149519351
Allow for both -e and -R to start a BSV file recording at a state (#14898)
* Allow for both -e and -R to start a BSV file recording at a state

The key issue is that loading a state takes some time, and the BSV
recording shouldn't start until that's done.

The minimal patch for this would just be a change to runloop.c which
moves movie initialization after entry state loading, throwing in a
task_queue_wait().  This makes for some awkward repeated autoload OSD
messages and doesn't solve the underlying issue.

Most of this change puts BSV recording start/stop into tasks, like
saving and loading are tasks; this was important to centralize BSV
operations a bit more and is the first part of a refactoring towards
more robust input recording.  The necessary wait is introduced in the
begin-recording callback.

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-25 07:15:32 +01:00
libretroadmin a8c43daef6 Addendum - no additional whitespace - already done beforehand 2023-01-22 17:35:49 +01:00
libretroadmin 610194e805 input_config_get_bind_string_hotkey - snprintf concatenation
so we don't repeat the same formatting for every switch case
statement
2023-01-22 17:34:12 +01:00
libretroadmin 01c3684b10 Cleanups - try to remove stdio.h include where possible 2023-01-21 22:25:38 +01:00
Joe Osborn baa14ae213
Fix #14870 (#14871)
* Don't start video recording when BSV recording starts

* Don't double-record inputs in BSV recording

- Will this work properly with the part of input handling outside of
input_state_wrap? Who knows?

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-20 18:20:10 +01:00
sonninnos b8bcce98c3
(WIN32) Restore zero key event characters (#14848) 2023-01-15 09:00:47 +01:00
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