2018-03-20 16:00:00 -04:00
|
|
|
using Ryujinx.Core.Input;
|
2018-02-24 23:34:16 -05:00
|
|
|
using Ryujinx.Core.OsHle.Ipc;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2018-03-20 16:00:00 -04:00
|
|
|
namespace Ryujinx.Core.OsHle.Services.Hid
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-03-19 14:58:46 -04:00
|
|
|
class ServiceHid : IpcService
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
|
|
|
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
|
|
|
|
2018-03-19 14:58:46 -04:00
|
|
|
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
2018-02-24 23:34:16 -05:00
|
|
|
|
|
|
|
public ServiceHid()
|
|
|
|
{
|
|
|
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
|
|
|
{
|
2018-03-13 17:59:17 -04:00
|
|
|
{ 0, CreateAppletResource },
|
2018-04-04 18:16:59 -04:00
|
|
|
{ 1, ActivateDebugPad },
|
2018-03-13 17:59:17 -04:00
|
|
|
{ 11, ActivateTouchScreen },
|
2018-04-04 18:39:47 -04:00
|
|
|
{ 21, ActivateMouse },
|
2018-04-04 18:44:02 -04:00
|
|
|
{ 31, ActivateKeyboard },
|
2018-03-13 20:26:14 -04:00
|
|
|
{ 66, StartSixAxisSensor },
|
2018-03-13 17:59:17 -04:00
|
|
|
{ 100, SetSupportedNpadStyleSet },
|
|
|
|
{ 101, GetSupportedNpadStyleSet },
|
|
|
|
{ 102, SetSupportedNpadIdType },
|
|
|
|
{ 103, ActivateNpad },
|
|
|
|
{ 120, SetNpadJoyHoldType },
|
2018-04-04 18:16:59 -04:00
|
|
|
{ 121, GetNpadJoyHoldType },
|
2018-03-13 17:59:17 -04:00
|
|
|
{ 122, SetNpadJoyAssignmentModeSingleByDefault },
|
|
|
|
{ 123, SetNpadJoyAssignmentModeSingle },
|
|
|
|
{ 124, SetNpadJoyAssignmentModeDual },
|
|
|
|
{ 125, MergeSingleJoyAsDualJoy },
|
|
|
|
{ 200, GetVibrationDeviceInfo },
|
|
|
|
{ 203, CreateActiveVibrationDeviceList },
|
|
|
|
{ 206, SendVibrationValues }
|
2018-02-24 23:34:16 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public long CreateAppletResource(ServiceCtx Context)
|
|
|
|
{
|
2018-03-12 00:04:52 -04:00
|
|
|
MakeObject(Context, new IAppletResource(Context.Ns.Os.HidSharedMem));
|
2018-02-24 23:34:16 -05:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-04 18:16:59 -04:00
|
|
|
public long ActivateDebugPad(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
public long ActivateTouchScreen(ServiceCtx Context)
|
|
|
|
{
|
2018-04-04 18:39:47 -04:00
|
|
|
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long ActivateMouse(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
2018-02-24 23:34:16 -05:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-04 18:44:02 -04:00
|
|
|
public long ActivateKeyboard(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-03-13 20:26:14 -04:00
|
|
|
public long StartSixAxisSensor(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
int Handle = Context.RequestData.ReadInt32();
|
|
|
|
|
|
|
|
long AppletResourceUserId = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
public long GetSupportedNpadStyleSet(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
Context.ResponseData.Write(0);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long SetSupportedNpadStyleSet(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
long Unknown0 = Context.RequestData.ReadInt64();
|
|
|
|
long Unknown8 = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long SetSupportedNpadIdType(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
long Unknown = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long ActivateNpad(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
long Unknown = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long SetNpadJoyHoldType(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
long Unknown0 = Context.RequestData.ReadInt64();
|
|
|
|
long Unknown8 = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long GetNpadJoyHoldType(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
Context.ResponseData.Write(0L);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-03-13 17:59:17 -04:00
|
|
|
public long SetNpadJoyAssignmentModeSingleByDefault(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32();
|
|
|
|
long AppletUserResourseId = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long SetNpadJoyAssignmentModeSingle(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32();
|
|
|
|
long AppletUserResourseId = Context.RequestData.ReadInt64();
|
|
|
|
long NpadJoyDeviceType = Context.RequestData.ReadInt64();
|
2018-04-04 18:39:47 -04:00
|
|
|
|
2018-03-13 17:59:17 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long SetNpadJoyAssignmentModeDual(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
HidControllerId HidControllerId = (HidControllerId)Context.RequestData.ReadInt32();
|
|
|
|
long AppletUserResourseId = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long MergeSingleJoyAsDualJoy(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
long Unknown0 = Context.RequestData.ReadInt32();
|
|
|
|
long Unknown8 = Context.RequestData.ReadInt32();
|
|
|
|
long AppletUserResourseId = Context.RequestData.ReadInt64();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-02-25 13:58:16 -05:00
|
|
|
public long GetVibrationDeviceInfo(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
int VibrationDeviceHandle = Context.RequestData.ReadInt32();
|
|
|
|
|
|
|
|
Context.ResponseData.Write(0L); //VibrationDeviceInfoForIpc
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
public long CreateActiveVibrationDeviceList(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
MakeObject(Context, new IActiveApplicationDeviceList());
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2018-03-03 22:06:44 -05:00
|
|
|
|
|
|
|
public long SendVibrationValues(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2018-02-24 23:34:16 -05:00
|
|
|
}
|
|
|
|
}
|