aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/Apm/ISession.cs
diff options
context:
space:
mode:
authorTSR Berry <20988865+TSRBerry@users.noreply.github.com>2023-04-08 01:22:00 +0200
committerMary <thog@protonmail.com>2023-04-27 23:51:14 +0200
commitcee712105850ac3385cd0091a923438167433f9f (patch)
tree4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /src/Ryujinx.HLE/HOS/Services/Apm/ISession.cs
parentcd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff)
Move solution and projects to src
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Apm/ISession.cs')
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Apm/ISession.cs45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Apm/ISession.cs b/src/Ryujinx.HLE/HOS/Services/Apm/ISession.cs
new file mode 100644
index 00000000..f828cd17
--- /dev/null
+++ b/src/Ryujinx.HLE/HOS/Services/Apm/ISession.cs
@@ -0,0 +1,45 @@
+namespace Ryujinx.HLE.HOS.Services.Apm
+{
+ abstract class ISession : IpcService
+ {
+ public ISession(ServiceCtx context) { }
+
+ protected abstract ResultCode SetPerformanceConfiguration(PerformanceMode performanceMode, PerformanceConfiguration performanceConfiguration);
+ protected abstract ResultCode GetPerformanceConfiguration(PerformanceMode performanceMode, out PerformanceConfiguration performanceConfiguration);
+ protected abstract void SetCpuOverclockEnabled(bool enabled);
+
+ [CommandCmif(0)]
+ // SetPerformanceConfiguration(nn::apm::PerformanceMode, nn::apm::PerformanceConfiguration)
+ public ResultCode SetPerformanceConfiguration(ServiceCtx context)
+ {
+ PerformanceMode performanceMode = (PerformanceMode)context.RequestData.ReadInt32();
+ PerformanceConfiguration performanceConfiguration = (PerformanceConfiguration)context.RequestData.ReadInt32();
+
+ return SetPerformanceConfiguration(performanceMode, performanceConfiguration);
+ }
+
+ [CommandCmif(1)]
+ // GetPerformanceConfiguration(nn::apm::PerformanceMode) -> nn::apm::PerformanceConfiguration
+ public ResultCode GetPerformanceConfiguration(ServiceCtx context)
+ {
+ PerformanceMode performanceMode = (PerformanceMode)context.RequestData.ReadInt32();
+
+ ResultCode resultCode = GetPerformanceConfiguration(performanceMode, out PerformanceConfiguration performanceConfiguration);
+
+ context.ResponseData.Write((uint)performanceConfiguration);
+
+ return resultCode;
+ }
+
+ [CommandCmif(2)] // 8.0.0+
+ // SetCpuOverclockEnabled(bool)
+ public ResultCode SetCpuOverclockEnabled(ServiceCtx context)
+ {
+ bool enabled = context.RequestData.ReadBoolean();
+
+ SetCpuOverclockEnabled(enabled);
+
+ return ResultCode.Success;
+ }
+ }
+} \ No newline at end of file