| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- using Ryujinx.HLE.Input;
- using Ryujinx.HLE.Logging;
- using Ryujinx.HLE.OsHle.Ipc;
- using System.Collections.Generic;
- namespace Ryujinx.HLE.OsHle.Services.Hid
- {
- class IHidServer : IpcService
- {
- private Dictionary<int, ServiceProcessRequest> m_Commands;
- public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
- public IHidServer()
- {
- m_Commands = new Dictionary<int, ServiceProcessRequest>()
- {
- { 0, CreateAppletResource },
- { 1, ActivateDebugPad },
- { 11, ActivateTouchScreen },
- { 21, ActivateMouse },
- { 31, ActivateKeyboard },
- { 66, StartSixAxisSensor },
- { 79, SetGyroscopeZeroDriftMode },
- { 100, SetSupportedNpadStyleSet },
- { 101, GetSupportedNpadStyleSet },
- { 102, SetSupportedNpadIdType },
- { 103, ActivateNpad },
- { 108, GetPlayerLedPattern },
- { 120, SetNpadJoyHoldType },
- { 121, GetNpadJoyHoldType },
- { 122, SetNpadJoyAssignmentModeSingleByDefault },
- { 123, SetNpadJoyAssignmentModeSingle },
- { 124, SetNpadJoyAssignmentModeDual },
- { 125, MergeSingleJoyAsDualJoy },
- { 128, SetNpadHandheldActivationMode },
- { 200, GetVibrationDeviceInfo },
- { 201, SendVibrationValue },
- { 203, CreateActiveVibrationDeviceList },
- { 206, SendVibrationValues }
- };
- }
- public long CreateAppletResource(ServiceCtx Context)
- {
- MakeObject(Context, new IAppletResource(Context.Ns.Os.HidSharedMem));
- return 0;
- }
- public long ActivateDebugPad(ServiceCtx Context)
- {
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long ActivateTouchScreen(ServiceCtx Context)
- {
- long AppletResourceUserId = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long ActivateMouse(ServiceCtx Context)
- {
- long AppletResourceUserId = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long ActivateKeyboard(ServiceCtx Context)
- {
- long AppletResourceUserId = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long StartSixAxisSensor(ServiceCtx Context)
- {
- int Handle = Context.RequestData.ReadInt32();
- long AppletResourceUserId = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long SetGyroscopeZeroDriftMode(ServiceCtx Context)
- {
- int Handle = Context.RequestData.ReadInt32();
- int Unknown = Context.RequestData.ReadInt32();
- long AppletResourceUserId = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long GetSupportedNpadStyleSet(ServiceCtx Context)
- {
- Context.ResponseData.Write(0);
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long SetSupportedNpadStyleSet(ServiceCtx Context)
- {
- long Unknown0 = Context.RequestData.ReadInt64();
- long Unknown8 = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long SetSupportedNpadIdType(ServiceCtx Context)
- {
- long Unknown = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long ActivateNpad(ServiceCtx Context)
- {
- long Unknown = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long GetPlayerLedPattern(ServiceCtx Context)
- {
- long Unknown = Context.RequestData.ReadInt32();
- Context.ResponseData.Write(0L);
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long SetNpadJoyHoldType(ServiceCtx Context)
- {
- long Unknown0 = Context.RequestData.ReadInt64();
- long Unknown8 = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long GetNpadJoyHoldType(ServiceCtx Context)
- {
- Context.ResponseData.Write(0L);
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long SetNpadJoyAssignmentModeSingleByDefault(ServiceCtx Context)
- {
- HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32();
- long AppletUserResourceId = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long SetNpadJoyAssignmentModeSingle(ServiceCtx Context)
- {
- HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32();
- long AppletUserResourceId = Context.RequestData.ReadInt64();
- long NpadJoyDeviceType = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long SetNpadJoyAssignmentModeDual(ServiceCtx Context)
- {
- HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32();
- long AppletUserResourceId = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long MergeSingleJoyAsDualJoy(ServiceCtx Context)
- {
- long Unknown0 = Context.RequestData.ReadInt32();
- long Unknown8 = Context.RequestData.ReadInt32();
- long AppletUserResourceId = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long SetNpadHandheldActivationMode(ServiceCtx Context)
- {
- long AppletUserResourceId = Context.RequestData.ReadInt64();
- long Unknown = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long GetVibrationDeviceInfo(ServiceCtx Context)
- {
- int VibrationDeviceHandle = Context.RequestData.ReadInt32();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- Context.ResponseData.Write(0L); //VibrationDeviceInfoForIpc
- return 0;
- }
- public long SendVibrationValue(ServiceCtx Context)
- {
- int VibrationDeviceHandle = Context.RequestData.ReadInt32();
- int VibrationValue1 = Context.RequestData.ReadInt32();
- int VibrationValue2 = Context.RequestData.ReadInt32();
- int VibrationValue3 = Context.RequestData.ReadInt32();
- int VibrationValue4 = Context.RequestData.ReadInt32();
- long AppletUserResourceId = Context.RequestData.ReadInt64();
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- public long CreateActiveVibrationDeviceList(ServiceCtx Context)
- {
- MakeObject(Context, new IActiveApplicationDeviceList());
- return 0;
- }
- public long SendVibrationValues(ServiceCtx Context)
- {
- Context.Ns.Log.PrintStub(LogClass.ServiceHid, "Stubbed.");
- return 0;
- }
- }
- }
|