ISystemManager.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. namespace Ryujinx.HLE.HOS.Services.Apm
  2. {
  3. abstract class ISystemManager : IpcService
  4. {
  5. public ISystemManager(ServiceCtx context) { }
  6. protected abstract void RequestPerformanceMode(PerformanceMode performanceMode);
  7. internal abstract void SetCpuBoostMode(CpuBoostMode cpuBoostMode);
  8. protected abstract PerformanceConfiguration GetCurrentPerformanceConfiguration();
  9. [CommandHipc(0)]
  10. // RequestPerformanceMode(nn::apm::PerformanceMode)
  11. public ResultCode RequestPerformanceMode(ServiceCtx context)
  12. {
  13. RequestPerformanceMode((PerformanceMode)context.RequestData.ReadInt32());
  14. // NOTE: This call seems to overclock the system related to the PerformanceMode, since we emulate it, it's fine to do nothing instead.
  15. return ResultCode.Success;
  16. }
  17. [CommandHipc(6)] // 7.0.0+
  18. // SetCpuBoostMode(nn::apm::CpuBootMode)
  19. public ResultCode SetCpuBoostMode(ServiceCtx context)
  20. {
  21. SetCpuBoostMode((CpuBoostMode)context.RequestData.ReadUInt32());
  22. // NOTE: This call seems to overclock the system related to the CpuBoostMode, since we emulate it, it's fine to do nothing instead.
  23. return ResultCode.Success;
  24. }
  25. [CommandHipc(7)] // 7.0.0+
  26. // GetCurrentPerformanceConfiguration() -> nn::apm::PerformanceConfiguration
  27. public ResultCode GetCurrentPerformanceConfiguration(ServiceCtx context)
  28. {
  29. context.ResponseData.Write((uint)GetCurrentPerformanceConfiguration());
  30. return ResultCode.Success;
  31. }
  32. }
  33. }