Commit Graph

614 Commits

Author SHA1 Message Date
german77 22eb8ce395 yuzu: Add ring controller test button 2023-01-19 18:05:22 -06:00
german77 5cbeb6f1c4 input_common: Use DriverResult on all engines 2023-01-19 18:05:22 -06:00
german77 82774f546a Address review comments 2023-01-19 18:05:22 -06:00
Narr the Reg 8dbef30cb7 core: hid: Fix input regressions 2023-01-19 18:05:22 -06:00
german77 b40c5ba2c3 input_common: Implement joycon nfc 2023-01-19 18:05:21 -06:00
Narr the Reg 4dc4ae2aac input_common: Add dual joycon support 2023-01-19 18:05:21 -06:00
Narr the Reg 4d68a82563 input_common: Add support for joycon ring controller 2023-01-19 18:05:21 -06:00
Narr the Reg 046e95be06 input_common: Add support for joycon input reports 2023-01-19 18:05:21 -06:00
Narr the Reg f7164f77d6 input_common: Use calibration from joycon 2023-01-19 18:05:21 -06:00
Narr the Reg d2f5eae036 input_common: Add support for joycon generic functions 2023-01-19 18:05:21 -06:00
Narr the Reg 147faa16ef input_common: Add joycon low level functions 2023-01-19 18:05:21 -06:00
Narr the Reg 59e89afde4 core: hid: Enable pulling color data from controllers 2023-01-19 18:05:20 -06:00
Narr the Reg 216bdb7884 input_common: Disable SDL driver with switch controllers 2023-01-19 18:05:20 -06:00
Narr the Reg 0e41ae9595 input_common: Initial skeleton for custom joycon driver 2023-01-19 18:05:20 -06:00
german77 924d8bf7cc input_common: reset sdl motion if data is invalid 2023-01-18 10:05:55 -06:00
bunnei c45b1d8723 Merge pull request #9605 from german77/mouse_mapping
yuzu: Read mouse scroll
2023-01-10 17:32:58 -08:00
Narr the Reg b6721a40fe yuzu: Read mouse wheel input 2023-01-10 18:20:58 -06:00
liamwhite 067831de41 Merge pull request #9565 from MonsterDruide1/tas-multiplayer-lengths
TAS: Show all script lengths for multiplayer
2023-01-10 15:26:36 -05:00
MonsterDruide1 a1bec20a60 TAS: Show all script lengths for multiplayer 2023-01-07 21:15:37 +01:00
Narr the Reg 243f2931b5 input_common: Create an update engine 2023-01-05 19:24:29 -06:00
Liam 41ba0d07e6 cmake: make libusb optional 2022-12-28 17:26:46 -05:00
liamwhite 76eb7c725f Merge pull request #9471 from german77/input
input_common: Cleanup project
2022-12-19 11:09:00 -05:00
german77 f7790b5e3b input_common: Cleanup project 2022-12-18 15:33:11 -06:00
german77 7510f5971a bootmanager: Use proper camera size 2022-12-18 00:13:18 -06:00
bunnei 771e450bcc Merge pull request #9456 from german77/virtual_gamepad
input_common: Add virtual gamepad
2022-12-17 17:16:13 -08:00
german77 3cc666b845 input_common: Add virtual gamepad 2022-12-16 18:26:11 -06:00
ameerj 2d9fc5d05b camera: Use pre-allocated vector for camera data
And avoid an unnecessary copy
2022-12-16 18:00:47 -05:00
Narr the Reg 0476f77e9c input_common: Filter SDL GUID 2022-12-12 10:37:55 -06:00
liamwhite ec6bca7a6f Merge pull request #9391 from abouvier/cmake-sdl
cmake: use sdl2 imported target
2022-12-06 09:58:48 -05:00
Alexandre Bouvier 87fef2c12c cmake: prefer system libusb 2022-12-06 05:30:40 +01:00
liamwhite 6a546be6b2 Merge pull request #9369 from german77/mifare
service: nfc: Implement mifare service
2022-12-05 22:17:32 -05:00
Alexandre Bouvier 75f9183846 cmake: use sdl2 imported target 2022-12-06 01:26:30 +01:00
Narr the Reg 2679dc707e input_common: Allow mifare files 2022-12-04 20:02:48 -06:00
liamwhite c53a3d3f37 Merge pull request #9300 from ameerj/pch
CMake: Use precompiled headers to improve compile times
2022-12-03 14:10:06 -05:00
liamwhite e20c5a0b7f Merge pull request #9289 from liamwhite/fruit-company
general: fix compile for Apple Clang
2022-12-03 12:09:21 -05:00
ameerj fb155dbffc CMake: Consolidate common PCH headers 2022-11-30 18:30:30 -05:00
Morph 544d8df4b2 Merge pull request #9349 from lat9nq/cmake-322
CMakeLists: Bump minimum required CMake version to 3.22
2022-11-29 19:41:47 -05:00
ameerj bbf3e7f313 CMake: Use precompiled headers 2022-11-29 18:50:49 -05:00
liamwhite 994e446168 Merge pull request #9322 from german77/pump_events
input_common: Pump SDL events from main thread
2022-11-29 18:45:25 -05:00
lat9nq 868c5ca1cb CMake: Directly link to SDL2-static when appropriate
Trying to be lazy and alias SDL2 to SDL2-static causes issues in later
versions of CMake. Just use the same condition to tell which one to use.
2022-11-28 23:21:14 -05:00
Morph 65b9694ec7 Merge pull request #9338 from lioncash/properties
input_common/helpers: Mark analog property structs members as static constexpr
2022-11-28 13:12:14 -05:00
Lioncash 23e85d2d85 input_common/helpers: Mark analog property structs members as static constexpr
These are const with no dependency on any other data members, so we can
make these static constexpr to reduce the overall object size.
2022-11-28 10:10:37 -05:00
Lioncash 0862aabdc6 common/input: Add helpers functions for creating input and output devices
Avoids the redundancy of needing to explictly specify the common
namespace and the type.
2022-11-28 10:00:37 -05:00
german77 cddbfe5e67 input_common: Pump sdl events from main thread 2022-11-27 11:09:40 -06:00
german77 23d7d8b9df yuzu-cmd: Fix input callback crash on close 2022-11-27 10:53:22 -06:00
Liam 5a712bb51a general: fix compile for Apple Clang 2022-11-22 22:22:28 -05:00
bunnei 914f824b1f Merge pull request #9238 from german77/cabinet_applet
service: am: Implement cabinet applet
2022-11-20 00:48:39 -08:00
Narr the Reg 8e0e45dcb9 core: hid: Implement true multitouch support 2022-11-19 08:44:33 -06:00
german77 9639d49ec6 general: Address review comments 2022-11-13 17:13:43 -06:00
german77 7328e78385 input_common: Add amiibo applet functions 2022-11-13 10:56:54 -06:00
liamwhite f25243fd9d Merge pull request #9107 from german77/gidoly_rules
input_common: cache vibration tests
2022-10-25 12:13:18 -04:00
Morph dc61af8eb1 CMakeLists: Remove redundant warnings
These warnings are already included in /W3.
2022-10-22 15:02:04 -04:00
Morph ea5b59b539 CMakeLists: Treat MSVC warnings as errors 2022-10-22 15:02:04 -04:00
Morph 9fba74d245 general: Enforce C4800 everywhere except in video_core 2022-10-22 15:02:04 -04:00
Morph 4bad20dc5f CMakeLists: Remove all redundant warnings
These are already explicitly or implicitly set in src/CMakeLists.txt
2022-10-22 15:02:04 -04:00
german77 96881efdc3 input_common: cache vibration tests 2022-10-21 00:24:08 -05:00
german77 36d02d1fc3 input_common: have an unique vector in callback status 2022-10-09 12:49:18 -05:00
Liam 47fc168030 common: remove "yuzu:" prefix from thread names 2022-10-03 18:43:56 -04:00
german77 d389a05005 service: nfp: address comments 2022-10-02 12:32:26 -05:00
german77 004f8f9512 input_common: Enable virtual amiibo driver 2022-10-02 12:32:26 -05:00
german77 56b1301938 input_common: Create virtual amiibo driver 2022-10-02 12:32:26 -05:00
bunnei 7dc3d49135 Merge pull request #8864 from german77/toggle_analog
input_common: Add support for analog toggle
2022-09-09 20:54:01 -07:00
Narr the Reg d4fb46d8f9 input_common: Add support for analog toggle 2022-09-06 11:21:28 -05:00
Narr the Reg 2d6690468b input_common: sdl: Always check for motion on reconnect 2022-09-03 17:52:57 -05:00
Andrea Pappacoda 6a2efdda2f chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.

Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.

The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.

Following REUSE has a few advantages over the current approach:

- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
  `.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
  files like binary assets / images is always accurate and up to date

To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.

[REUSE]: https://reuse.software

Follow-up to b2eb103829
2022-07-27 12:53:49 +02:00
FearlessTobi 846c50dd42 Address first part of review comments 2022-07-25 21:59:30 +02:00
german77 76b18ad549 input_common: Add camera driver 2022-07-23 19:38:42 -05:00
german77 93cbaeb605 input_common: sdl: lower vibration frequency and use it's own unique thread 2022-06-28 19:22:16 -05:00
Mai bb0a6faa0a Merge pull request #8383 from Morph1984/shadow-of-the-past
yuzu: Make variable shadowing a compile-time error
2022-06-14 21:08:58 -04:00
Morph e647661b76 CMakeLists: Make variable shadowing a compile-time error
Now that the entire project is free of variable shadowing, we can enforce this as a compile time error to prevent any further introduction of this logic bug.
2022-06-13 18:19:23 -04:00
Narr the Reg d061038994 input_common: Replace usage of string guid to common uuid 2022-06-06 19:56:37 -05:00
bunnei e135944c4d Merge pull request #8374 from german77/asnycvibrations
input_common: Make vibration request async
2022-05-28 00:55:53 -07:00
Narr the Reg 3cd7b067e0 input_common: Make vibration request async 2022-05-23 12:25:02 -05:00
german77 b6d3a7d8cf input_common: touch: Rewrite touch driver to support multiple touch points 2022-05-23 11:01:14 -05:00
bunnei 08fc849458 Merge pull request #8272 from german77/stick_range
yuzu: config: Improve analog stick mapping
2022-05-03 14:36:39 -07:00
Morph 5ec38a7cb9 Revert "gc_adapter: fix libusb import on GCC11.2"
This reverts commit 6e1eea8897.
2022-05-02 04:23:39 -04:00
Levi Behunin 6e1eea8897 gc_adapter: fix libusb import on GCC11.2
Just to silence an intermittent error.
GCC11.2 complains cannot find 'libusb.h' during a fresh build.
2022-05-02 03:46:48 -04:00
Andrea Pappacoda b2eb103829 chore: add missing SPDX tags
Follow-up to 2b87305d31
2022-04-28 18:24:11 +02:00
Narr the Reg d0bdbb9afb yuzu: config: Set default range to 95% 2022-04-26 19:03:54 -05:00
Morph 2b87305d31 general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
bunnei e72179e9fd Merge pull request #7978 from german77/sideway
input_common: Map sticks correctly when mapped sideways
2022-04-21 22:21:59 -07:00
Narr the Reg bd648a74df input_common: Ignore boost uninitialized local variable 2022-04-20 18:28:24 -05:00
Merry b02d74d113 input_common: Replace lock_guard with scoped_lock 2022-04-07 19:44:07 +01:00
Narr the Reg f27e097244 input_common: Map sticks correctly when mapped sideways 2022-03-21 19:39:33 -06:00
ameerj e7bb6ec32e input_common: Reduce unused includes 2022-03-20 02:25:09 -04:00
bunnei 8c3f50e6bc Merge pull request #7859 from german77/battery_again
input_common: Remove battery duplicated struct and update every button press
2022-02-24 11:42:51 -08:00
bunnei fa8505dfbb Merge pull request #7852 from Morph1984/new-uuid
common: Revise and fix the UUID implementation
2022-02-10 21:52:13 -07:00
german77 2ea4a2b74e yuzu: Add auto center on right click 2022-02-06 19:56:03 -06:00
german77 75d96d5462 input_common: Remove battery duplicated struct and update every button press 2022-02-06 18:33:55 -06:00
Morph e47b5e6a26 general: Rename NewUUID to UUID, and remove the previous UUID impl
This completes the removal of the old UUID implementation.
2022-02-05 13:56:21 -05:00
Morph 51c445f7e8 input/hid: Migrate to the new UUID implementation 2022-02-05 13:18:41 -05:00
bunnei 5e4fcf041e Merge pull request #7839 from german77/battery
yuzu: ui: Improve battery symbols
2022-02-04 18:23:35 -07:00
Morph 3d13bb3105 input_common: Remove unused core include 2022-02-03 22:44:28 -05:00
bunnei 470b977171 Merge pull request #7811 from german77/analog-mod
input_common: Use attributes for analog range modifiers
2022-02-03 12:21:11 -07:00
Narr the Reg 2198237e42 yuzu: ui: Improve battery symbols 2022-02-02 13:18:06 -06:00
german77 e19f0654f9 input_common: Use attributes for analog range modifiers 2022-01-30 22:42:40 -06:00
german77 a2fe5dffa9 input_common: Add home and hard touch press buttons to UDP controllers 2022-01-30 09:17:22 -06:00
Morph 5865d6f406 Merge pull request #7784 from german77/ds5
input_common: Add DS5 to HD rumble list
2022-01-28 18:36:28 -05:00
bunnei 584eb04402 Merge pull request #7770 from german77/motion-threshold
input_common: Add option to configure gyro threshold
2022-01-27 15:44:04 -08:00
Narr the Reg 9ea465d958 input_common: Add DS5 to HD rumble list 2022-01-26 21:49:32 -06:00
Morph 6cf076534e Merge pull request #7774 from lioncash/mapping
input_common/main: Pass MappingData by const reference in callbacks
2022-01-25 16:15:45 -05:00
Lioncash 18c2bd5c12 input_common/input_engine: Ensure PadIdentifier UUIDs have a valid initial state
The default constructor of a UUID instance doesn't initialize the
underlying array.
2022-01-24 11:57:48 -05:00
Lioncash f02a9e4d81 input_common/input_mapping: Simplify UUID validity checks
Makes the checks a little more intuitive to read and doesn't construct
an extra UUID instance
2022-01-24 11:49:52 -05:00
Lioncash 04a33bc652 input_common/input_mapping: Add missing includes
Ensures that the class always sees the types it needs.
2022-01-24 11:49:31 -05:00
Lioncash cec9e4ec77 input_common/input_mapping: Remove const from return value
Top-level const on a return by value can inhibit move semantics, and is
unnecessary.
2022-01-24 11:39:20 -05:00
Lioncash 5f80c764b0 input_common/input_mapping: Default constructor 2022-01-24 11:37:48 -05:00
Lioncash 1bd76dcb77 input_common/main: Pass MappingData by const reference in callbacks
Avoids creating unnecessary 168 byte copies per callback invocation.
2022-01-24 11:31:43 -05:00
Lioncash feb5b56356 input_common/udp_client: Replace deprecated from_string()/to_ulong() functions
These are deprecated and make_address variants and to_uint() should be used instead.
2022-01-24 11:14:30 -05:00
Lioncash de967b3967 input_common/udp_client: Prevent unnecessary string copies
We can also remove some redundant const on the return values, since
these don't do anything
2022-01-24 10:58:25 -05:00
german77 1fca7203d3 input_common: Add option to configure gyro threshold 2022-01-23 21:54:33 -06:00
bunnei 3ac7342b48 Merge pull request #7735 from german77/udp_battery
input_common: Report battery for UDP controllers
2022-01-22 01:28:14 -08:00
bunnei fd18ae4979 Merge pull request #7715 from gidoly/patch-4
Xbox controller default name nit pick
2022-01-18 21:14:30 -08:00
bunnei 94d7a0de6f Merge pull request #7725 from german77/mouse_in_motion
input_common: Reintroduce motion from mouse and use button names
2022-01-18 18:16:27 -08:00
Narr the Reg 527a74f48b input_common: Report battery for UDP controllers 2022-01-17 13:30:15 -06:00
Mai M d3066b30ea Merge pull request #7730 from v1993/patch-6
input_common: nitpick about SetHatButton usage
2022-01-17 13:43:34 -05:00
Valeri ffc1f4df39 input_common: nitpick about SetHatButton usage 2022-01-17 12:04:38 +03:00
Valeri e3ee079aa4 input_common: fix copy-paste error
Found by static analysis with PVS-Studio.
2022-01-17 11:31:38 +03:00
german77 991460cd98 input_common: Reintroduce motion from mouse and use button names 2022-01-16 20:37:34 -06:00
gidoly 3465aa5d57 Xbox controller default name nit pick
Discord User moon lacer pointed us that official name is 'Xbox' not 'XBox'
2022-01-16 05:59:31 +09:00
gidoly ede1976820 Change default name for ps controllers
Minor nitpick
Code is from narr
2022-01-15 10:29:42 +09:00
bunnei 5d1080d2a8 Merge pull request #7633 from german77/hotkeys
yuzu: Add controller hotkeys
2022-01-11 10:49:23 -08:00
Morph 45f4600a4e Merge pull request #7687 from german77/tas_handle
input_common: Handle errors on TAS scripts
2022-01-09 16:43:06 -08:00
bunnei 7f49c22fc4 Merge pull request #7682 from german77/udp_fix
input_common: Fix UDP controller mappings
2022-01-08 13:41:39 -08:00
german77 b6c23d1633 input_common: Handle errors on TAS scripts 2022-01-08 12:27:16 -06:00
german77 0e1d2581b7 input_common: Fix udp motion not automapping to both sides 2022-01-07 16:56:36 -06:00
german77 353317f31e yuzu: Add controller hotkeys 2022-01-06 21:26:05 -06:00
german77 10439bbfff input_common: Use accelerometer data for mapping 2022-01-06 20:05:49 -06:00
bunnei aa1ec63508 Merge pull request #7302 from VPeruS/check-deadlock
[input_common] Fixed thread hang
2021-12-17 23:43:19 -08:00
vperus e1250d7303 [input_common] Move variable declaration closer to usage
MSVC supplied with VS2022 generates "warning C4189: 'CALIBRATION_THRESHOLD':
local variable is initialized but not referenced" which is treated as an
error.

Circumvent it by moving constexpr variable directly into body of lambda function.
2021-12-17 20:51:47 +02:00
Narr the Reg 8222f70144 Merge pull request #7581 from lioncash/input-iface
common/input: Avoid numerous large copies of CallbackStatus
2021-12-14 19:10:39 -06:00
Narr the Reg a980d24a54 Merge pull request #7577 from v1993/patch-2
input/SDL: Update SDL hints
2021-12-14 10:12:17 -06:00
Valeri af37388ee5 input/SDL: Update SDL hints
SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED is no longer needed thanks to new default in SDL 2.0.18.
SDL_HINT_JOYSTICK_HIDAPI_XBOX is reported to cause conflicts with native driver Xbox driver on Linux, and Xbox controllers don't benefit from hidapi anyways.
2021-12-14 15:02:03 +03:00
Lioncash 726de453bb common/input: Avoid numerous large copies of CallbackStatus
CallbackStatus instances aren't the cheapest things to copy around
(relative to everything else), given that they're currently 520 bytes in
size and are currently copied numerous times when callbacks are invoked.

Instead, we can pass the status by const reference to avoid all the
copying.
2021-12-13 21:22:02 -05:00
Lioncash 3dbb700714 input_poller: Add missing override specifiers 2021-12-13 20:41:17 -05:00
Lioncash 46c7e48143 input_mapping: Amend specification of parameters
param tags are supposed to specify the parameter name without any
quoting.

Silences several -Wdocumentation warnings.
2021-12-13 20:31:59 -05:00
Lioncash c73ebb7d89 input_poller: Remove several unnecessary @param tags
Silences quite a bit of -Wdocumentation warnings, given the @param tag
is only intended to be used to identify function parameters, not what it
contains.
2021-12-13 20:28:30 -05:00
bunnei 7347d2e33f Merge pull request #7575 from lioncash/input
input_engine: Minor object churn cleanup
2021-12-13 16:50:54 -08:00
Lioncash f63a50ce9d tas_input: Avoid minor copies in Read/WriteCommandButtons()
We don't need to copy the whole pair
2021-12-13 11:45:19 -05:00
Lioncash bac72cecf9 tas_input: Remove unnecessary semicolon
Resolves a -Wextra-semi warning
2021-12-13 11:45:19 -05:00
Lioncash 6a9fe940d2 tas_input: Execute clear() even if empty
clear() when empty is simply a no-op, so we can get rid of the check
here and let the stdlib do it for us.
2021-12-13 11:45:18 -05:00
Lioncash 8b6137eb79 tas_input: Remove unnecessary includes
Gets rid of indirect includes and includes only what the interface
needs.
2021-12-13 11:45:18 -05:00
Lioncash 4284fe0d78 tas_input: std::move strings into vector
While we're in the same area, we can also avoid performing std::stoi in
a loop when it only needs to be performed once.
2021-12-13 11:45:15 -05:00
Lioncash c12653670c tas_input: Use istringstream over stringstream
This is only using the input facilities, so we don't need to use the
fully-fleged stringstream.
2021-12-13 10:57:53 -05:00
Lioncash 4dce3a6cf4 tas_input: Use u8string_view instead of u8string
Same behavior, but without the potential for extra allocations.
2021-12-13 10:54:43 -05:00
Lioncash b2c94d8cd4 tas_input: Remove unused std::smatch variable
This also means we can get rid of the dependency on <regex>
2021-12-13 10:50:24 -05:00
Lioncash f1ff42541a tas_input: Amend -Wdocumentation warnings
Parameters shouldn't have the colon by their name.
2021-12-13 10:49:11 -05:00
Lioncash a82bb17b08 tas_input: Make TasAxes enum an enum class
Prevents these values from potentially clashing with anything in other
headers.
2021-12-13 10:41:32 -05:00
Lioncash 71467b1383 input_engine: Fix typo in TriggerOnAxisChange() parameter name 2021-12-13 10:21:37 -05:00
Lioncash e609218c0f input_engine: Simplify PreSet* family of functions
We can make use of try_emplace() to insert values only if they don't
already exist.
2021-12-13 10:18:04 -05:00
Lioncash 14f7f35957 input_engine: Avoid redundant map lookups
We can use iterators to avoid looking up into maps twice in the getter
functions.

At the same time we can also avoid copying the ControllerData structs,
since they're 264 bytes in size.
2021-12-13 09:57:51 -05:00