mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-12-02 20:42:28 -05:00
Move solution and projects to src
This commit is contained in:
8
src/Ryujinx.HLE/HOS/Services/Ptm/Fan/IManager.cs
Normal file
8
src/Ryujinx.HLE/HOS/Services/Ptm/Fan/IManager.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Fan
|
||||
{
|
||||
[Service("fan")]
|
||||
class IManager : IpcService
|
||||
{
|
||||
public IManager(ServiceCtx context) { }
|
||||
}
|
||||
}
|
||||
8
src/Ryujinx.HLE/HOS/Services/Ptm/Fgm/IDebugger.cs
Normal file
8
src/Ryujinx.HLE/HOS/Services/Ptm/Fgm/IDebugger.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Fgm
|
||||
{
|
||||
[Service("fgm:dbg")] // 9.0.0+
|
||||
class IDebugger : IpcService
|
||||
{
|
||||
public IDebugger(ServiceCtx context) { }
|
||||
}
|
||||
}
|
||||
10
src/Ryujinx.HLE/HOS/Services/Ptm/Fgm/ISession.cs
Normal file
10
src/Ryujinx.HLE/HOS/Services/Ptm/Fgm/ISession.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Fgm
|
||||
{
|
||||
[Service("fgm")] // 9.0.0+
|
||||
[Service("fgm:0")] // 9.0.0+
|
||||
[Service("fgm:9")] // 9.0.0+
|
||||
class ISession : IpcService
|
||||
{
|
||||
public ISession(ServiceCtx context) { }
|
||||
}
|
||||
}
|
||||
8
src/Ryujinx.HLE/HOS/Services/Ptm/Pcm/IManager.cs
Normal file
8
src/Ryujinx.HLE/HOS/Services/Ptm/Pcm/IManager.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Pcm
|
||||
{
|
||||
[Service("pcm")]
|
||||
class IManager : IpcService
|
||||
{
|
||||
public IManager(ServiceCtx context) { }
|
||||
}
|
||||
}
|
||||
45
src/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmServer.cs
Normal file
45
src/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmServer.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using Ryujinx.Common.Logging;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
|
||||
{
|
||||
[Service("psm")]
|
||||
class IPsmServer : IpcService
|
||||
{
|
||||
public IPsmServer(ServiceCtx context) { }
|
||||
|
||||
[CommandCmif(0)]
|
||||
// GetBatteryChargePercentage() -> u32
|
||||
public static ResultCode GetBatteryChargePercentage(ServiceCtx context)
|
||||
{
|
||||
int chargePercentage = 100;
|
||||
|
||||
context.ResponseData.Write(chargePercentage);
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargePercentage });
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(1)]
|
||||
// GetChargerType() -> u32
|
||||
public static ResultCode GetChargerType(ServiceCtx context)
|
||||
{
|
||||
ChargerType chargerType = ChargerType.ChargerOrDock;
|
||||
|
||||
context.ResponseData.Write((int)chargerType);
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargerType });
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(7)]
|
||||
// OpenSession() -> IPsmSession
|
||||
public ResultCode OpenSession(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IPsmSession(context.Device.System));
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
88
src/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmSession.cs
Normal file
88
src/Ryujinx.HLE/HOS/Services/Ptm/Psm/IPsmSession.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Ipc;
|
||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||
using Ryujinx.Horizon.Common;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
|
||||
{
|
||||
class IPsmSession : IpcService
|
||||
{
|
||||
private KEvent _stateChangeEvent;
|
||||
private int _stateChangeEventHandle;
|
||||
|
||||
public IPsmSession(Horizon system)
|
||||
{
|
||||
_stateChangeEvent = new KEvent(system.KernelContext);
|
||||
_stateChangeEventHandle = -1;
|
||||
}
|
||||
|
||||
[CommandCmif(0)]
|
||||
// BindStateChangeEvent() -> KObject
|
||||
public ResultCode BindStateChangeEvent(ServiceCtx context)
|
||||
{
|
||||
if (_stateChangeEventHandle == -1)
|
||||
{
|
||||
Result resultCode = context.Process.HandleTable.GenerateHandle(_stateChangeEvent.ReadableEvent, out _stateChangeEventHandle);
|
||||
|
||||
if (resultCode != Result.Success)
|
||||
{
|
||||
return (ResultCode)resultCode.ErrorCode;
|
||||
}
|
||||
}
|
||||
|
||||
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_stateChangeEventHandle);
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServicePsm);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(1)]
|
||||
// UnbindStateChangeEvent()
|
||||
public ResultCode UnbindStateChangeEvent(ServiceCtx context)
|
||||
{
|
||||
if (_stateChangeEventHandle != -1)
|
||||
{
|
||||
context.Process.HandleTable.CloseHandle(_stateChangeEventHandle);
|
||||
_stateChangeEventHandle = -1;
|
||||
}
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServicePsm);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(2)]
|
||||
// SetChargerTypeChangeEventEnabled(u8)
|
||||
public ResultCode SetChargerTypeChangeEventEnabled(ServiceCtx context)
|
||||
{
|
||||
bool chargerTypeChangeEventEnabled = context.RequestData.ReadBoolean();
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServicePsm, new { chargerTypeChangeEventEnabled });
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(3)]
|
||||
// SetPowerSupplyChangeEventEnabled(u8)
|
||||
public ResultCode SetPowerSupplyChangeEventEnabled(ServiceCtx context)
|
||||
{
|
||||
bool powerSupplyChangeEventEnabled = context.RequestData.ReadBoolean();
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServicePsm, new { powerSupplyChangeEventEnabled });
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(4)]
|
||||
// SetBatteryVoltageStateChangeEventEnabled(u8)
|
||||
public ResultCode SetBatteryVoltageStateChangeEventEnabled(ServiceCtx context)
|
||||
{
|
||||
bool batteryVoltageStateChangeEventEnabled = context.RequestData.ReadBoolean();
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServicePsm, new { batteryVoltageStateChangeEventEnabled });
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
|
||||
{
|
||||
enum ChargerType
|
||||
{
|
||||
None,
|
||||
ChargerOrDock,
|
||||
UsbC
|
||||
}
|
||||
}
|
||||
8
src/Ryujinx.HLE/HOS/Services/Ptm/Tc/IManager.cs
Normal file
8
src/Ryujinx.HLE/HOS/Services/Ptm/Tc/IManager.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Tc
|
||||
{
|
||||
[Service("tc")]
|
||||
class IManager : IpcService
|
||||
{
|
||||
public IManager(ServiceCtx context) { }
|
||||
}
|
||||
}
|
||||
39
src/Ryujinx.HLE/HOS/Services/Ptm/Ts/IMeasurementServer.cs
Normal file
39
src/Ryujinx.HLE/HOS/Services/Ptm/Ts/IMeasurementServer.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Services.Ptm.Ts.Types;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Ts
|
||||
{
|
||||
[Service("ts")]
|
||||
class IMeasurementServer : IpcService
|
||||
{
|
||||
private const uint DefaultTemperature = 42u;
|
||||
|
||||
public IMeasurementServer(ServiceCtx context) { }
|
||||
|
||||
[CommandCmif(1)]
|
||||
// GetTemperature(Location location) -> u32
|
||||
public ResultCode GetTemperature(ServiceCtx context)
|
||||
{
|
||||
Location location = (Location)context.RequestData.ReadByte();
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServicePtm, new { location });
|
||||
|
||||
context.ResponseData.Write(DefaultTemperature);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[CommandCmif(3)]
|
||||
// GetTemperatureMilliC(Location location) -> u32
|
||||
public ResultCode GetTemperatureMilliC(ServiceCtx context)
|
||||
{
|
||||
Location location = (Location)context.RequestData.ReadByte();
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServicePtm, new { location });
|
||||
|
||||
context.ResponseData.Write(DefaultTemperature * 1000);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
8
src/Ryujinx.HLE/HOS/Services/Ptm/Ts/Types/Location.cs
Normal file
8
src/Ryujinx.HLE/HOS/Services/Ptm/Ts/Types/Location.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.HLE.HOS.Services.Ptm.Ts.Types
|
||||
{
|
||||
enum Location : byte
|
||||
{
|
||||
Internal,
|
||||
External
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user