mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2025-09-23 01:42:03 -05:00
Refactor IPC services to have commands into separate classes, fix readme url
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using Ryujinx.Core.OsHle.Ipc;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.Core.OsHle.IpcServices.Hid
|
||||
{
|
||||
class IActiveApplicationDeviceList : IIpcService
|
||||
{
|
||||
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
||||
|
||||
public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
||||
|
||||
public IActiveApplicationDeviceList()
|
||||
{
|
||||
m_Commands = new Dictionary<int, ServiceProcessRequest>() { };
|
||||
}
|
||||
}
|
||||
}
|
32
Ryujinx.Core/OsHle/IpcServices/Hid/IAppletResource.cs
Normal file
32
Ryujinx.Core/OsHle/IpcServices/Hid/IAppletResource.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Ryujinx.Core.OsHle.Handles;
|
||||
using Ryujinx.Core.OsHle.Ipc;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.Core.OsHle.IpcServices.Hid
|
||||
{
|
||||
class IAppletResource : IIpcService
|
||||
{
|
||||
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
||||
|
||||
public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
||||
|
||||
private HSharedMem Handle;
|
||||
|
||||
public IAppletResource(HSharedMem Handle)
|
||||
{
|
||||
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
||||
{
|
||||
{ 0, GetSharedMemoryHandle }
|
||||
};
|
||||
|
||||
this.Handle = Handle;
|
||||
}
|
||||
|
||||
public static long GetSharedMemoryHandle(ServiceCtx Context)
|
||||
{
|
||||
Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Context.Ns.Os.HidHandle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
98
Ryujinx.Core/OsHle/IpcServices/Hid/ServiceHid.cs
Normal file
98
Ryujinx.Core/OsHle/IpcServices/Hid/ServiceHid.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using Ryujinx.Core.OsHle.Handles;
|
||||
using Ryujinx.Core.OsHle.Ipc;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using static Ryujinx.Core.OsHle.IpcServices.ObjHelper;
|
||||
|
||||
namespace Ryujinx.Core.OsHle.IpcServices.Hid
|
||||
{
|
||||
class ServiceHid : IIpcService
|
||||
{
|
||||
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
||||
|
||||
public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
||||
|
||||
public ServiceHid()
|
||||
{
|
||||
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
||||
{
|
||||
{ 0, CreateAppletResource },
|
||||
{ 11, ActivateTouchScreen },
|
||||
{ 100, SetSupportedNpadStyleSet },
|
||||
{ 101, GetSupportedNpadStyleSet },
|
||||
{ 102, SetSupportedNpadIdType },
|
||||
{ 103, ActivateNpad },
|
||||
{ 120, SetNpadJoyHoldType },
|
||||
{ 121, GetNpadJoyHoldType },
|
||||
{ 203, CreateActiveVibrationDeviceList },
|
||||
};
|
||||
}
|
||||
|
||||
public long CreateAppletResource(ServiceCtx Context)
|
||||
{
|
||||
HSharedMem HidHndData = Context.Ns.Os.Handles.GetData<HSharedMem>(Context.Ns.Os.HidHandle);
|
||||
|
||||
MakeObject(Context, new IAppletResource(HidHndData));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long ActivateTouchScreen(ServiceCtx Context)
|
||||
{
|
||||
long Unknown = Context.RequestData.ReadInt64();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public long CreateActiveVibrationDeviceList(ServiceCtx Context)
|
||||
{
|
||||
MakeObject(Context, new IActiveApplicationDeviceList());
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user