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,62 @@
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Services.Pcv.Types;
using System.Linq;
namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst.ClkrstManager
{
class IClkrstSession : IpcService
{
private DeviceCode _deviceCode;
private uint _unknown;
private uint _clockRate;
private DeviceCode[] allowedDeviceCodeTable = new DeviceCode[]
{
DeviceCode.Cpu, DeviceCode.Gpu, DeviceCode.Disp1, DeviceCode.Disp2,
DeviceCode.Tsec, DeviceCode.Mselect, DeviceCode.Sor1, DeviceCode.Host1x,
DeviceCode.Vic, DeviceCode.Nvenc, DeviceCode.Nvjpg, DeviceCode.Nvdec,
DeviceCode.Ape, DeviceCode.AudioDsp, DeviceCode.Emc, DeviceCode.Dsi,
DeviceCode.SysBus, DeviceCode.XusbSs, DeviceCode.XusbHost, DeviceCode.XusbDevice,
DeviceCode.Gpuaux, DeviceCode.Pcie, DeviceCode.Apbdma, DeviceCode.Sdmmc1,
DeviceCode.Sdmmc2, DeviceCode.Sdmmc4
};
public IClkrstSession(DeviceCode deviceCode, uint unknown)
{
_deviceCode = deviceCode;
_unknown = unknown;
}
[CommandCmif(7)]
// SetClockRate(u32 hz)
public ResultCode SetClockRate(ServiceCtx context)
{
if (!allowedDeviceCodeTable.Contains(_deviceCode))
{
return ResultCode.InvalidArgument;
}
_clockRate = context.RequestData.ReadUInt32();
Logger.Stub?.PrintStub(LogClass.ServicePcv, new { _clockRate });
return ResultCode.Success;
}
[CommandCmif(8)]
// GetClockRate() -> u32 hz
public ResultCode GetClockRate(ServiceCtx context)
{
if (!allowedDeviceCodeTable.Contains(_deviceCode))
{
return ResultCode.InvalidArgument;
}
context.ResponseData.Write(_clockRate);
Logger.Stub?.PrintStub(LogClass.ServicePcv, new { _clockRate });
return ResultCode.Success;
}
}
}

View File

@@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst
{
[Service("clkrst:a")] // 8.0.0+
class IArbitrationManager : IpcService
{
public IArbitrationManager(ServiceCtx context) { }
}
}

View File

@@ -0,0 +1,57 @@
using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Services.Pcv.Clkrst.ClkrstManager;
using Ryujinx.HLE.HOS.Services.Pcv.Types;
using Ryujinx.Horizon.Common;
using System;
namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst
{
[Service("clkrst")] // 8.0.0+
[Service("clkrst:i")] // 8.0.0+
class IClkrstManager : IpcService
{
private int _moduleStateTableEventHandle = 0;
public IClkrstManager(ServiceCtx context) { }
[CommandCmif(0)]
// OpenSession(u32 device_code, u32 unk) -> object<nn::clkrst::IClkrstSession>
public ResultCode OpenSession(ServiceCtx context)
{
DeviceCode deviceCode = (DeviceCode)context.RequestData.ReadUInt32();
uint unknown = context.RequestData.ReadUInt32();
// TODO: Service checks the deviceCode and the unk value.
MakeObject(context, new IClkrstSession(deviceCode, unknown));
return ResultCode.Success;
}
[CommandCmif(4)]
// GetModuleStateTableEvent() -> handle<copy>
public ResultCode GetModuleStateTableEvent(ServiceCtx context)
{
if (_moduleStateTableEventHandle == 0)
{
if (context.Process.HandleTable.GenerateHandle(context.Device.System.IirsSharedMem, out _moduleStateTableEventHandle) != Result.Success)
{
throw new InvalidOperationException("Out of handles!");
}
}
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_moduleStateTableEventHandle);
return ResultCode.Success;
}
[CommandCmif(5)]
// GetModuleStateTableMaxCount() -> u32 max_count
public ResultCode GetModuleStateTableMaxCount(ServiceCtx context)
{
context.ResponseData.Write(26u);
return ResultCode.Success;
}
}
}