diff --git a/Ryujinx.HLE/HOS/Services/Am/ICommonStateGetter.cs b/Ryujinx.HLE/HOS/Services/Am/ICommonStateGetter.cs index 594741261..44421b302 100644 --- a/Ryujinx.HLE/HOS/Services/Am/ICommonStateGetter.cs +++ b/Ryujinx.HLE/HOS/Services/Am/ICommonStateGetter.cs @@ -10,6 +10,8 @@ namespace Ryujinx.HLE.HOS.Services.Am { private KEvent _displayResolutionChangeEvent; + private Apm.CpuBoostMode _cpuBoostMode = Apm.CpuBoostMode.Disabled; + public ICommonStateGetter(Horizon system) { _displayResolutionChangeEvent = new KEvent(system); @@ -116,5 +118,24 @@ namespace Ryujinx.HLE.HOS.Services.Am return ResultCode.Success; } + + [Command(66)] // 6.0.0+ + // SetCpuBoostMode(u32 cpu_boost_mode) + public ResultCode SetCpuBoostMode(ServiceCtx context) + { + uint cpuBoostMode = context.RequestData.ReadUInt32(); + + if (cpuBoostMode > 1) + { + return ResultCode.CpuBoostModeInvalid; + } + + _cpuBoostMode = (Apm.CpuBoostMode)cpuBoostMode; + + // NOTE: There is a condition variable after the assignment, probably waiting something with apm:sys service (SetCpuBoostMode call?). + // Since we will probably never support CPU boost things, it's not needed to implement more. + + return ResultCode.Success; + } } } \ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Am/ResultCode.cs b/Ryujinx.HLE/HOS/Services/Am/ResultCode.cs index 3fc76ae63..b46bd2b3c 100644 --- a/Ryujinx.HLE/HOS/Services/Am/ResultCode.cs +++ b/Ryujinx.HLE/HOS/Services/Am/ResultCode.cs @@ -7,6 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Am Success = 0, - NoMessages = (3 << ErrorCodeShift) | ModuleId + NoMessages = (3 << ErrorCodeShift) | ModuleId, + CpuBoostModeInvalid = (506 << ErrorCodeShift) | ModuleId } } \ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Apm/CpuBoostMode.cs b/Ryujinx.HLE/HOS/Services/Apm/CpuBoostMode.cs new file mode 100644 index 000000000..a4c87d3cc --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Apm/CpuBoostMode.cs @@ -0,0 +1,9 @@ +namespace Ryujinx.HLE.HOS.Services.Apm +{ + enum CpuBoostMode + { + Disabled = 0, + Mode1 = 1, // Use PerformanceConfiguration13 and PerformanceConfiguration14, or PerformanceConfiguration15 and PerformanceConfiguration16 + Mode2 = 2 // Use PerformanceConfiguration15 and PerformanceConfiguration16. + } +} \ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Apm/PerformanceConfiguration.cs b/Ryujinx.HLE/HOS/Services/Apm/PerformanceConfiguration.cs index d091ef3b4..e42edebcc 100644 --- a/Ryujinx.HLE/HOS/Services/Apm/PerformanceConfiguration.cs +++ b/Ryujinx.HLE/HOS/Services/Apm/PerformanceConfiguration.cs @@ -1,18 +1,22 @@ namespace Ryujinx.HLE.HOS.Services.Apm { - enum PerformanceConfiguration : uint - { - PerformanceConfiguration1 = 0x00010000, - PerformanceConfiguration2 = 0x00010001, - PerformanceConfiguration3 = 0x00010002, - PerformanceConfiguration4 = 0x00020000, - PerformanceConfiguration5 = 0x00020001, - PerformanceConfiguration6 = 0x00020002, - PerformanceConfiguration7 = 0x00020003, - PerformanceConfiguration8 = 0x00020004, - PerformanceConfiguration9 = 0x00020005, - PerformanceConfiguration10 = 0x00020006, - PerformanceConfiguration11 = 0x92220007, - PerformanceConfiguration12 = 0x92220008 + enum PerformanceConfiguration : uint // Clocks are all in MHz. + { // CPU | GPU | RAM | NOTE + PerformanceConfiguration1 = 0x00010000, // 1020 | 384 | 1600 | Only available while docked. + PerformanceConfiguration2 = 0x00010001, // 1020 | 768 | 1600 | Only available while docked. + PerformanceConfiguration3 = 0x00010002, // 1224 | 691.2 | 1600 | Only available for SDEV units. + PerformanceConfiguration4 = 0x00020000, // 1020 | 230.4 | 1600 | Only available for SDEV units. + PerformanceConfiguration5 = 0x00020001, // 1020 | 307.2 | 1600 | + PerformanceConfiguration6 = 0x00020002, // 1224 | 230.4 | 1600 | + PerformanceConfiguration7 = 0x00020003, // 1020 | 307 | 1331.2 | + PerformanceConfiguration8 = 0x00020004, // 1020 | 384 | 1331.2 | + PerformanceConfiguration9 = 0x00020005, // 1020 | 307.2 | 1065.6 | + PerformanceConfiguration10 = 0x00020006, // 1020 | 384 | 1065.6 | + PerformanceConfiguration11 = 0x92220007, // 1020 | 460.8 | 1600 | + PerformanceConfiguration12 = 0x92220008, // 1020 | 460.8 | 1331.2 | + PerformanceConfiguration13 = 0x92220009, // 1785 | 768 | 1600 | 7.0.0+ + PerformanceConfiguration14 = 0x9222000A, // 1785 | 768 | 1331.2 | 7.0.0+ + PerformanceConfiguration15 = 0x9222000B, // 1020 | 768 | 1600 | 7.0.0+ + PerformanceConfiguration16 = 0x9222000C // 1020 | 768 | 1331.2 | 7.0.0+ } } \ No newline at end of file