summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-01-05hid_core: Move hid to it's own subprojectNarr the Reg87-9702/+45
2024-01-04service: hid: Remove data races when handling shared memoryNarr the Reg17-29/+45
2024-01-04service: hid: Implement NpadResource and NpadDataNarr the Reg17-676/+1925
2023-12-31service: hid: Use applet resource to get latest shared memory handleNarr the Reg36-227/+698
2023-12-25service: fetch objects from the client handle tableLiam3-12/+6
2023-12-23core_timing: remove user data valueLiam4-31/+29
2023-12-21service: hid: Fix crash on InitializeVibrationDeviceNarr the Reg1-1/+1
2023-12-14core: hid: Clean up headersNarr the Reg20-36/+16
2023-12-14service: hid: Allow to create multiple instances of shared memoryNarr the Reg37-819/+1057
2023-12-10service: hid: Improve CreateAppletResource implementation and free resourcesgerman776-13/+149
2023-12-07service: hid: Introduce proper AppletResource emulationNarr the Reg9-13/+524
2023-11-27Fixed controller applet crashing when on FW17+FrozenAra4-3/+30
2023-11-21service: hid: Create appropriate hid resourcesNarr the Reg28-1338/+1575
2023-11-20service: hid: Ensure resource manager is initializedSquall-Leonhart1-1/+1
Ensures the proper initialization of the IActiveVibrationDeviceList. By using GetResourceManager() instead of resource_manager, we make sure that the IActiveVibrationDeviceListis initialized before it's used, preventing potential null issues. Fixes #12088
2023-11-19Implemented qlaunch version of the controller appletFrozenAra5-56/+352
2023-11-17service: hid: Introduce firmware settings and update activate controller callsNarr the Reg11-54/+293
2023-11-16service: hid: Implement xpad callsNarr the Reg2-36/+139
2023-11-15service: hid: Split hid.cpp into individual interfacesNarr the Reg11-3055/+3252
2023-11-12core: hid: Split SL and SR buttonsgerman771-2/+4
2023-11-11service: irs: Implement moment image processorNarr the Reg6-17/+169
2023-11-04service: hid: Silence EnableUnintendedHomeButtonInputProtectiongerman771-7/+5
2023-11-03service: hid: Ensure GetNextEntryIndex can't failgerman771-3/+3
2023-11-03core: hid: Fix wrong battery valuesgerman771-3/+3
2023-10-29core: Close all KEventsgerman773-2/+11
2023-09-24service: hid: Set last connected controller as activegerman771-0/+1
2023-09-16service: hid: Implement ApplyNpadSystemCommonPolicygerman774-8/+52
2023-09-16hid: service: Remove outdated field from npadgerman772-27/+14
2023-09-16hid: service: Implement Last active Npadgerman772-1/+5
2023-09-16service: hid: Ensure state is correctgerman771-8/+8
2023-08-23general: Use console mode helper across projectlat9nq2-2/+2
2023-08-22general: Convert use_docked_mode to an enumerationlat9nq2-2/+2
Allows some special interactions with it in the Qt frontend.
2023-08-11service: hid: Implement functions needed by QLaunchNarr the Reg2-24/+60
2023-06-08core_timing: Use CNTPCT as the guest CPU tickMorph1-1/+0
Previously, we were mixing the raw CPU frequency and CNTFRQ. The raw CPU frequency (1020 MHz) should've never been used as CNTPCT (whose frequency is CNTFRQ) is the only counter available.
2023-05-15service: hid: Use span instead of vector referencegerman773-14/+14
2023-05-08core: hid: Update motion on a better placegerman771-2/+2
2023-04-02service: hid: Fix handle validationgerman771-5/+1
2023-03-30service: hid: Implement SetNpadJoyAssignmentModeSingleWithDestinationgerman774-22/+56
Used by Let's Get Fit
2023-03-27service: hid: Silence warning on MergeSingleJoyAsDualJoyNarr the Reg1-1/+2
2023-03-24memory: rename global memory references to application memoryLiam3-12/+13
2023-03-22kernel: use KTypedAddress for addressesLiam8-16/+16
2023-03-12general: fix spelling mistakesLiam3-3/+3
2023-03-08hid: Use nanosecond timestamps instead of ticksMorph2-5/+5
2023-03-01service: move hle_ipc from kernelLiam6-288/+288
2023-02-25core: hidbus: Fix BusType sizeNarr the Reg2-15/+15
2023-02-25core: Update service function tables to 16.0.0+Narr the Reg2-0/+7
2023-02-24hid: avoid direct pointer access of transfer memory objectsLiam20-69/+91
2023-02-22core: hid: Fix native mouse mappingsNarr the Reg3-1/+12
2023-02-21service: refactor server architectureLiam2-10/+14
Converts services to have their own processes
2023-02-14service: remove deleted servicesLiam1-14/+0
2023-02-14remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistencyarades791-5/+5
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14apply clang-formatarades791-3/+3
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14add static lifetime to constexpr values to force compile time evaluation where possiblearades791-3/+3
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14general: rename CurrentProcess to ApplicationProcessLiam3-10/+10
2023-02-10core: hid: Use gyro thresholds modes set by the gameNarr the Reg3-15/+12
2023-02-08service: hid: Return error if arguments of SetSupportedNpadIdType is invalidNarr the Reg4-6/+15
2023-02-03Revert "Merge pull request #9718 from yuzu-emu/revert-9508-hle-ipc-buffer-span"ameerj10-12/+16
This reverts commit 25fc5c0e1158cb8e81cbc769b24ad84032a1fbfd, reversing changes made to af20e25081f97d55b451606c87922e2b49f0d363.
2023-02-02Revert "hle_ipc: Use std::span to avoid heap allocations/copies when calling ReadBuffer"liamwhite10-16/+12
2023-02-01input_common: Implement turbo buttonsgerman771-0/+3
2023-01-20core: hid: Only set the polling mode to the correct sideNarr the Reg3-12/+35
2023-01-20input_common: Fix issue where ring and irs are enabled at the same timegerman771-3/+1
2023-01-20input_common: Implement joycon ir cameraNarr the Reg1-0/+11
2023-01-20core: hid: Fix input regressionsNarr the Reg2-12/+13
2023-01-20service: hid: Set led pattern and fix color detectionNarr the Reg1-0/+5
2023-01-20core: hid: Migrate ring from emulated devices to emulated controllerNarr the Reg2-4/+6
2022-12-29hle_ipc: Rename ReadBufferSpan to ReadBufferameerj2-5/+5
2022-12-29hidbus: Use ReadBufferSpanameerj11-12/+16
2022-12-25service: Use ReadBufferSpan where it is trivial to do soameerj3-6/+6
2022-11-19service: hid: Only overclock npad controllersgerman772-6/+30
2022-10-22general: Enforce C4800 everywhere except in video_coreMorph1-10/+10
2022-10-21input_common: cache vibration testsgerman771-2/+2
2022-10-21hid/npad: Fix copy size in GetSupportedNpadIdTypesLioncash1-2/+3
Previously this was passing the size of the vector into memcpy rather than the size in bytes to copy, which would result in a partial read. Thankfully, this function isn't used yet, so this gets rid of a bug before it's able to do anything.
2022-10-16general: Fix spelling of "unknown"Morph2-3/+3
2022-10-13kernel: remove KWritableEventLiam3-15/+14
2022-09-25service: hid: Partially implement palma controllerNarr the Reg6-33/+840
2022-09-21yuzu: Silence some clang warningsNarr the Reg1-1/+2
2022-09-10yuzu: Multiple room UI improvementsgerman771-1/+2
2022-09-01Demote services from warning/info to debug to reduce log spam:Kelebek11-7/+7
GetCurrentFocusState SetClockSpeed EnableSixAxisSensorUnalteredPassthrough IsSixAxisSensorUnalteredPassthroughEnabled Get, GetOld SetAndWait, SetAndWaitOld IocParam IocFree
2022-08-22hid: core: Add missing function table namesgerman771-0/+6
2022-08-08hid: core: Properly emulate controller color and battery levelNarr the Reg1-15/+62
2022-07-25Address commentsNarr the Reg1-16/+16
2022-07-24fix compiler errorsgerman772-12/+14
2022-07-24service: irs: Implement clustering processorgerman774-6/+318
2022-07-24yuzu: Add webcam support and rebase to latest masterNarr the Reg3-4/+4
2022-07-24service: irs: Move to IRS namespace and minor fixesgerman7718-69/+66
2022-07-24service: irs: Split processors and implement ImageTransferProcessorgerman7717-291/+1077
2022-07-10PRKelebek12-5/+4
2022-07-10Rework CoreTimingKelebek12-38/+20
2022-06-29input_common: sdl: lower vibration frequency and use it's own unique threadgerman771-2/+2
2022-06-29service: hid: Correct some mistakes and add more validationsNarr the Reg4-40/+75
2022-06-27core: Replace all instances of ResultCode with Resultgerman775-74/+73
2022-06-14common: Change semantics of UNREACHABLE to unconditionally crashLiam2-5/+5
2022-06-10service: hid: Fix gesture regressionNarr the Reg2-4/+3
2022-05-31service: hid: Improve stub of IRSNarr the Reg2-21/+460
2022-05-27service: hid: Implement ResetIsSixAxisSensorDeviceNewlyAssignedgerman774-6/+115
Needed by Nintendo Switch Sports
2022-05-27service: hid: Implement LoadSixAxisSensorCalibrationParameter and GetSixAxisSensorIcInformationgerman774-3/+103
Needed by Nintendo Switch Sports
2022-05-27service: hid: Implement EnableSixAxisSensorUnalteredPassthrough and IsSixAxisSensorUnalteredPassthroughEnabledgerman774-2/+88
Needed by Nintendo Switch Sports
2022-05-27service: hid: Add error handling to sixaxis functionsgerman773-31/+55
2022-05-27service: hid: Refractor sixaxis functionsgerman772-185/+88
2022-05-27service: hid: Implement MergeSingleJoyAsDualJoy according to REgerman774-65/+57
2022-05-27service: hid: Add error handling to setNpadAssignment and variantsgerman773-23/+27
2022-05-27service: hid: Quick RE fixes and commentsgerman774-54/+68
2022-05-23input_common: touch: Rewrite touch driver to support multiple touch pointsgerman771-1/+5
2022-05-06service: hid: Fix motion refresh rateNarr the Reg2-2/+6
2022-05-06service: hid: Disable correctly motion inputgerman771-50/+41
2022-04-27service: hid: Stub IsFirmwareUpdateNeededForNotificationgerman772-1/+21
Used in Fitness Boxing 2: Rhythm & Exercise (0100073011382000)
2022-04-24service: hid: Ensure all structs are initializedNarr the Reg15-68/+69
2022-04-23service: hid: Access shared memory directlyNarr the Reg21-305/+347
2022-04-23general: Convert source file copyright comments over to SPDXMorph38-114/+76
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-18service: hid: Improve accuracy of sixaxis functionsNarr the Reg5-97/+360
2022-04-16yuzu: Add custom ringcon configurationgerman775-64/+54
2022-04-16hidbus: Implement hidbus and ringcongerman7711-26/+1645
2022-04-07core/hle: Replace lock_guard with scoped_lockMerry1-1/+1
2022-04-06service: hid: Partially revert #8123german771-0/+4
2022-04-03service: npad: Default initialize shared memorygerman771-48/+48
2022-03-31service: hid: Remove inaccurate behavior on initializationgerman773-18/+21
2022-03-31service: hid: Signal event on AcquireNpadStyleSetUpdateEventHandleNarr the Reg1-0/+4
2022-03-19core: Reduce unused includesameerj10-20/+2
2022-02-12hid: Stub IsUsbFullKeyControllerEnabledlat9nq2-1/+12
Used by Splatoon 2, when opening the inventory from a LAN battle lobby. Reference: https://switchbrew.org/wiki/HID_services
2022-01-19service/hid: Initialize applet_resource on SetNpadAnalogStickUseCenterClampgerman771-1/+2
2022-01-13service/hid: Decrease motion update rateNarr the Reg1-1/+2
Motion stops working in Mario Tennis in swing mode if the update rate is too fast even when HW it updates at the same speed. 10ms it's the minimum period that the game needs to start working again.
2021-12-16core/hid: Cancel any vibration after the testNarr the Reg3-11/+5
2021-12-13service/hid: Improve console motion accuracyNarr the Reg2-14/+16
2021-12-06service/hid: Stub SetNpadCaptureButtonAssignment and ClearNpadCaptureButtonAssignmentgerman772-2/+35
Used by ring fit adventure 1.2.0
2021-12-05service/hid: Implement SetNpadJoyAssignmentModegerman773-38/+161
2021-12-05core/hid: Ensure only valid npad are connectedgerman771-17/+13
2021-11-30npad: Return NpadButton in GetAndResetPressStateMorph2-5/+5
We were previously truncating this to a u32 as there were no known buttons that used the full 64 bits of this type. Fix this now that we know they are used.
2021-11-29general: Fix handheld typoMorph1-1/+1
2021-11-28settings: Add debug setting to enable all controllersgerman771-0/+4
2021-11-27core/hid: Stub GetUniquePadsFromNpadNarr the Reg1-1/+13
Used in checkpoint homebrew
2021-11-25service/hid: Finish converting LIFO objects and address some nitsNarr the Reg12-91/+46
2021-11-25kraken: Address comments from reviewgerman772-5/+4
Fix compiler bug
2021-11-25core/hid: Improve accuary of mouse implementationgerman776-18/+28
2021-11-25core/hid: Fully implement native mousegerman771-4/+5
2021-11-25core/hid: Improve accuracy of the keyboard implementationgerman773-4/+34
2021-11-25core/hid: Fix keyboard alignmentgerman771-0/+1
2021-11-25core/hid: Remove usage of native types, fix a couple of errors with motiongerman773-410/+538
2021-11-25service/hid: Remove includes of core.h and settings.hgerman7722-51/+56
2021-11-25service/hid: Add support for new controllersgerman771-1/+30
2021-11-25core/hid: Rename NpadType to NpadStyleIndexgerman773-75/+79
2021-11-25second commit lion reviewgerman778-5/+13
2021-11-25kraken: Address comments from reviewgerman774-8/+5
start lion review
2021-11-25core/hid: Update structs to 13.1.0german779-42/+89
2021-11-25core/hid: Rework battery mappingsgerman771-2/+9
2021-11-25service/hid: Fix memory allocated incorrectlygerman775-7/+7
2021-11-25Morph review first wavegerman7712-74/+56
2021-11-25service/hid: Match shared memory closer to HWgerman772-26/+75
2021-11-25kraken: Address comments from reviewgerman773-8/+7
review fixes
2021-11-25service/hid: Use ring buffer for gesturesgerman772-79/+52
2021-11-25service/hid: Fix gesture inputgerman772-61/+92
2021-11-25core/hid: Only signal when neededgerman771-2/+4
2021-11-25hid: Fix controller connection/disconnectiongerman773-26/+56
2021-11-25kraken: Fix errors from rebase and format filesgerman771-1/+0
2021-11-25core/hid: Add output devicesgerman772-40/+5
2021-11-25service/hid: Rewrite npad to use ring lifo and the emulated controllergerman772-890/+605
2021-11-25service/hid: Update console sixaxis to the emulated consolegerman772-28/+26
2021-11-25service/hid: Update mouse and keyboard to use ring lifo and the emulated devicegerman774-158/+71
2021-11-25service/hid: Update touch and gestures to use ring lifo and the emulated consolegerman774-370/+191
2021-11-25service/hid: Update debug pad, xpad, stubbed and controller base to use ring lifo and the emulated controllergerman777-166/+80
2021-11-25service/hid: Use remove duplicated code, update namesgerman772-64/+30
2021-11-25service/hid: Create ring LIFOgerman771-0/+54
2021-11-25settings: Cleanup settingsgerman774-5/+4
2021-11-04core: Remove unused includesameerj3-4/+0
2021-10-07service: Reduce header include overheadMorph1-4/+0
2021-09-29style: Remove extra space preceding the :: operatorMorph1-1/+1
2021-09-27service/hid: Update to 13.0.0german772-0/+10
2021-09-10hid: Stub SetTouchScreenConfigurationgerman773-1/+28
2021-07-21hle: service: hid: npad: Remove unused kernel reference.bunnei1-1/+0
2021-07-21hle: service: Add a helper module for managing kernel objects.bunnei4-13/+34
2021-07-11npad: Disable vibration check if disabledgerman771-0/+5
2021-06-22npad: Fix data race when updating devicesRodrigo Locatti2-0/+8
Add a lock to avoid data races. This reduces the number of -fsanitize=thread errors significantly.
2021-06-11hid: Stub IsFirmwareUpdateAvailableForSixAxisSensorgerman772-1/+23
2021-06-02general: Replace RESULT_UNKNOWN with ResultUnknownMorph1-2/+2
Transition to PascalCase for result names.
2021-06-02general: Replace RESULT_SUCCESS with ResultSuccessMorph2-90/+90
Transition to PascalCase for result names.
2021-05-28touchscreen: Make use of common point structLioncash2-10/+10
2021-05-28common: Extract point into a common structLioncash1-29/+7
This is generic enough that it can be moved into the Common class for reuse.
2021-05-24hid: ApplyNpadSystemCommonPolicyChloe Marcec1-1/+10
We already do this specifically for homebrew, so we can keep it stubbed out for the time being
2021-05-18hid/gesture: Factor out last gesture retrieval into its own functionLioncash2-14/+23
Deduplicates a commonly repeated expression.
2021-05-18hid/gesture: Ensure all ID arrays are initializedLioncash1-4/+4
Makes for deterministic initial state.
2021-05-18hid/gesture: Make Point a templateLioncash2-38/+46
We can now use this in a generic context to reuse it with the finger position.
2021-05-18hid/gesture: Replace x,y members of GestureState with a PointLioncash2-6/+4
Simplifies assignments.
2021-05-18hid/gesture: Add default comparators to PointLioncash2-10/+7
Simplifies some comparisons.
2021-05-18hid/gesture: Rename Points to PointLioncash1-5/+5
This only represents a single point
2021-05-16core: Make variable shadowing a compile-time errorLioncash4-34/+41
Now that we have most of core free of shadowing, we can enable the warning as an error to catch anything that may be remaining and also eliminate this class of logic bug entirely.
2021-05-06hle: kernel: Remove deprecated Object class.bunnei2-2/+0
2021-05-06hle: kernel: Migrate KClientPort to KAutoObject.bunnei1-1/+1
2021-05-06hle: kernel: Migrate KTransferMemory to KAutoObject.bunnei1-8/+9
2021-05-06hle: kernel: Migrate KSession, KClientSession, and KServerSession to KAutoObject.bunnei1-1/+0
2021-05-06hle: kernel: Migrate KReadableEvent and KWritableEvent to KAutoObject.bunnei2-6/+5
2021-05-06hle: kernel: Refactor several threads/events/sharedmemory to use slab heaps.bunnei2-4/+9
2021-05-06hle: kernel: Ensure all kernel objects with KAutoObject are properly created.bunnei1-0/+1
2021-05-06hle: kernel: Migrate KEvent to KAutoObject.bunnei2-4/+3
2021-05-06hle: kernel: Migrate KSharedMemory to KAutoObject.bunnei4-22/+5
2021-05-06hle: kernel: Refactor IPC interfaces to not use std::shared_ptr.bunnei4-5/+4
2021-05-05hid: Improve hardware accuracy of gesturesgerman772-76/+340
2021-05-04service: Resolve cases of member field shadowingLioncash18-19/+19
Now all that remains is for kernel code to be 'shadow-free' and then -Wshadow can be turned into an error.
2021-05-03hid: Fix touch not initializing properly if disabledgerman772-2/+10
2021-05-01Disable touch if setting is not enabledgerman772-2/+2
2021-04-27address commentsgerman772-5/+5
2021-04-24hid: Implement SevenSixAxis and ConsoleSixAxisSensorgerman775-12/+194
2021-04-22service: hid: Get transfer memory for InitializeSevenSixAxisSensorMorph1-1/+38
2021-04-19npad: Remove duplicated class member variableLioncash2-2/+1
ControllerBase already has a System reference that can be accessed from this class, so we can get rid of this to make the class layout a little more straightforward.
2021-04-15common: Move settings to common from core.bunnei10-10/+10
- Removes a dependency on core and input_common from common.
2021-04-08service: hid: Stub SetAnalogStickUseCenterClampMorph4-1/+29
- Used by eBASEBALLパワフルプロ野球2020
2021-04-07hid: Update service function tablesgerman772-0/+85
2021-04-02HID: Fix SL and SR buttons for right joycongerman771-2/+6
2021-03-26HID: Initialize correctly the gesture finger_id and filter invalid resultsNarr the Reg2-3/+13
2021-02-28Implements touch, pan, pinch and rotation gesturesgerman2-11/+240
2021-02-21hid: Implement GameCube Controller VibrationsMorph2-3/+130
Implements both SendVibrationGcErmCommand and GetActualVibrationGcErmCommand, and modifies GetVibrationDeviceInfo to account for additional controllers.
2021-02-19hle: kernel: Rename SharedMemory to KSharedMemory.bunnei4-6/+6
2021-02-08hid: Implement GC controllergerman2-1/+88
2021-02-05hle: kernel: Reimplement KReadableEvent and KWritableEvent.bunnei2-7/+13
2021-02-05hle: kernel: Rename WritableEvent to KWritableEvent.bunnei3-4/+4
2021-02-05hle: kernel: Rename ReadableEvent to KReadableEvent.bunnei3-4/+5
2021-02-04Add footer types and address commentsgerman7-58/+106
2021-02-04Fix npad struct to match switchbrewgerman2-104/+133
2021-02-04Adds missing controller types and propertiesgerman9-30/+191
2021-02-02Prevent over scheduling audio events and terminate properly the motion update eventgerman1-0/+1
2021-02-01Only update motion for npad and prevent over scheduling eventsgerman1-2/+11
2021-01-28hid: Add static_assert for Parameter sizeMorph1-15/+19
2021-01-27npad: Remove unused device handle parameterMorph3-11/+9
2021-01-24Stub Set/Get/Reset SixaxisSensorFusionParametersgerman4-3/+104
2021-01-18npad: Add check for HANDHELD_INDEX in UpdateControllerAt()Morph1-1/+1
2021-01-15core: Silence Wclass-memaccess warningsReinUsesLisp3-84/+93
This requires making several types trivial and properly initialize them whenever they are called.
2021-01-15Always initialize keyboard inputgerman1-5/+1
2021-01-15Add mutitouch support for touch screensgerman2-19/+25
2021-01-15Allow to return up to 16 touch inputs per enginegerman2-55/+75
2021-01-15Allow all touch inputs at the same time and remove config options that are not longer necesarygerman2-11/+20
2021-01-15Add multitouch supportgerman2-23/+93
2020-12-29hle: service: Acquire and release a lock on requests.bunnei1-0/+2
- This makes it such that we can safely access service members from CoreTiming thread.
2020-12-18controllers/npad: Make press_state atomicMorph2-2/+3
2020-12-12controllers/npad: Validate device handles before useMorph2-0/+45
Some games such as NEKOPARA Vol. 3 send invalid device handles when calling InitializeVibrationDevice. Introduce a check to validate the device handle before use.
2020-11-29Add missing types to NpadCommunicationModegerman1-0/+2
2020-11-27Stub set and get NpadCommunicationModegerman4-2/+50
2020-11-27service: Eliminate usages of the global system instanceLioncash6-27/+35
Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services.
2020-11-25hid: Check if applet_resource exists in InitializeVibrationDeviceMorph1-2/+4
2020-11-16hid: Reimplement Begin/EndPermitVibrationSessionMorph3-5/+17
Upon further investigation, these commands allow temporary vibrations even when the "Controller Vibration" system setting is disabled. As a result, vibrations are allowed when either the system setting or this flag is set to true. Therefore, we can only block vibrations when both flags are set to false.
2020-11-16controllers/npad: Load input devices on initMorph1-0/+2
2020-11-16general: Fix compiler warnings on linux and miscellaneous changesMorph2-8/+11
2020-11-16controllers/npad: Remove the old vibration filterMorph3-50/+64
Previously we used a vibration filter that filters out amplitudes close to each other. It turns out there are cases where this results into vibrations that are too inaccurate. Remove this and move the 100Hz vibration filter (Only allowing a maximum of 100 vibrations per second) from sdl_impl to npad when enable_accurate_vibrations is set to false.
2020-11-16hid: Implement InitializeVibrationDevice and IsVibrationDeviceMountedMorph3-12/+66
2020-11-16input_common: Add VibrationDevice and VibrationDeviceFactoryMorph3-33/+27
A vibration device is an input device that returns an unsigned byte as status. It represents whether the vibration device supports vibration or not. If the status returns 1, it supports vibration. Otherwise, it does not support vibration.
2020-11-16configure_input: Add per-player vibrationMorph1-2/+11
Allows for enabling and modifying vibration and vibration strength per player. Also adds a toggle for enabling/disabling accurate vibrations. Co-authored-by: Its-Rei <kupfel@gmail.com>
2020-11-16settings: Remove global vibration strength modifierMorph1-3/+1
This will be replaced in favor of per-player vibration strength modifiers.
2020-11-16hid: Mark Begin/EndPermitVibrationSession as stubsMorph3-18/+4
The implementation of these commands seem incomplete and causes rumble in Super Mario Party to stop working since only EndPermitVibrationSession is called. Thus, these are better off being marked as a stub until this can be investigated more thoroughly.
2020-11-16controllers/npad: Send an empty vibration on destruction/deactivationMorph3-22/+38
This stops all controllers from continuously vibrating when emulation is stopped.
2020-11-16hid: Stub IsVibrationDeviceMountedMorph2-1/+23
- Used in Super Mario Odyssey
2020-11-16controllers/npad: Add heuristics to reduce rumble state changesMorph1-5/+46
Sending too many state changes in a short period of time can cause massive performance issues. As a result, we have to use several heuristics to reduce the number of state changes to minimize/eliminate this performance impact while maintaining the quality of these vibrations as much as possible.
2020-11-16configure_input: Hook up the vibration percentage spinboxMorph1-1/+2
This allows setting the vibration strength percentage anywhere from 1% to 100%. Also hooks up the remaining motion button and checkbox in the Controller Applet.
2020-11-16controllers/npad: Stop games from vibrating incorrect controllersMorph1-0/+10
Fixes vibration in 1-2 Switch and potentially other games where they would vibrate both players' joycons at the same time.
2020-11-16hid: Fix controller rumble based on new researchMorph3-43/+69
This fixes the issue where rumble is only sent to the first controller. Now, individual controllers can receive their own rumble commands.
2020-11-16hid: Pop a struct of parameters instead of popping individual parametersMorph1-103/+237
Some parameters need to be doubleword aligned due to the presence of the applet_resource_user_id. Previously, this value was invalid in many commands where it was not doubleword aligned when popped.
2020-11-16hid: Reorder all HID commandsMorph4-215/+230
Reorders all HID commands in command id order.
2020-11-16hid: Implement GetVibrationDeviceInfoMorph2-3/+39
The first u32 describes the vibration device type which is a Linear Resonant Actuator used in Nintendo Switch controller hardware. The second u32 describes the vibration device position, in this case distinguishing between left and right vibration actuators. Pro Controllers have 2 LRAs each that can vibrate independently of each other, which means they have 2 distinct vibration device handles to distinguish between the two actuators. Similarly for joycons, the left joycon can be distinguished from the right joycon through the vibration device handle since each joycon has 1 LRA.
2020-11-16hid: Stub InitializeVibrationDeviceMorph1-3/+11
2020-11-16controllers/npad: Rename NPadType to NpadStyleSetMorph2-8/+8
This more accurately represents the underlying type and avoids confusion with NpadType
2020-11-16controllers/npad: Add DeviceHandle structMorph1-27/+50
A DeviceHandle describes a vibration device or six-axis sensor based on the npad type, npad id, and device index/position
2020-11-16settings: Preparation for per-game input settingsMorph2-20/+26
2020-11-16controllers/npad: Connect a controller on init if none are connectedMorph1-0/+13
2020-10-28service: Update function tablesLioncash1-1/+1
Updates function tables according to info on SwitchBrew.
2020-10-21Revert "core: Fix clang build"bunnei9-80/+52
2020-10-18core: Fix clang buildLioncash9-52/+80
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
2020-10-13core/CMakeLists: Make some warnings errorsLioncash3-28/+3
Makes our error coverage a little more consistent across the board by applying it to Linux side of things as well. This also makes it more consistent with the warning settings in other libraries in the project. This also updates httplib to 0.7.9, as there are several warning cleanups made that allow us to enable several warnings as errors.
2020-10-02Only use inputs corresponding to controller typegerman1-49/+58
2020-09-30Stubbed EnableSixAxisSensorFusiongerman2-1/+15
2020-09-30hid: Stub HomeButtonInputProtection service commandsMorph4-2/+50
- Used in 1-2 Switch. Given that we do not emulate the functionality of the home button yet, we can stub this for now.
2020-09-29First implementation of controller rumblegerman3-13/+22
2020-09-24Use different timing for motiongerman5-76/+157
2020-09-18hid: Implement Get/SetNpadHandheldActivationModeMorph3-5/+28
- Used in Clubhouse Games: 51 Worldwide Classics
2020-09-10Test: Decrease pad_update_nsFearlessTobi1-1/+1
There have been reports of quite heavy input lag in the past. Compared to Citra for example, our pad_update_ns value is very high. So let's decrease it and see if it helps with this problem.
2020-09-05configure_input: Hook up the motion button and checkboxMorph1-1/+1
This allows toggling motion on or off, and allows access to the motion configuration. Also changes the [waiting] text for motion buttons to Shake! as this is how motion is connected to a player.
2020-09-05Add cemu hook changes related to PR #4609german1-2/+1
2020-09-05Remove RealMotionDevicegerman2-7/+8
2020-09-05controllers/npad: Simplify motion entry assignmentMorph1-29/+18
Simplifies the motion assignment in the Dual Joycon entry and assigns index 1 of the motion entry (Motion 2) for the right joycon.
2020-09-05Include HID and configuration changes related to motiongerman4-15/+195
2020-09-04hid: Implement MergeSingleJoyasDualJoyMorph3-5/+24
- Used in multiple games such as Super Mario Odyssey.
2020-09-04applets/controller: Implement fallback applet for the SDL frontendMorph2-89/+0
Implement the fallback applet for the SDL frontend, connecting only the minimum amount of players required.
2020-09-04Project Mjölnir: Part 2 - Controller AppletMorph2-11/+23
Co-authored-by: Its-Rei <kupfel@gmail.com>
2020-08-29yuzu: Add motion and touch configurationFearlessTobi2-1/+12
2020-08-26controllers/npad: Fix inconsistencies with controller connection statusesMorph1-1/+7
2020-08-26controllers/npad: Fix LibNX controller connection statusesMorph1-1/+9
This allows homebrew applications to be able to properly detect connected controllers.
2020-08-26controllers/npad: Fix LedPattern for P1-4Morph1-3/+3
2020-08-26Project Mjölnir: Part 1Morph3-127/+111
Co-authored-by: James Rowe <jroweboy@gmail.com> Co-authored-by: Its-Rei <kupfel@gmail.com>
2020-08-14core: Resolve several -Wextra-semi warningsLioncash1-2/+2
We can amend one of the cascade macros to require semicolons in order to compile. In other cases, we can just remove the superfluous semicolons.
2020-07-28core_timing: Make use of uintptr_t to represent user_dataLioncash2-4/+6
Makes the interface future-proofed for supporting other platforms in the event we ever support platforms with differing pointer sizes. This way, we have a type in place that is always guaranteed to be able to represent a pointer exactly.
2020-07-16hid: Only update keyboard & debug pad inputs if enabledDavid Marcec2-33/+37
Previously we would ignore this setting and would update the states regardless of the user setting
2020-07-16core_timing: Make TimedCallback take std::chrono::nanosecondsLioncash2-9/+7
Enforces our desired time units directly with a concrete type.
2020-07-16core_timing: Make use of std::chrono with ScheduleEventLioncash1-5/+7
2020-06-27General: Recover Prometheus project from harddrive failure Fernando Sahmkow10-19/+17
This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system.
2020-06-24hid: Stub a series of "SevenSixAxisSensor" service commandsMorph2-21/+85
- Used by Captain Toad: Treasure Tracker Update 1.3.0 While we're at it, fix the input parameters for SetIsPalmaAllConnectable and SetPalmaBoostMode
2020-06-21hid: Implement Get/ResetGyroscopeZeroDriftModeMorph4-6/+56
- Used by Captain Toad Treasure Tracker
2020-06-21Clang FormattingAmeer1-26/+16
2020-06-21GC Adapter ImplementationAmeer1-16/+26
2020-06-01Clang-formatVolcaEM1-2/+1
2020-06-01hid: Stub GetXpadIDsVolcaEM2-1/+14
Allows Minecraft: Nintendo Switch Edition (a.k.a. old Minecraft) to boot and go ingame
2020-05-12hid: Clear keyboard states & fix logic issueDavid Marcec1-3/+4
Previously we never cleared the states of the entries and the key would stay held down, also looping over the key bytes for each key lead to setting every bit for the key state instead of the key we wanted
2020-05-11Stub SendKeyboardLockKeyEventDavid Marcec2-1/+11
Needed for Puchikon 4 SmileBASIC 1.0.0
2020-04-26services: hid: Stub StopSevenSixAxisSensor.M&M2-1/+13
- Used by The Legend of Zelda: Breath of the Wild v1.6.0
2020-04-20service: Update function tablesLioncash1-1/+36
Keeps the service function tables up to date. Updated based off information on SwitchBrew.
2020-04-20npad: Lower log level for VibrateController to DebugFearlessTobi1-1/+1
2020-04-18service: hid: npad: Fix implicit fallthrough errors.bunnei1-0/+2
2020-04-17service: hid: Update for new shared memory layout.bunnei1-3/+2
2020-04-17service: irs: Update for new shared memory layout.bunnei1-3/+3
2020-03-27services: hid: Stub InitializeSevenSixAxisSensor.bunnei2-1/+9
- Used by Super Smash Bros. Ultimate v7.0.0.
2020-02-18analog_from_button get direction implementationCJBok1-5/+5
2020-02-12Core: Set all hardware emulation constants in a single file.Fernando Sahmkow1-3/+4
2020-01-15Moved analog direction logic to sdl_implCJBok1-9/+22
2020-01-14Corrected directional states sensitivityCJBok1-9/+9
2020-01-09hid: Fix analog sticks directional statesCJBok1-12/+12
2019-11-27core_timing: Use better reference tracking for EventType. (#3159)bunnei2-4/+3
* core_timing: Use better reference tracking for EventType. - Moves ownership of the event to the caller, ensuring we don't fire events for destroyed objects. - Removes need for unique names - we won't be using this for save states anyways.
2019-11-25kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)bunnei4-5/+4
* kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. - See https://github.com/citra-emu/citra/pull/4710 for details.
2019-11-12service: Update function tablesLioncash1-0/+24
Keeps the function tables up to date. Updated based off information from Switchbrew.
2019-11-03kernel: events: Remove ResetType::Automatic.bunnei1-1/+1
- This does not actually seem to exist in the real kernel - games reset these automatically. # Conflicts: # src/core/hle/service/am/applets/applets.cpp # src/core/hle/service/filesystem/fsp_srv.cpp
2019-10-18hid/npad: Fix incorrect connection boolean value in ConnectAllDisconnectedControllers()Lioncash1-1/+1
We should be setting the connection state to true, otherwise we aren't actually making the controllers connected like the function name indicates.
2019-10-18hid/npad: Add missing break in default caseLioncash1-0/+1
While not an issue, it does prevent fallthrough from occurring if anything is ever added after this case (unlikely to occur, but this turns a trivial "should not cause issues" into a definite "won't cause issues).
2019-10-18hid/npad: Replace std::for_each with ranged for loopsLioncash1-13/+12
Performs the same behavior, but is built into the core language itself. No functional change.
2019-10-18hid/npad: Remove redundant non-const variant of IsControllerSupported()Lioncash2-34/+5
The const qualified variant can also be called in non-const contexts, so we can remove the non-const variant to eliminate a bit of code duplication.
2019-10-18hid/npad: Move function declarationsLioncash1-5/+6
Clearly separate these from the variable declarations to make them more visible.
2019-10-07hid: Implement DeactivateNpadMorph2-1/+13
Makes use of the already existing DeactivateController function.
2019-10-07hid: Stub SetNpadJoyAssignmentModeSingle and reorganize service commandsMorph2-92/+126
2019-10-05service/hid: Silence -Wunused and -WswitchReinUsesLisp15-23/+18
2019-10-05service/hid: Remove unused system referenceReinUsesLisp2-2/+1
2019-09-24Signal styleset changes at a better timeDavid Marcec1-8/+2
We should signal when a net controller is added and our event should be manual, not automatic.
2019-09-22removed commentDavid Marcec1-1/+0
2019-09-22RebasedDavid Marcec3-11/+19
2019-09-22removed unneeded semicolonDavid Marcec1-1/+1
2019-09-22marked controller constructors as explicitDavid Marcec8-8/+8
2019-09-22RebaseDavid Marcec20-44/+59
2019-09-22Deglobalize System: IRSDavid Marcec3-5/+6
2019-09-22Deglobalize System: HidDavid Marcec20-37/+44
2019-09-04dittoMorph19841-1/+1
Co-Authored-By: David <25727384+ogniK5377@users.noreply.github.com>
2019-09-04IsVibrationEnabled() as a const member funcMorph19841-1/+1
2019-09-04clang-formatMorph19841-2/+2
2019-09-04Update npad.hMorph19841-0/+1
2019-09-04Update npad.cppMorph19841-0/+6
2019-09-04Update hid.hMorph19841-0/+2
2019-09-04Update hid.cppMorph19841-2/+23
2019-07-08addressed issuesDavid Marcec1-6/+7
2019-07-01hid:StartLrAssignmentMode, hid:StopLrAssignmentMode, hid:SwapNpadAssignmentDavid Marcec5-3/+98
StartLrAssignmentMode and StopLrAssignmentMode don't require any implementation as it's just used for showing the screen of changing the controller orientation if the user wishes to do so. Ever since #1634 this has not been needed as users can specify the controller orientation from the config and swap at any time. We store a private member just in case this gets used for anything extra in the future
2019-05-18core/kernel/object: Rename ResetType enum membersLioncash1-1/+1
Renames the members to more accurately indicate what they signify. "OneShot" and "Sticky" are kind of ambiguous identifiers for the reset types, and can be kind of misleading. Automatic and Manual communicate the kind of reset type in a clearer manner. Either the event is automatically reset, or it isn't and must be manually cleared. The "OneShot" and "Sticky" terminology is just a hold-over from Citra where the kernel had a third type of event reset type known as "Pulse". Given the Switch kernel only has two forms of event reset types, we don't need to keep the old terminology around anymore.
2019-04-11service: Update service function tablesLioncash1-0/+15
Updates function tables based off information from SwitchBrew.
2019-03-24core/core_timing: Make callback parameters consistentLioncash2-6/+6
In some cases, our callbacks were using s64 as a parameter, and in other cases, they were using an int, which is inconsistent. To make all callbacks consistent, we can just use an s64 as the type for late cycles, given it gets rid of the need to cast internally. While we're at it, also resolve some signed/unsigned conversions that were occurring related to the callback registration.
2019-03-05vm_manager: Remove cheat-specific ranges from VMManagerZach Hilman1-0/+2
2019-03-05controllers/npad: Add accessor for current press stateZach Hilman1-0/+1
Allows frontend/features to access pressed buttons conveniently as possible
2019-02-27service/hid: Amend forward declaration of ServiceManagerLioncash1-1/+1
The SM namespace is within the Service namespace, so this was forward declaring a type that didn't exist.
2019-02-16core_timing: Convert core timing into a classLioncash19-34/+51
Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
2019-02-12core_timing: Rename CoreTiming namespace to Core::TimingLioncash11-22/+21
Places all of the timing-related functionality under the existing Core namespace to keep things consistent, rather than having the timing utilities sitting in its own completely separate namespace.
2019-02-06remove all occurance of specifying endianness inside BitFieldWeiyi Wang3-68/+68
This commit it automatically generated by command in zsh: sed -i -- 's/BitField<\(.*\)_le>/BitField<\1>/g' **/*(D.) BitField is now aware to endianness and default to little endian. It expects a value representation type without storage specification for its template parameter.
2018-12-29travis: Use correct package for linux Qt5WebEngineZach Hilman1-2/+2
2018-12-29web_browser: Add bounds checking to applet interfaceZach Hilman3-125/+127
2018-12-28hid: Make Hid service accessible and add GetPressStateZach Hilman4-459/+540
2018-12-26npad: Remove code to invert input in horizontal mode.bunnei1-46/+0
- This was incorrect, the game appears to handle this for us. - Fixes horizontal mode with Puyo Puyo Tetris and Super Mario Odyssey.
2018-12-21hid: Fix SetNpadJoyHoldType and improve logging.bunnei1-44/+163
2018-12-02Fixed crash with SetNpadModeDavid Marcec1-2/+3
fixed crash due to handheld
2018-11-29kernel/event: Reference ReadableEvent from WritableEventZach Hilman2-13/+7
2018-11-29core: Port all current usages of Event to Readable/WritableEventZach Hilman3-9/+19
2018-11-28npad: Use NPadIdToIndex to prevent invalid array accessZach Hilman1-2/+2
2018-11-27npad: Fix copy/paste error with LED position assignmentsZach Hilman1-3/+3
2018-11-26Changed logging to be "Log before execution", Added more error logging, all services should now log on some levelDavid Marcec3-59/+114
2018-11-22debug_pad: Avoid loading input for nonexistent buttons (Home and Screenshot)Zach Hilman1-2/+3
Prevents memory exceptions when the debug pad is enabled.
2018-11-19hid: Use player-defined controller type as PREFERRED_CONTROLLERZach Hilman4-174/+61
2018-11-19hid/npad: Update NPad to use player controller bindings and typeZach Hilman2-55/+108
2018-11-19hid/touchscreen: Update Touchscreen to use advanced parametersZach Hilman1-6/+6
Including finger ID, diamater x/y, and angle. Additionally, checks if the touchscreen is enabled.
2018-11-19hid: Add controller bindings for Mouse controllerZach Hilman2-4/+30
2018-11-19hid: Add keyboard bindings for Keyboard controllerZach Hilman2-2/+24
2018-11-19hid: Add controller bindings for DebugPad controllerZach Hilman2-21/+43
Used by developers to test games, not present on retail systems. Some games are known to respond to DebugPad input though, for example Kirby Star Allies.
2018-11-19Added missing start/end touch attributes to touchscreenDavid Marcec2-1/+18
2018-11-19Added debugpad skeletonDavid Marcec2-2/+55
2018-11-19Added controller helper funcsDavid Marcec2-0/+35
2018-11-19Changed polling rate of hid and Right joycon rotationDavid Marcec1-2/+2
2018-11-19Left joycon rotation button remappingDavid Marcec2-7/+21
2018-11-19Added automatic npad switch based on supported stylesetsDavid Marcec2-4/+124
2018-11-19Added multi-input support and controller assignment at any portDavid Marcec2-122/+181
2018-11-16Added SetIsPalmaAllConnectable, SetPalmaBoostModeDavid Marcec1-2/+14
Currently unclear what these do yet, will be researched at a later time when we want to implement palma.
2018-11-16Fixed priority switching edge case for handheld (#1675)David1-12/+46
* Fixed priority switching edge case for handheld We accidently used controller index instead of npad id * Moved NPadIdToIndex
2018-11-14hid/npad: Add missing break in switch statement within Controller_NPad::OnUpdate()Lioncash1-0/+1
2018-11-07Updated npad styles on holdtype switchesDavid Marcec1-0/+2
Fixes input for megaman
2018-11-02Fixed HID crash when launching more than 1 game & signaled syleset change eventDavid Marcec2-0/+5
This should fix crashes when launching multiple games in yuzu
2018-10-24npad: Remove unused controller variable from OnInit()Lioncash1-2/+3
This also gets rid of variable shadowing related to the lambda parameter a little bit below this code as well.
2018-10-21hid: Update service function table for hidbusLioncash1-0/+1
Updated based off information provided by Switchbrew.
2018-10-20Added auto controller switching to supported controllers and single joycon button rotationDavid Marcec2-4/+189
This is a subset of the better-hid-2 changes, this fixes input in various games which don't support dual joycons. This pr will search for the next best controller which is supported by the current game
2018-10-19hid: Update service function tablesLioncash1-6/+45
Updated based off information provided by Switchbrew.
2018-10-18hid/controller: Remove unused header inclusionsLioncash9-9/+0
swap.h only needs to be present in the header for the type aliases and definitions, it's not actually needed in the cpp files though. input.h is just unused entirely in xpad.h
2018-10-18hid/controller/npad: Remove unused dump_idx member variableLioncash1-1/+0
Given it's unused, we may as well toss it.
2018-10-18hid/controller/npad: Remove unnecessary semicolon from the closing brace of LedPattern's constructorLioncash1-1/+1
2018-10-18hid/controller/npad: Remove #pragma once from the cpp fileLioncash1-2/+0
This is only useful in headers.
2018-10-18hid/controller/npad: Move npad_id_list into the cpp fileLioncash2-2/+10
This is just a lookup table, and since it's private, there's nothing really stateful about it, so we can just move it into the cpp file.
2018-10-18hid/controller/npad: Remove unnecessary const from void return typeLioncash2-2/+2
This literally does nothing.
2018-10-18hid/controller: Default the destructors of all controller types in the cpp fileLioncash16-0/+16
These classes are non-trivial and are definitely going to be changed in the future, so we default these to prevent issues with forward declarations, and to keep the compiler from inlining tear-down code.
2018-10-18controller_base: Default the base class constructor and destructor in the cpp fileLioncash2-2/+4
The destructor doesn't need to be a pure-virtual function.
2018-10-17Using dual joycons as the default controllerDavid Marcec3-77/+59
Reason for the change is to allow both docked and undocked mode to work
2018-10-12WipDavid Marcec2-3/+23
2018-10-11Dynamically decide handheld variant based on supported npad id priorityDavid Marcec3-19/+62
Kirby input still doesn't work, should fix a lot of other games
2018-10-10Added BeginPermitVibrationSession and EndPermitVibrationSessionDavid Marcec3-2/+26
Used by Mario Party
2018-10-10Added GetLedPattern and HandheldVariantDavid Marcec3-6/+63
HandheldVariant is for specific games which expect handheld controllers to be at position 8(kirby), however this doesn't fix all games as some games require handhelds to be at position 0(snipperclips)
2018-10-10Kirby expects handheld controllers to be at position 8David Marcec1-2/+8
2018-10-10Added the ability to "disconnect" individual npadsDavid Marcec3-16/+40
Fixes arms
2018-10-10Removed unneeded forward declarationsDavid Marcec2-13/+2
2018-10-10Addressed changes for better hidDavid Marcec19-167/+238
2018-10-10"Better Hid" rework part 1David Marcec20-643/+1481
2018-09-24Stubbed IRS (#1349)David2-18/+167
* Stubbed IRS Currently we have no ideal way of implementing IRS. For the time being we should have the functions stubbed until we come up with a way to emulate IRS properly. * Added IRS to logging backend * Forward declared shared memory for irs
2018-09-19Fixed GetAccountId stub, Added error code for OpenDirectory and added ActivateNpadWithRevisionDavid Marcec1-1/+7
With these, `Nintendo Entertainment System - Nintendo Switch Online` loads
2018-09-18Added ActivateGestureDavid Marcec1-1/+7
2018-09-18Added StopSixAxisSensorDavid Marcec1-1/+7
2018-09-18Stubbed ActivateConsoleSixAxisSensor & StartConsoleSixAxisSensorDavid Marcec1-2/+14
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi1-1/+1
2018-09-11hle/service: Default constructors and destructors in the cpp file where applicableLioncash4-0/+9
When a destructor isn't defaulted into a cpp file, it can cause the use of forward declarations to seemingly fail to compile for non-obvious reasons. It also allows inlining of the construction/destruction logic all over the place where a constructor or destructor is invoked, which can lead to code bloat. This isn't so much a worry here, given the services won't be created and destroyed frequently. The cause of the above mentioned non-obvious errors can be demonstrated as follows: ------- Demonstrative example, if you know how the described error happens, skip forwards ------- Assume we have the following in the header, which we'll call "thing.h": \#include <memory> // Forward declaration. For example purposes, assume the definition // of Object is in some header named "object.h" class Object; class Thing { public: // assume no constructors or destructors are specified here, // or the constructors/destructors are defined as: // // Thing() = default; // ~Thing() = default; // // ... Some interface member functions would be defined here private: std::shared_ptr<Object> obj; }; If this header is included in a cpp file, (which we'll call "main.cpp"), this will result in a compilation error, because even though no destructor is specified, the destructor will still need to be generated by the compiler because std::shared_ptr's destructor is *not* trivial (in other words, it does something other than nothing), as std::shared_ptr's destructor needs to do two things: 1. Decrement the shared reference count of the object being pointed to, and if the reference count decrements to zero, 2. Free the Object instance's memory (aka deallocate the memory it's pointing to). And so the compiler generates the code for the destructor doing this inside main.cpp. Now, keep in mind, the Object forward declaration is not a complete type. All it does is tell the compiler "a type named Object exists" and allows us to use the name in certain situations to avoid a header dependency. So the compiler needs to generate destruction code for Object, but the compiler doesn't know *how* to destruct it. A forward declaration doesn't tell the compiler anything about Object's constructor or destructor. So, the compiler will issue an error in this case because it's undefined behavior to try and deallocate (or construct) an incomplete type and std::shared_ptr and std::unique_ptr make sure this isn't the case internally. Now, if we had defaulted the destructor in "thing.cpp", where we also include "object.h", this would never be an issue, as the destructor would only have its code generated in one place, and it would be in a place where the full class definition of Object would be visible to the compiler. ---------------------- End example ---------------------------- Given these service classes are more than certainly going to change in the future, this defaults the constructors and destructors into the relevant cpp files to make the construction and destruction of all of the services consistent and unlikely to run into cases where forward declarations are indirectly causing compilation errors. It also has the plus of avoiding the need to rebuild several services if destruction logic changes, since it would only be necessary to recompile the single cpp file.
2018-09-09hid: Implement ReloadInputDevicesfearlessTobi1-4/+4
2018-08-29kernel: Eliminate kernel global stateLioncash1-3/+6
As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
2018-08-24hid: Move core include to cpp fileLioncash2-1/+4
This isn't required to be in the header. Instead, directly include what this header needs and move it to the cpp file where it belongs.
2018-08-12hid: disable clang-format around tablesLioncash1-4/+5
Prevents clang-format from butchering them.
2018-08-12hid: Stub DisconnectNpad()Lioncash1-1/+7
This is required by ARMS.
2018-08-08hid: fix IsSixAxisSensorAtRest() responsemailwl1-1/+1
2018-08-07services/hid: Add ActivateNpadWithRevision() to the hid function info arrayLioncash1-0/+1
Updated based off the information on Switch Brew.
2018-07-30Add some HID commands (#843)Hexagon121-2/+16
* Added some HID commands * Addressed comments
2018-07-26service/hid: Add the hidbus, hid:dbg, hid:sys, and hid:tmp servicesLioncash1-0/+220
2018-07-26service/hid: Add the xcd:sys serviceLioncash3-0/+55
2018-07-26service/hid: Add irs servicesLioncash3-0/+73
2018-07-24core_timing: Split off utility functions into core_timing_utilMerryMage1-0/+1
2018-07-19hid: Use a ranged-for loops in UpdatePadCallbackLioncash1-7/+3
Modernizes the loops themselves while also getting rid of a signed/unsigned comparison in a loop condition.
2018-07-19hid: Use HID_NUM_LAYOUTS constant for indicating size of the layouts arrayLioncash1-1/+1
Gets rid of the use of a magic constant
2018-07-18Fill in more fields in TouchScreenEntryTouchZach Hilman1-4/+9
2018-07-18Single touch supportZach Hilman1-4/+19
2018-07-15HID: Update controllers less oftenJames Rowe1-3/+3
2018-07-11hid: Fix timestamps and controller type.bunnei1-7/+5
- This fixes user input in SMO.
2018-07-03Rename logging macro back to LOG_*James Rowe1-25/+25
2018-06-14Narrow down filter of layout configsZach Hilman2-10/+5
2018-06-13Move loop condition to free functionZach Hilman1-4/+9
2018-06-13Avoid initializing single-joycon layouts with handheld controllerZach Hilman2-1/+5
2018-06-12hid: Update all layouts and only show handheld as connected, fixes libnx input for P1_AUTOshinyquagsire232-2/+3
2018-05-30add IPC CommandType & Some HID FunctionInfo (#487)greggameplayer1-0/+30
* add some CommandType * add some hid FunctionInfo * add some other HID FunctionInfo * delete non useful comments
2018-05-24Fix deadlocks caused from HID having too many layoutsDavid Marcec1-1/+1
Games such as SMO deadlock if we have more than 2 layouts
2018-05-07hid: Tweaks, Analog Sticks (#435)Max Thomas2-68/+220
* hid: Update mouse/keyboard state * hid: Working analog sticks * hid: Nits * hid: Nits * hid: Update mystery sections * hid: Tweaks
2018-04-30core_timing: Namespace all functions and constants in core_timing's headerLioncash1-3/+3
All of these variables and functions are related to timings and should be within the namespace.
2018-04-24hid: Move logging macros over to new fmt-compatible onesLioncash1-25/+25
2018-04-20service: Use nested namespace specifiers where applicableLioncash2-8/+4
Tidies up namespace declarations
2018-04-13Stubbed out GetPlayerLedPatternHexagon121-1/+7
2018-04-10Updated hid with more service names.Hexagon121-0/+50
2018-04-01hid: Write empty touch screen state.bunnei1-5/+21
2018-03-31hid: Stub out GetSupportedNpadStyleSet.bunnei1-0/+8
2018-03-25hid: Stub out SetNpadJoyAssignmentModeDual.bunnei1-1/+7
2018-03-04CoreTiming: Unschedule the pending events when an Interface is destroyed.Subv1-0/+4
2018-02-16Service/hid: stub some functionsmailwl1-0/+43
2018-02-15hid: Stub GetVibrationDeviceInfo and SendVibrationValues.bunnei1-0/+15
2018-02-07Service: stub some functions in am, audio, time, vi servicesmailwl1-0/+22
2018-02-06Service/hid: stub SetNpadHandheldActivationModemailwl1-0/+7
2018-02-06hid: Stub ActivateTouchScreen and SetNpadJoyHoldType.bunnei1-2/+14
2018-02-05hid: Stub out several functions.bunnei1-1/+39
2018-02-04hid: Implement CreateActiveVibrationDeviceList.bunnei1-0/+25
2018-02-04logger: Use Service_HID category where applicable.bunnei1-2/+2
2018-01-25hle: Rename RequestBuilder to ResponseBuilder.bunnei1-2/+2
2018-01-25service: Fix all incorrect IPC response headers.bunnei1-11/+2
2018-01-23Services: Added a todo about returning interfaces as domain objects in lm, hid and time.Subv1-0/+3
2018-01-22HID: Don't create an unnecessary port in CreateAppletResource.Subv1-13/+13
2018-01-22Stub OpenAudioOut and fix a issue with HID IAppletResource being created more than oncegdkchan1-1/+6
2018-01-17hid: Adjust timing based on actual hardwareshinyquagsire231-3/+3
2018-01-17hid: clang-formatshinyquagsire231-3/+3
2018-01-17hid: Adjust for style guideshinyquagsire232-63/+68
2018-01-16hid: Write to all layouts, implement circular buffers, set up controller metadata.shinyquagsire232-39/+71
2018-01-15hid: Bare-minimum sharedmem inputshinyquagsire232-2/+88
2018-01-15hid: Remove redundant HID prefix on structs/enumsshinyquagsire231-73/+73
2018-01-15hid: Add sharedmem structsshinyquagsire231-0/+312
2018-01-15hid: Remove unused registered_loggers.bunnei1-3/+0
2018-01-15hid: Implement IAppletResource::GetSharedMemoryHandle.bunnei2-10/+67
2017-10-13Remove lots more 3DS-specific code.bunnei6-793/+6
2017-09-30Fixed type conversion ambiguityHuw Pascoe1-1/+1
2017-08-24HID: use TouchDevice for touch padwwylele1-4/+8
2017-08-20HID: fix a comment and a warningwwylele1-2/+2
2017-08-11HID: use MotionDevice for Accelerometer and Gyroscopewwylele1-5/+27
2017-08-10HID: zero unused PadState bitswwylele1-1/+1
2017-06-19ResultVal: Remove MoveFrom()Yuri Kunde Schlesner1-6/+6
Replace it with std::move(result_val).Unwrap(), or Foo().Unwrap() in case you already have an rvalue.
2017-06-06Service: Remove unnecessary includes from service.hYuri Kunde Schlesner1-0/+2
This has a huge fallout in terms of needing to fix other files because all service implementations included that file.
2017-05-04ir: implement new 3ds HID via ir:rstwwylele2-8/+21
2017-03-01Input: remove unused stuff & clean upwwylele1-34/+0
1. removed zl, zr and c-stick from HID::PadState. They are handled by IR, not HID 2. removed button handling in EmuWindow 3. removed key_map 4. cleanup #include
2017-03-01HID: use AnalogDevicewwylele1-2/+9
2017-03-01HID: use ButtonDevicewwylele2-1/+47
2017-02-17HID: move enable_accelerometer/gyroscope_count initialization into Init() (#2574)Weiyi Wang1-2/+5
Fixes #2556
2017-02-11hid: remove the touch field from PadState (#2557)Weiyi Wang1-4/+0
2017-01-20HID: reset acceleroeter and gyroscope index in Initwwylele1-0/+2
2017-01-16CoreTiming: use named constant for ARM11 clock ratewwylele1-3/+3
2017-01-16HID: manages updating itself using correct tickswwylele2-58/+93
2016-12-23core: Move emu_window and key_map into coreMerryMage1-1/+1
* Removes circular dependences (common should not depend on core)
2016-12-15hid: Get rid of a double -> float truncation warningLioncash1-1/+2
float literals need to have the 'f' prefix.
2016-09-21Use negative priorities to avoid special-casing the self-includeYuri Kunde Schlesner3-3/+3
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot2-9/+4
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-19Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner3-7/+6
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot4-75/+77
2016-06-11hid: add missing headerwwylele1-0/+2
2016-05-15fixup! fixup! Refactor input systemwwylele1-1/+1
2016-05-15Refactor input subsystemwwylele2-35/+36
2016-05-13Kernel/SharedMemory: Properly implemented shared memory support.Subv1-2/+3
Applications can request the kernel to allocate a piece of the linear heap for them when creating a shared memory object. Shared memory areas are now properly mapped into the target processes when calling svcMapMemoryBlock. Removed the APT Shared Font hack as it is no longer needed.
2016-03-26use reference instead of pointerwwylele1-9/+9
2016-03-25implement GyroscopeCalibrateParamwwylele2-9/+20
2016-03-22implement accel and gyro backendwwylele4-23/+176
2016-03-13hid: fix pad updatewwylele1-1/+1
2016-03-12svc: Make ResetType an enum classLioncash1-5/+5
2016-02-12BitField: Make trivially copyable and remove assignment operatorMerryMage1-1/+1
2016-02-02services: Get rid of unnecessary includesLioncash3-3/+0
2015-12-30services: Update some function tablesLioncash1-0/+2
2015-09-16general: Silence some warnings when using clangLioncash1-2/+2
2015-07-28Move input values into an arrayJames Rowe2-1/+14
2015-06-28CitraQt: Cleanup includes.Emmanuel Gil Peyrot1-0/+1
2015-06-28Common: Cleanup key_map includes.Emmanuel Gil Peyrot1-7/+9
2015-05-29Remove every trailing whitespace from the project (but externals).Emmanuel Gil Peyrot3-3/+3
2015-05-27hid: Get rid of undefined behaviorLioncash1-2/+2
Modifying a variable twice across a sequence point.
2015-05-23HID: Stub DisableAccelerometer and DisableGyroscopeLowpurpasmart964-9/+47
2015-05-11Kernel: Capture SharedMemory attributes at creation, not when mappingYuri Kunde Schlesner1-2/+4
2015-05-07Common: Remove common.hYuri Kunde Schlesner1-0/+2
2015-05-02Services: Initialize all state variables at bootup.bunnei1-8/+14
2015-04-03Services: Stubs and minor changespurpasmart962-6/+6
2015-03-17HID: Proper Signal Interrupts for EnableAccelerometer & EnableGyroscopeLow alongpurpasmart964-12/+72
with a stub for GetSoundVolume
2015-03-16arm_interface: Get rid of GetTicks.Lioncash1-3/+3
Removes a TODO.
2015-03-11hid_user: Removed unnecessary includes.bunnei1-2/+0
2015-03-11HID: Removed unnecessary global variables.bunnei2-58/+42
2015-03-11HID: Added additional variable comments and some code cleanups.bunnei2-20/+29
2015-03-11HID: Complete refactor of pad/touch input to fix threading issues.bunnei2-111/+28
2015-03-10HID: Cleanup how `next_touch_index` is calculated for Pad and touch.bunnei1-2/+2
2015-03-10HID: Changed TouchDataEntry `valid` to a BitField and added some doc strings.bunnei2-4/+4
2015-03-10HID: Added static asserts to check register position in shared memory.bunnei1-2/+16
2015-03-10HID: Added functions to emulate the touchpad.bunnei2-0/+61
2015-03-10HID: Moved some docstrings to the header.bunnei2-24/+16
2015-03-10HID: Refactored shared memory decoding for touchpad support.bunnei2-33/+64
2015-03-04Services: Moved the PTM and APT services to their own folderSubv6-81/+75
This coincidentally fixes an issue about the PTM service failing to create its SharedExtSaveData archive due to the FS service not being initialized by the time the creating code runs. Ideally I'd like to move each process to its own folder, and have a single file per process that registers the service classes, which would be in their own files inside that folder. Then each service class would just call functions from the process to complete the commands.
2015-02-22Frontends, HID: Add New 3DS specific pad buttons, and stub the touch one.Emmanuel Gil Peyrot1-0/+19
2015-02-11Asserts: break/crash program, fit to style guide; log.h->assert.harchshift2-3/+0
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time) As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing) Also removed some GEKKO cruft.
2015-02-02Kernel: Stop creating useless Handles during object creationYuri Kunde Schlesner1-6/+6
They're finally unnecessary, and will stop cluttering the application's handle table.
2015-02-02HID: Fix crash when pressing a key when the emulator is stoppedYuri Kunde Schlesner1-0/+2
2015-02-02Service: Clean-up InterfaceYuri Kunde Schlesner2-2/+2
2015-01-30Kernel: Convert Event to not use HandlesYuri Kunde Schlesner3-23/+27
2015-01-30Kernel: Convert SharedMemory to not use HandlesYuri Kunde Schlesner3-5/+11
2015-01-21Added HID_SPVR service and split HID_U implementation into service/hid/hid.xxxarchshift6-0/+414