Move solution and projects to src

This commit is contained in:
TSR Berry
2023-04-08 01:22:00 +02:00
committed by Mary
parent cd124bda58
commit cee7121058
3466 changed files with 55 additions and 55 deletions

View File

@@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Ptm.Fan
{
[Service("fan")]
class IManager : IpcService
{
public IManager(ServiceCtx context) { }
}
}

View 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) { }
}
}

View 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) { }
}
}

View File

@@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Ptm.Pcm
{
[Service("pcm")]
class IManager : IpcService
{
public IManager(ServiceCtx context) { }
}
}

View 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;
}
}
}

View 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;
}
}
}

View File

@@ -0,0 +1,9 @@
namespace Ryujinx.HLE.HOS.Services.Ptm.Psm
{
enum ChargerType
{
None,
ChargerOrDock,
UsbC
}
}

View File

@@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Ptm.Tc
{
[Service("tc")]
class IManager : IpcService
{
public IManager(ServiceCtx context) { }
}
}

View 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;
}
}
}

View File

@@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Ptm.Ts.Types
{
enum Location : byte
{
Internal,
External
}
}