summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid (unfollow)
Commit message (Collapse)AuthorFilesLines
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-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