Skip to content

Commit

Permalink
fixed SetPowerProfile()
Browse files Browse the repository at this point in the history
  • Loading branch information
Lesueur Benjamin committed Feb 8, 2021
1 parent 8ad7246 commit 58f90f9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions DockerForm/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@ private static void CheckPowerProfiles()

private static void SetPowerProfile(PowerProfile profile, DockerGame game = null)
{
string command = "/min /nologo /command=\"";
string command = "/nologo /command=\"";

if (profile.HasLongPowerMax())
command += "w16 0xFED159a0 0x8" + profile.GetLongPowerMax().Substring(0, 1) + profile.GetLongPowerMax().Substring(1) + ";";
if (profile.HasShortPowerMax())
if (profile.HasShortPowerMax() && profile.HasLongPowerMax())
{
command += "w16 0xFED159a4 0x8" + profile.GetShortPowerMax().Substring(0, 1) + profile.GetShortPowerMax().Substring(1) + ";";
command += "w16 0xFED159a0 0x8" + profile.GetLongPowerMax().Substring(0, 1) + profile.GetLongPowerMax().Substring(1) + ";";
command += "wrmsr 0x610 0x00438" + profile.GetShortPowerMax() + " 0x00dd8" + profile.GetLongPowerMax() + ";";
}

if (profile.HasCPUCore())
command += "wrmsr 0x150 0x80000011 0x" + profile.GetVoltageCPU() + "00000;";
Expand All @@ -127,9 +129,6 @@ private static void SetPowerProfile(PowerProfile profile, DockerGame game = null
if (profile.HasPowerBalanceGPU())
command += "wrmsr 0x63a 0x00000000 0x000000" + profile.GetPowerBalanceGPU() + ";";

if (profile.HasShortPowerMax() && profile.HasLongPowerMax())
command += "wrmsr 0x610 0x00438" + profile.GetShortPowerMax() + " 0x00dd8" + profile.GetLongPowerMax() + ";";

command += "rwexit\"";

ProcessStartInfo RWInfo = new ProcessStartInfo
Expand Down

0 comments on commit 58f90f9

Please sign in to comment.