diff options
| author | Ac_K <Acoustik666@gmail.com> | 2024-04-05 20:45:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-05 15:45:43 -0300 |
| commit | 6d28b643126ee5de476a89f3ff94b5cc3ead3970 (patch) | |
| tree | bb6e1263f9df7aec23488b1ee22a141746c54243 /src/Ryujinx.Horizon/Ptm/Ipc/Session.cs | |
| parent | 05c041feeba085275259f3b434bac4535b7a46d7 (diff) | |
ts: Migrate service to Horizon project (#6514)
* ts: Migrate service to Horizon project
This PR migrate the `ts` service (stored in `ptm`) to the Horizon project:
- It stubs all known IPCs.
- IpcServer consts are checked by RE.
Closes #6480
* Fix args
Diffstat (limited to 'src/Ryujinx.Horizon/Ptm/Ipc/Session.cs')
| -rw-r--r-- | src/Ryujinx.Horizon/Ptm/Ipc/Session.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/Ryujinx.Horizon/Ptm/Ipc/Session.cs b/src/Ryujinx.Horizon/Ptm/Ipc/Session.cs new file mode 100644 index 00000000..191a4b3a --- /dev/null +++ b/src/Ryujinx.Horizon/Ptm/Ipc/Session.cs @@ -0,0 +1,47 @@ +using Ryujinx.Common.Logging; +using Ryujinx.Horizon.Common; +using Ryujinx.Horizon.Ptm.Ipc; +using Ryujinx.Horizon.Sdk.Sf; +using Ryujinx.Horizon.Sdk.Ts; + +namespace Ryujinx.Horizon.Ts.Ipc +{ + partial class Session : ISession + { + private readonly DeviceCode _deviceCode; + + public Session(DeviceCode deviceCode) + { + _deviceCode = deviceCode; + } + + [CmifCommand(0)] + public Result GetTemperatureRange(out int minimumTemperature, out int maximumTemperature) + { + Logger.Stub?.PrintStub(LogClass.ServicePtm, new { _deviceCode }); + + minimumTemperature = MeasurementServer.MinimumTemperature; + maximumTemperature = MeasurementServer.MaximumTemperature; + + return Result.Success; + } + + [CmifCommand(2)] + public Result SetMeasurementMode(byte measurementMode) + { + Logger.Stub?.PrintStub(LogClass.ServicePtm, new { _deviceCode, measurementMode }); + + return Result.Success; + } + + [CmifCommand(4)] + public Result GetTemperature(out int temperature) + { + Logger.Stub?.PrintStub(LogClass.ServicePtm, new { _deviceCode }); + + temperature = MeasurementServer.DefaultTemperature; + + return Result.Success; + } + } +} |
