diff --git a/app/AppConfig.cs b/app/AppConfig.cs
index a148bee3..53b03bd6 100644
--- a/app/AppConfig.cs
+++ b/app/AppConfig.cs
@@ -39,6 +39,7 @@ public static class AppConfig
}
catch
{
+ Logger.WriteLine("Broken config: " + text);
Init();
}
}
@@ -218,9 +219,9 @@ public static class AppConfig
return GetString(name + "_" + Modes.GetCurrent());
}
- public static int GetMode(string name)
+ public static int GetMode(string name, int empty = -1)
{
- return Get(name + "_" + Modes.GetCurrent());
+ return Get(name + "_" + Modes.GetCurrent(), empty);
}
public static bool IsMode(string name)
diff --git a/app/AsusACPI.cs b/app/AsusACPI.cs
index 4fa45596..cff2c73c 100644
--- a/app/AsusACPI.cs
+++ b/app/AsusACPI.cs
@@ -107,11 +107,11 @@ public class AsusACPI
public const int GPUModeUltimate = 2;
- public const int MaxTotal = 250;
+ public const int MaxTotal = 150;
public const int MinTotal = 5;
public const int DefaultTotal = 125;
- public const int MaxCPU = 130;
+ public const int MaxCPU = 100;
public const int MinCPU = 5;
public const int DefaultCPU = 80;
diff --git a/app/Fans.Designer.cs b/app/Fans.Designer.cs
index 3275f970..a027e1be 100644
--- a/app/Fans.Designer.cs
+++ b/app/Fans.Designer.cs
@@ -39,6 +39,7 @@ namespace GHelper
Title title3 = new Title();
ChartArea chartArea4 = new ChartArea();
Title title4 = new Title();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Fans));
panelFans = new Panel();
labelTip = new Label();
tableFanCharts = new TableLayoutPanel();
@@ -57,13 +58,27 @@ namespace GHelper
labelFansResult = new Label();
checkApplyFans = new RCheckBox();
buttonReset = new RButton();
- labelBoost = new Label();
comboBoost = new RComboBox();
panelSliders = new Panel();
+ panelAdvanced = new Panel();
+ panelAdvancedApply = new Panel();
+ checkApplyUV = new RCheckBox();
+ buttonApplyAdvanced = new RButton();
+ labelRisky = new Label();
+ panelUViGPU = new Panel();
+ labelUViGPU = new Label();
+ labelLeftUViGPU = new Label();
+ trackUViGPU = new TrackBar();
+ panelUV = new Panel();
+ labelUV = new Label();
+ labelLeftUV = new Label();
+ trackUV = new TrackBar();
+ panelTitleAdvanced = new Panel();
+ pictureAdvanced = new PictureBox();
+ labelAdvanced = new Label();
panelPower = new Panel();
panelApplyPower = new Panel();
checkApplyPower = new RCheckBox();
- labelInfo = new Label();
panelB0 = new Panel();
labelB0 = new Label();
labelLeftB0 = new Label();
@@ -76,10 +91,13 @@ namespace GHelper
labelA0 = new Label();
labelLeftA0 = new Label();
trackA0 = new TrackBar();
- panelBoost = new Panel();
panelTitleCPU = new Panel();
- pictureBox1 = new PictureBox();
+ pictureBoxCPU = new PictureBox();
labelPowerLimits = new Label();
+ panelBoost = new Panel();
+ panelBoostTitle = new Panel();
+ pictureBoost = new PictureBox();
+ labelBoost = new Label();
panelGPU = new Panel();
panelGPUTemp = new Panel();
labelGPUTemp = new Label();
@@ -100,6 +118,11 @@ namespace GHelper
panelTitleGPU = new Panel();
pictureGPU = new PictureBox();
labelGPU = new Label();
+ panelNav = new Panel();
+ tableNav = new TableLayoutPanel();
+ buttonAdvanced = new RButton();
+ buttonGPU = new RButton();
+ buttonCPU = new RButton();
panelFans.SuspendLayout();
tableFanCharts.SuspendLayout();
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
@@ -110,6 +133,14 @@ namespace GHelper
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
panelApplyFans.SuspendLayout();
panelSliders.SuspendLayout();
+ panelAdvanced.SuspendLayout();
+ panelAdvancedApply.SuspendLayout();
+ panelUViGPU.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)trackUViGPU).BeginInit();
+ panelUV.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)trackUV).BeginInit();
+ panelTitleAdvanced.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)pictureAdvanced).BeginInit();
panelPower.SuspendLayout();
panelApplyPower.SuspendLayout();
panelB0.SuspendLayout();
@@ -118,9 +149,11 @@ namespace GHelper
((System.ComponentModel.ISupportInitialize)trackC1).BeginInit();
panelA0.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackA0).BeginInit();
- panelBoost.SuspendLayout();
panelTitleCPU.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)pictureBoxCPU).BeginInit();
+ panelBoost.SuspendLayout();
+ panelBoostTitle.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)pictureBoost).BeginInit();
panelGPU.SuspendLayout();
panelGPUTemp.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUTemp).BeginInit();
@@ -132,6 +165,8 @@ namespace GHelper
((System.ComponentModel.ISupportInitialize)trackGPUCore).BeginInit();
panelTitleGPU.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureGPU).BeginInit();
+ panelNav.SuspendLayout();
+ tableNav.SuspendLayout();
SuspendLayout();
//
// panelFans
@@ -143,24 +178,24 @@ namespace GHelper
panelFans.Controls.Add(panelTitleFans);
panelFans.Controls.Add(panelApplyFans);
panelFans.Dock = DockStyle.Left;
- panelFans.Location = new Point(266, 0);
+ panelFans.Location = new Point(530, 0);
panelFans.Margin = new Padding(0);
- panelFans.MaximumSize = new Size(408, 0);
- panelFans.MinimumSize = new Size(408, 0);
+ panelFans.MaximumSize = new Size(816, 0);
+ panelFans.MinimumSize = new Size(816, 0);
panelFans.Name = "panelFans";
- panelFans.Padding = new Padding(0, 0, 5, 0);
- panelFans.Size = new Size(408, 655);
+ panelFans.Padding = new Padding(0, 0, 10, 0);
+ panelFans.Size = new Size(816, 2023);
panelFans.TabIndex = 12;
//
// labelTip
//
labelTip.AutoSize = true;
labelTip.BackColor = SystemColors.ControlLightLight;
- labelTip.Location = new Point(342, 46);
- labelTip.Margin = new Padding(2, 0, 2, 0);
+ labelTip.Location = new Point(684, 92);
+ labelTip.Margin = new Padding(4, 0, 4, 0);
labelTip.Name = "labelTip";
- labelTip.Padding = new Padding(2, 2, 2, 2);
- labelTip.Size = new Size(50, 19);
+ labelTip.Padding = new Padding(4);
+ labelTip.Size = new Size(105, 40);
labelTip.TabIndex = 40;
labelTip.Text = "500,300";
//
@@ -174,16 +209,16 @@ namespace GHelper
tableFanCharts.Controls.Add(chartXGM, 0, 2);
tableFanCharts.Controls.Add(chartMid, 0, 2);
tableFanCharts.Dock = DockStyle.Fill;
- tableFanCharts.Location = new Point(0, 33);
- tableFanCharts.Margin = new Padding(2, 2, 2, 2);
+ tableFanCharts.Location = new Point(0, 66);
+ tableFanCharts.Margin = new Padding(4);
tableFanCharts.Name = "tableFanCharts";
- tableFanCharts.Padding = new Padding(5, 0, 5, 5);
+ tableFanCharts.Padding = new Padding(10, 0, 10, 10);
tableFanCharts.RowCount = 2;
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
- tableFanCharts.Size = new Size(403, 564);
+ tableFanCharts.Size = new Size(806, 1841);
tableFanCharts.TabIndex = 36;
//
// chartGPU
@@ -191,10 +226,10 @@ namespace GHelper
chartArea1.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea1);
chartGPU.Dock = DockStyle.Fill;
- chartGPU.Location = new Point(6, 144);
- chartGPU.Margin = new Padding(1, 5, 1, 5);
+ chartGPU.Location = new Point(12, 467);
+ chartGPU.Margin = new Padding(2, 10, 2, 10);
chartGPU.Name = "chartGPU";
- chartGPU.Size = new Size(391, 129);
+ chartGPU.Size = new Size(782, 437);
chartGPU.TabIndex = 17;
chartGPU.Text = "chartGPU";
title1.Name = "Title1";
@@ -205,10 +240,10 @@ namespace GHelper
chartArea2.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea2);
chartCPU.Dock = DockStyle.Fill;
- chartCPU.Location = new Point(6, 5);
- chartCPU.Margin = new Padding(1, 5, 1, 5);
+ chartCPU.Location = new Point(12, 10);
+ chartCPU.Margin = new Padding(2, 10, 2, 10);
chartCPU.Name = "chartCPU";
- chartCPU.Size = new Size(391, 129);
+ chartCPU.Size = new Size(782, 437);
chartCPU.TabIndex = 14;
chartCPU.Text = "chartCPU";
title2.Name = "Title1";
@@ -219,10 +254,10 @@ namespace GHelper
chartArea3.Name = "ChartAreaXGM";
chartXGM.ChartAreas.Add(chartArea3);
chartXGM.Dock = DockStyle.Fill;
- chartXGM.Location = new Point(6, 422);
- chartXGM.Margin = new Padding(1, 5, 1, 5);
+ chartXGM.Location = new Point(12, 1381);
+ chartXGM.Margin = new Padding(2, 10, 2, 10);
chartXGM.Name = "chartXGM";
- chartXGM.Size = new Size(391, 132);
+ chartXGM.Size = new Size(782, 440);
chartXGM.TabIndex = 14;
chartXGM.Text = "chartXGM";
title3.Name = "Title4";
@@ -234,10 +269,10 @@ namespace GHelper
chartArea4.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea4);
chartMid.Dock = DockStyle.Fill;
- chartMid.Location = new Point(6, 283);
- chartMid.Margin = new Padding(1, 5, 1, 5);
+ chartMid.Location = new Point(12, 924);
+ chartMid.Margin = new Padding(2, 10, 2, 10);
chartMid.Name = "chartMid";
- chartMid.Size = new Size(391, 129);
+ chartMid.Size = new Size(782, 437);
chartMid.TabIndex = 14;
chartMid.Text = "chartMid";
title4.Name = "Title3";
@@ -254,9 +289,9 @@ namespace GHelper
panelTitleFans.Controls.Add(labelFans);
panelTitleFans.Dock = DockStyle.Top;
panelTitleFans.Location = new Point(0, 0);
- panelTitleFans.Margin = new Padding(2, 2, 2, 2);
+ panelTitleFans.Margin = new Padding(4);
panelTitleFans.Name = "panelTitleFans";
- panelTitleFans.Size = new Size(403, 33);
+ panelTitleFans.Size = new Size(806, 66);
panelTitleFans.TabIndex = 42;
//
// buttonRename
@@ -268,11 +303,11 @@ namespace GHelper
buttonRename.BorderRadius = 2;
buttonRename.FlatStyle = FlatStyle.Flat;
buttonRename.Image = Properties.Resources.icons8_edit_32;
- buttonRename.Location = new Point(188, 5);
- buttonRename.Margin = new Padding(2, 1, 2, 1);
+ buttonRename.Location = new Point(376, 10);
+ buttonRename.Margin = new Padding(4, 2, 4, 2);
buttonRename.Name = "buttonRename";
buttonRename.Secondary = true;
- buttonRename.Size = new Size(26, 23);
+ buttonRename.Size = new Size(52, 46);
buttonRename.TabIndex = 45;
buttonRename.UseVisualStyleBackColor = false;
//
@@ -285,11 +320,11 @@ namespace GHelper
buttonRemove.BorderRadius = 2;
buttonRemove.FlatStyle = FlatStyle.Flat;
buttonRemove.Image = Properties.Resources.icons8_remove_64;
- buttonRemove.Location = new Point(161, 5);
- buttonRemove.Margin = new Padding(2, 1, 2, 1);
+ buttonRemove.Location = new Point(322, 10);
+ buttonRemove.Margin = new Padding(4, 2, 4, 2);
buttonRemove.Name = "buttonRemove";
buttonRemove.Secondary = true;
- buttonRemove.Size = new Size(26, 23);
+ buttonRemove.Size = new Size(52, 46);
buttonRemove.TabIndex = 44;
buttonRemove.UseVisualStyleBackColor = false;
//
@@ -302,11 +337,11 @@ namespace GHelper
buttonAdd.BorderRadius = 2;
buttonAdd.FlatStyle = FlatStyle.Flat;
buttonAdd.Image = Properties.Resources.icons8_add_64;
- buttonAdd.Location = new Point(372, 5);
- buttonAdd.Margin = new Padding(2, 1, 2, 1);
+ buttonAdd.Location = new Point(744, 10);
+ buttonAdd.Margin = new Padding(4, 2, 4, 2);
buttonAdd.Name = "buttonAdd";
buttonAdd.Secondary = true;
- buttonAdd.Size = new Size(26, 23);
+ buttonAdd.Size = new Size(52, 46);
buttonAdd.TabIndex = 43;
buttonAdd.UseVisualStyleBackColor = false;
//
@@ -317,10 +352,10 @@ namespace GHelper
comboModes.ButtonColor = Color.FromArgb(255, 255, 255);
comboModes.FlatStyle = FlatStyle.Flat;
comboModes.FormattingEnabled = true;
- comboModes.Location = new Point(218, 7);
+ comboModes.Location = new Point(436, 14);
comboModes.Margin = new Padding(0);
comboModes.Name = "comboModes";
- comboModes.Size = new Size(153, 23);
+ comboModes.Size = new Size(302, 40);
comboModes.TabIndex = 42;
//
// picturePerf
@@ -328,10 +363,10 @@ namespace GHelper
picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96;
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
picturePerf.InitialImage = null;
- picturePerf.Location = new Point(9, 9);
- picturePerf.Margin = new Padding(2, 1, 2, 1);
+ picturePerf.Location = new Point(18, 18);
+ picturePerf.Margin = new Padding(4, 2, 4, 2);
picturePerf.Name = "picturePerf";
- picturePerf.Size = new Size(18, 19);
+ picturePerf.Size = new Size(36, 38);
picturePerf.TabIndex = 41;
picturePerf.TabStop = false;
//
@@ -339,10 +374,10 @@ namespace GHelper
//
labelFans.AutoSize = true;
labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelFans.Location = new Point(26, 10);
- labelFans.Margin = new Padding(2, 0, 2, 0);
+ labelFans.Location = new Point(52, 20);
+ labelFans.Margin = new Padding(4, 0, 4, 0);
labelFans.Name = "labelFans";
- labelFans.Size = new Size(44, 15);
+ labelFans.Size = new Size(90, 32);
labelFans.TabIndex = 40;
labelFans.Text = "Profile";
//
@@ -352,20 +387,20 @@ namespace GHelper
panelApplyFans.Controls.Add(checkApplyFans);
panelApplyFans.Controls.Add(buttonReset);
panelApplyFans.Dock = DockStyle.Bottom;
- panelApplyFans.Location = new Point(0, 597);
- panelApplyFans.Margin = new Padding(2, 2, 2, 2);
+ panelApplyFans.Location = new Point(0, 1907);
+ panelApplyFans.Margin = new Padding(4);
panelApplyFans.Name = "panelApplyFans";
- panelApplyFans.Size = new Size(403, 58);
+ panelApplyFans.Size = new Size(806, 116);
panelApplyFans.TabIndex = 43;
//
// labelFansResult
//
labelFansResult.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
labelFansResult.ForeColor = Color.Red;
- labelFansResult.Location = new Point(12, 2);
- labelFansResult.Margin = new Padding(2, 0, 2, 0);
+ labelFansResult.Location = new Point(24, 4);
+ labelFansResult.Margin = new Padding(4, 0, 4, 0);
labelFansResult.Name = "labelFansResult";
- labelFansResult.Size = new Size(381, 16);
+ labelFansResult.Size = new Size(762, 32);
labelFansResult.TabIndex = 42;
labelFansResult.TextAlign = ContentAlignment.TopRight;
labelFansResult.Visible = false;
@@ -375,11 +410,11 @@ namespace GHelper
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
checkApplyFans.AutoSize = true;
checkApplyFans.BackColor = SystemColors.ControlLight;
- checkApplyFans.Location = new Point(223, 23);
- checkApplyFans.Margin = new Padding(2, 1, 2, 1);
+ checkApplyFans.Location = new Point(450, 42);
+ checkApplyFans.Margin = new Padding(0);
checkApplyFans.Name = "checkApplyFans";
- checkApplyFans.Padding = new Padding(8, 2, 8, 2);
- checkApplyFans.Size = new Size(174, 23);
+ checkApplyFans.Padding = new Padding(16, 6, 16, 6);
+ checkApplyFans.Size = new Size(341, 48);
checkApplyFans.TabIndex = 19;
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
checkApplyFans.UseVisualStyleBackColor = false;
@@ -392,25 +427,15 @@ namespace GHelper
buttonReset.BorderColor = Color.Transparent;
buttonReset.BorderRadius = 2;
buttonReset.FlatStyle = FlatStyle.Flat;
- buttonReset.Location = new Point(6, 19);
- buttonReset.Margin = new Padding(2, 1, 2, 1);
+ buttonReset.Location = new Point(15, 40);
+ buttonReset.Margin = new Padding(4, 2, 4, 2);
buttonReset.Name = "buttonReset";
buttonReset.Secondary = true;
- buttonReset.Size = new Size(137, 27);
+ buttonReset.Size = new Size(274, 50);
buttonReset.TabIndex = 18;
buttonReset.Text = Properties.Strings.FactoryDefaults;
buttonReset.UseVisualStyleBackColor = false;
//
- // labelBoost
- //
- labelBoost.Location = new Point(5, 5);
- labelBoost.Margin = new Padding(2, 0, 2, 0);
- labelBoost.Name = "labelBoost";
- labelBoost.Size = new Size(100, 20);
- labelBoost.TabIndex = 43;
- labelBoost.Text = "CPU Boost";
- labelBoost.TextAlign = ContentAlignment.MiddleLeft;
- //
// comboBoost
//
comboBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
@@ -419,78 +444,262 @@ namespace GHelper
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoost.FormattingEnabled = true;
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive", "Aggressive at Guaranteed", "Efficient at Guaranteed" });
- comboBoost.Location = new Point(113, 5);
- comboBoost.Margin = new Padding(2, 2, 2, 2);
+ comboBoost.Location = new Point(13, 12);
+ comboBoost.Margin = new Padding(4);
comboBoost.Name = "comboBoost";
- comboBoost.Size = new Size(145, 23);
+ comboBoost.Size = new Size(329, 40);
comboBoost.TabIndex = 42;
//
// panelSliders
//
+ panelSliders.Controls.Add(panelAdvanced);
panelSliders.Controls.Add(panelPower);
panelSliders.Controls.Add(panelGPU);
+ panelSliders.Controls.Add(panelNav);
panelSliders.Dock = DockStyle.Left;
panelSliders.Location = new Point(0, 0);
panelSliders.Margin = new Padding(0);
+ panelSliders.MinimumSize = new Size(530, 0);
panelSliders.Name = "panelSliders";
- panelSliders.Padding = new Padding(5, 0, 0, 0);
- panelSliders.Size = new Size(266, 655);
+ panelSliders.Padding = new Padding(10, 0, 0, 0);
+ panelSliders.Size = new Size(530, 2023);
panelSliders.TabIndex = 13;
//
+ // panelAdvanced
+ //
+ panelAdvanced.AutoSize = true;
+ panelAdvanced.AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ panelAdvanced.Controls.Add(panelAdvancedApply);
+ panelAdvanced.Controls.Add(labelRisky);
+ panelAdvanced.Controls.Add(panelUViGPU);
+ panelAdvanced.Controls.Add(panelUV);
+ panelAdvanced.Controls.Add(panelTitleAdvanced);
+ panelAdvanced.Dock = DockStyle.Top;
+ panelAdvanced.Location = new Point(10, 1284);
+ panelAdvanced.Name = "panelAdvanced";
+ panelAdvanced.Size = new Size(520, 588);
+ panelAdvanced.TabIndex = 14;
+ panelAdvanced.Visible = false;
+ //
+ // panelAdvancedApply
+ //
+ panelAdvancedApply.Controls.Add(checkApplyUV);
+ panelAdvancedApply.Controls.Add(buttonApplyAdvanced);
+ panelAdvancedApply.Dock = DockStyle.Top;
+ panelAdvancedApply.Location = new Point(0, 512);
+ panelAdvancedApply.Name = "panelAdvancedApply";
+ panelAdvancedApply.Size = new Size(520, 76);
+ panelAdvancedApply.TabIndex = 47;
+ //
+ // checkApplyUV
+ //
+ checkApplyUV.BackColor = SystemColors.ControlLight;
+ checkApplyUV.Enabled = false;
+ checkApplyUV.Location = new Point(255, 16);
+ checkApplyUV.Margin = new Padding(0);
+ checkApplyUV.Name = "checkApplyUV";
+ checkApplyUV.Padding = new Padding(16, 6, 16, 6);
+ checkApplyUV.Size = new Size(246, 46);
+ checkApplyUV.TabIndex = 50;
+ checkApplyUV.Text = "Auto Apply";
+ checkApplyUV.TextAlign = ContentAlignment.MiddleCenter;
+ checkApplyUV.UseVisualStyleBackColor = false;
+ //
+ // buttonApplyAdvanced
+ //
+ buttonApplyAdvanced.Activated = false;
+ buttonApplyAdvanced.BackColor = SystemColors.ControlLight;
+ buttonApplyAdvanced.BorderColor = Color.Transparent;
+ buttonApplyAdvanced.BorderRadius = 2;
+ buttonApplyAdvanced.FlatStyle = FlatStyle.Flat;
+ buttonApplyAdvanced.Location = new Point(10, 13);
+ buttonApplyAdvanced.Margin = new Padding(4, 2, 4, 2);
+ buttonApplyAdvanced.Name = "buttonApplyAdvanced";
+ buttonApplyAdvanced.Secondary = true;
+ buttonApplyAdvanced.Size = new Size(224, 50);
+ buttonApplyAdvanced.TabIndex = 49;
+ buttonApplyAdvanced.Text = "Apply";
+ buttonApplyAdvanced.TextImageRelation = TextImageRelation.ImageBeforeText;
+ buttonApplyAdvanced.UseVisualStyleBackColor = false;
+ //
+ // labelRisky
+ //
+ labelRisky.Dock = DockStyle.Top;
+ labelRisky.Location = new Point(0, 314);
+ labelRisky.Name = "labelRisky";
+ labelRisky.Padding = new Padding(10, 10, 10, 5);
+ labelRisky.Size = new Size(520, 198);
+ labelRisky.TabIndex = 46;
+ labelRisky.Text = resources.GetString("labelRisky.Text");
+ //
+ // panelUViGPU
+ //
+ panelUViGPU.AutoSize = true;
+ panelUViGPU.AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ panelUViGPU.Controls.Add(labelUViGPU);
+ panelUViGPU.Controls.Add(labelLeftUViGPU);
+ panelUViGPU.Controls.Add(trackUViGPU);
+ panelUViGPU.Dock = DockStyle.Top;
+ panelUViGPU.Location = new Point(0, 190);
+ panelUViGPU.Margin = new Padding(4);
+ panelUViGPU.MaximumSize = new Size(0, 124);
+ panelUViGPU.Name = "panelUViGPU";
+ panelUViGPU.Size = new Size(520, 124);
+ panelUViGPU.TabIndex = 49;
+ //
+ // labelUViGPU
+ //
+ labelUViGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
+ labelUViGPU.Location = new Point(347, 9);
+ labelUViGPU.Margin = new Padding(4, 0, 4, 0);
+ labelUViGPU.Name = "labelUViGPU";
+ labelUViGPU.Size = new Size(148, 32);
+ labelUViGPU.TabIndex = 13;
+ labelUViGPU.Text = "UV";
+ labelUViGPU.TextAlign = ContentAlignment.TopRight;
+ //
+ // labelLeftUViGPU
+ //
+ labelLeftUViGPU.AutoSize = true;
+ labelLeftUViGPU.Location = new Point(10, 10);
+ labelLeftUViGPU.Margin = new Padding(4, 0, 4, 0);
+ labelLeftUViGPU.Name = "labelLeftUViGPU";
+ labelLeftUViGPU.Size = new Size(65, 32);
+ labelLeftUViGPU.TabIndex = 12;
+ labelLeftUViGPU.Text = "iGPU";
+ //
+ // trackUViGPU
+ //
+ trackUViGPU.Location = new Point(6, 48);
+ trackUViGPU.Margin = new Padding(4, 2, 4, 2);
+ trackUViGPU.Maximum = 0;
+ trackUViGPU.Minimum = -40;
+ trackUViGPU.Name = "trackUViGPU";
+ trackUViGPU.Size = new Size(508, 90);
+ trackUViGPU.TabIndex = 11;
+ trackUViGPU.TickFrequency = 5;
+ trackUViGPU.TickStyle = TickStyle.TopLeft;
+ //
+ // panelUV
+ //
+ panelUV.AutoSize = true;
+ panelUV.AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ panelUV.Controls.Add(labelUV);
+ panelUV.Controls.Add(labelLeftUV);
+ panelUV.Controls.Add(trackUV);
+ panelUV.Dock = DockStyle.Top;
+ panelUV.Location = new Point(0, 66);
+ panelUV.Margin = new Padding(4);
+ panelUV.MaximumSize = new Size(0, 124);
+ panelUV.Name = "panelUV";
+ panelUV.Size = new Size(520, 124);
+ panelUV.TabIndex = 46;
+ //
+ // labelUV
+ //
+ labelUV.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
+ labelUV.Location = new Point(347, 13);
+ labelUV.Margin = new Padding(4, 0, 4, 0);
+ labelUV.Name = "labelUV";
+ labelUV.Size = new Size(148, 32);
+ labelUV.TabIndex = 13;
+ labelUV.Text = "UV";
+ labelUV.TextAlign = ContentAlignment.TopRight;
+ //
+ // labelLeftUV
+ //
+ labelLeftUV.AutoSize = true;
+ labelLeftUV.Location = new Point(10, 10);
+ labelLeftUV.Margin = new Padding(4, 0, 4, 0);
+ labelLeftUV.Name = "labelLeftUV";
+ labelLeftUV.Size = new Size(58, 32);
+ labelLeftUV.TabIndex = 12;
+ labelLeftUV.Text = "CPU";
+ //
+ // trackUV
+ //
+ trackUV.Location = new Point(6, 48);
+ trackUV.Margin = new Padding(4, 2, 4, 2);
+ trackUV.Maximum = 0;
+ trackUV.Minimum = -40;
+ trackUV.Name = "trackUV";
+ trackUV.Size = new Size(508, 90);
+ trackUV.TabIndex = 11;
+ trackUV.TickFrequency = 5;
+ trackUV.TickStyle = TickStyle.TopLeft;
+ //
+ // panelTitleAdvanced
+ //
+ panelTitleAdvanced.Controls.Add(pictureAdvanced);
+ panelTitleAdvanced.Controls.Add(labelAdvanced);
+ panelTitleAdvanced.Dock = DockStyle.Top;
+ panelTitleAdvanced.Location = new Point(0, 0);
+ panelTitleAdvanced.Name = "panelTitleAdvanced";
+ panelTitleAdvanced.Size = new Size(520, 66);
+ panelTitleAdvanced.TabIndex = 48;
+ //
+ // pictureAdvanced
+ //
+ pictureAdvanced.BackgroundImage = Properties.Resources.icons8_voltage_60;
+ pictureAdvanced.BackgroundImageLayout = ImageLayout.Zoom;
+ pictureAdvanced.InitialImage = null;
+ pictureAdvanced.Location = new Point(10, 18);
+ pictureAdvanced.Margin = new Padding(4, 2, 4, 10);
+ pictureAdvanced.Name = "pictureAdvanced";
+ pictureAdvanced.Size = new Size(36, 38);
+ pictureAdvanced.TabIndex = 48;
+ pictureAdvanced.TabStop = false;
+ //
+ // labelAdvanced
+ //
+ labelAdvanced.AutoSize = true;
+ labelAdvanced.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
+ labelAdvanced.Location = new Point(51, 20);
+ labelAdvanced.Margin = new Padding(4, 0, 4, 0);
+ labelAdvanced.Name = "labelAdvanced";
+ labelAdvanced.Size = new Size(166, 32);
+ labelAdvanced.TabIndex = 47;
+ labelAdvanced.Text = "Undervolting";
+ //
// panelPower
//
panelPower.AutoSize = true;
panelPower.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelPower.Controls.Add(panelApplyPower);
- panelPower.Controls.Add(labelInfo);
panelPower.Controls.Add(panelB0);
panelPower.Controls.Add(panelC1);
panelPower.Controls.Add(panelA0);
- panelPower.Controls.Add(panelBoost);
panelPower.Controls.Add(panelTitleCPU);
- panelPower.Dock = DockStyle.Fill;
- panelPower.Location = new Point(5, 290);
- panelPower.Margin = new Padding(2, 2, 2, 2);
+ panelPower.Controls.Add(panelBoost);
+ panelPower.Controls.Add(panelBoostTitle);
+ panelPower.Dock = DockStyle.Top;
+ panelPower.Location = new Point(10, 646);
+ panelPower.Margin = new Padding(4);
panelPower.Name = "panelPower";
- panelPower.Size = new Size(261, 365);
+ panelPower.Size = new Size(520, 638);
panelPower.TabIndex = 43;
//
// panelApplyPower
//
panelApplyPower.Controls.Add(checkApplyPower);
- panelApplyPower.Dock = DockStyle.Bottom;
- panelApplyPower.Location = new Point(0, 320);
- panelApplyPower.Margin = new Padding(2, 2, 2, 2);
+ panelApplyPower.Dock = DockStyle.Top;
+ panelApplyPower.Location = new Point(0, 568);
panelApplyPower.Name = "panelApplyPower";
- panelApplyPower.Padding = new Padding(5, 5, 5, 5);
- panelApplyPower.Size = new Size(261, 45);
- panelApplyPower.TabIndex = 44;
+ panelApplyPower.Size = new Size(520, 70);
+ panelApplyPower.TabIndex = 47;
//
// checkApplyPower
//
- checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
- checkApplyPower.AutoSize = true;
checkApplyPower.BackColor = SystemColors.ControlLight;
- checkApplyPower.Location = new Point(9, 9);
- checkApplyPower.Margin = new Padding(5, 5, 5, 5);
+ checkApplyPower.Location = new Point(13, 13);
+ checkApplyPower.Margin = new Padding(0);
checkApplyPower.Name = "checkApplyPower";
- checkApplyPower.Padding = new Padding(8, 2, 8, 2);
- checkApplyPower.Size = new Size(144, 23);
+ checkApplyPower.Padding = new Padding(16, 6, 16, 6);
+ checkApplyPower.Size = new Size(329, 46);
checkApplyPower.TabIndex = 45;
- checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
+ checkApplyPower.Text = "Apply Power Limits";
checkApplyPower.UseVisualStyleBackColor = false;
//
- // labelInfo
- //
- labelInfo.Dock = DockStyle.Top;
- labelInfo.Location = new Point(0, 251);
- labelInfo.Margin = new Padding(2, 0, 2, 0);
- labelInfo.Name = "labelInfo";
- labelInfo.Padding = new Padding(2, 2, 2, 2);
- labelInfo.Size = new Size(261, 50);
- labelInfo.TabIndex = 43;
- labelInfo.Text = "Experimental Feature";
- //
// panelB0
//
panelB0.AutoSize = true;
@@ -499,20 +708,20 @@ namespace GHelper
panelB0.Controls.Add(labelLeftB0);
panelB0.Controls.Add(trackB0);
panelB0.Dock = DockStyle.Top;
- panelB0.Location = new Point(0, 189);
- panelB0.Margin = new Padding(2, 2, 2, 2);
- panelB0.MaximumSize = new Size(0, 62);
+ panelB0.Location = new Point(0, 444);
+ panelB0.Margin = new Padding(4);
+ panelB0.MaximumSize = new Size(0, 124);
panelB0.Name = "panelB0";
- panelB0.Size = new Size(261, 62);
+ panelB0.Size = new Size(520, 124);
panelB0.TabIndex = 41;
//
// labelB0
//
labelB0.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelB0.Location = new Point(199, 4);
- labelB0.Margin = new Padding(2, 0, 2, 0);
+ labelB0.Location = new Point(398, 8);
+ labelB0.Margin = new Padding(4, 0, 4, 0);
labelB0.Name = "labelB0";
- labelB0.Size = new Size(58, 16);
+ labelB0.Size = new Size(116, 32);
labelB0.TabIndex = 13;
labelB0.Text = "CPU";
labelB0.TextAlign = ContentAlignment.TopRight;
@@ -520,21 +729,21 @@ namespace GHelper
// labelLeftB0
//
labelLeftB0.AutoSize = true;
- labelLeftB0.Location = new Point(5, 4);
- labelLeftB0.Margin = new Padding(2, 0, 2, 0);
+ labelLeftB0.Location = new Point(10, 8);
+ labelLeftB0.Margin = new Padding(4, 0, 4, 0);
labelLeftB0.Name = "labelLeftB0";
- labelLeftB0.Size = new Size(30, 15);
+ labelLeftB0.Size = new Size(58, 32);
labelLeftB0.TabIndex = 12;
labelLeftB0.Text = "CPU";
//
// trackB0
//
- trackB0.Location = new Point(3, 22);
- trackB0.Margin = new Padding(2, 1, 2, 1);
+ trackB0.Location = new Point(6, 44);
+ trackB0.Margin = new Padding(4, 2, 4, 2);
trackB0.Maximum = 85;
trackB0.Minimum = 5;
trackB0.Name = "trackB0";
- trackB0.Size = new Size(254, 45);
+ trackB0.Size = new Size(508, 90);
trackB0.TabIndex = 11;
trackB0.TickFrequency = 5;
trackB0.TickStyle = TickStyle.TopLeft;
@@ -548,42 +757,42 @@ namespace GHelper
panelC1.Controls.Add(labelLeftC1);
panelC1.Controls.Add(trackC1);
panelC1.Dock = DockStyle.Top;
- panelC1.Location = new Point(0, 127);
- panelC1.Margin = new Padding(2, 2, 2, 2);
- panelC1.MaximumSize = new Size(0, 62);
+ panelC1.Location = new Point(0, 320);
+ panelC1.Margin = new Padding(4);
+ panelC1.MaximumSize = new Size(0, 124);
panelC1.Name = "panelC1";
- panelC1.Size = new Size(261, 62);
+ panelC1.Size = new Size(520, 124);
panelC1.TabIndex = 45;
//
// labelC1
//
labelC1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelC1.Location = new Point(198, 4);
- labelC1.Margin = new Padding(2, 0, 2, 0);
+ labelC1.Location = new Point(396, 8);
+ labelC1.Margin = new Padding(4, 0, 4, 0);
labelC1.Name = "labelC1";
- labelC1.Size = new Size(57, 16);
+ labelC1.Size = new Size(114, 32);
labelC1.TabIndex = 13;
- labelC1.Text = "C1";
+ labelC1.Text = "FPPT";
labelC1.TextAlign = ContentAlignment.TopRight;
//
// labelLeftC1
//
labelLeftC1.AutoSize = true;
- labelLeftC1.Location = new Point(5, 4);
- labelLeftC1.Margin = new Padding(2, 0, 2, 0);
+ labelLeftC1.Location = new Point(10, 8);
+ labelLeftC1.Margin = new Padding(4, 0, 4, 0);
labelLeftC1.Name = "labelLeftC1";
- labelLeftC1.Size = new Size(21, 15);
+ labelLeftC1.Size = new Size(65, 32);
labelLeftC1.TabIndex = 12;
- labelLeftC1.Text = "C1";
+ labelLeftC1.Text = "FPPT";
//
// trackC1
//
- trackC1.Location = new Point(3, 24);
- trackC1.Margin = new Padding(2, 1, 2, 1);
+ trackC1.Location = new Point(6, 48);
+ trackC1.Margin = new Padding(4, 2, 4, 2);
trackC1.Maximum = 85;
trackC1.Minimum = 5;
trackC1.Name = "trackC1";
- trackC1.Size = new Size(254, 45);
+ trackC1.Size = new Size(508, 90);
trackC1.TabIndex = 11;
trackC1.TickFrequency = 5;
trackC1.TickStyle = TickStyle.TopLeft;
@@ -597,94 +806,129 @@ namespace GHelper
panelA0.Controls.Add(labelLeftA0);
panelA0.Controls.Add(trackA0);
panelA0.Dock = DockStyle.Top;
- panelA0.Location = new Point(0, 65);
- panelA0.Margin = new Padding(2, 2, 2, 2);
- panelA0.MaximumSize = new Size(0, 62);
+ panelA0.Location = new Point(0, 196);
+ panelA0.Margin = new Padding(4);
+ panelA0.MaximumSize = new Size(0, 124);
panelA0.Name = "panelA0";
- panelA0.Size = new Size(261, 62);
+ panelA0.Size = new Size(520, 124);
panelA0.TabIndex = 40;
//
// labelA0
//
labelA0.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelA0.Location = new Point(198, 5);
- labelA0.Margin = new Padding(2, 0, 2, 0);
+ labelA0.Location = new Point(396, 10);
+ labelA0.Margin = new Padding(4, 0, 4, 0);
labelA0.Name = "labelA0";
- labelA0.Size = new Size(58, 16);
+ labelA0.Size = new Size(116, 32);
labelA0.TabIndex = 12;
- labelA0.Text = "Platform";
+ labelA0.Text = "SPPT";
labelA0.TextAlign = ContentAlignment.TopRight;
//
// labelLeftA0
//
labelLeftA0.AutoSize = true;
- labelLeftA0.Location = new Point(5, 5);
- labelLeftA0.Margin = new Padding(2, 0, 2, 0);
+ labelLeftA0.Location = new Point(10, 10);
+ labelLeftA0.Margin = new Padding(4, 0, 4, 0);
labelLeftA0.Name = "labelLeftA0";
- labelLeftA0.Size = new Size(53, 15);
+ labelLeftA0.Size = new Size(66, 32);
labelLeftA0.TabIndex = 11;
- labelLeftA0.Text = "Platform";
+ labelLeftA0.Text = "SPPT";
//
// trackA0
//
- trackA0.Location = new Point(3, 24);
- trackA0.Margin = new Padding(2, 1, 2, 1);
+ trackA0.Location = new Point(6, 48);
+ trackA0.Margin = new Padding(4, 2, 4, 2);
trackA0.Maximum = 180;
trackA0.Minimum = 10;
trackA0.Name = "trackA0";
- trackA0.Size = new Size(254, 45);
+ trackA0.Size = new Size(508, 90);
trackA0.TabIndex = 10;
trackA0.TickFrequency = 5;
trackA0.TickStyle = TickStyle.TopLeft;
trackA0.Value = 125;
//
- // panelBoost
- //
- panelBoost.Controls.Add(comboBoost);
- panelBoost.Controls.Add(labelBoost);
- panelBoost.Dock = DockStyle.Top;
- panelBoost.Location = new Point(0, 33);
- panelBoost.Margin = new Padding(2, 2, 2, 2);
- panelBoost.Name = "panelBoost";
- panelBoost.Size = new Size(261, 32);
- panelBoost.TabIndex = 13;
- //
// panelTitleCPU
//
panelTitleCPU.AutoSize = true;
panelTitleCPU.AutoSizeMode = AutoSizeMode.GrowAndShrink;
- panelTitleCPU.Controls.Add(pictureBox1);
+ panelTitleCPU.Controls.Add(pictureBoxCPU);
panelTitleCPU.Controls.Add(labelPowerLimits);
panelTitleCPU.Dock = DockStyle.Top;
- panelTitleCPU.Location = new Point(0, 0);
- panelTitleCPU.Margin = new Padding(2, 2, 2, 2);
+ panelTitleCPU.Location = new Point(0, 130);
+ panelTitleCPU.Margin = new Padding(4);
panelTitleCPU.Name = "panelTitleCPU";
- panelTitleCPU.Size = new Size(261, 33);
+ panelTitleCPU.Size = new Size(520, 66);
panelTitleCPU.TabIndex = 42;
//
- // pictureBox1
+ // pictureBoxCPU
//
- pictureBox1.BackgroundImage = Properties.Resources.icons8_processor_96;
- pictureBox1.BackgroundImageLayout = ImageLayout.Zoom;
- pictureBox1.InitialImage = null;
- pictureBox1.Location = new Point(5, 9);
- pictureBox1.Margin = new Padding(2, 1, 2, 5);
- pictureBox1.Name = "pictureBox1";
- pictureBox1.Size = new Size(18, 19);
- pictureBox1.TabIndex = 40;
- pictureBox1.TabStop = false;
+ pictureBoxCPU.BackgroundImage = Properties.Resources.icons8_processor_96;
+ pictureBoxCPU.BackgroundImageLayout = ImageLayout.Zoom;
+ pictureBoxCPU.InitialImage = null;
+ pictureBoxCPU.Location = new Point(10, 18);
+ pictureBoxCPU.Margin = new Padding(4, 2, 4, 10);
+ pictureBoxCPU.Name = "pictureBoxCPU";
+ pictureBoxCPU.Size = new Size(36, 38);
+ pictureBoxCPU.TabIndex = 40;
+ pictureBoxCPU.TabStop = false;
//
// labelPowerLimits
//
labelPowerLimits.AutoSize = true;
labelPowerLimits.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelPowerLimits.Location = new Point(24, 10);
- labelPowerLimits.Margin = new Padding(2, 0, 2, 0);
+ labelPowerLimits.Location = new Point(48, 20);
+ labelPowerLimits.Margin = new Padding(4, 0, 4, 0);
labelPowerLimits.Name = "labelPowerLimits";
- labelPowerLimits.Size = new Size(79, 15);
+ labelPowerLimits.Size = new Size(160, 32);
labelPowerLimits.TabIndex = 39;
labelPowerLimits.Text = "Power Limits";
//
+ // panelBoost
+ //
+ panelBoost.Controls.Add(comboBoost);
+ panelBoost.Dock = DockStyle.Top;
+ panelBoost.Location = new Point(0, 66);
+ panelBoost.Margin = new Padding(4);
+ panelBoost.Name = "panelBoost";
+ panelBoost.Size = new Size(520, 64);
+ panelBoost.TabIndex = 13;
+ //
+ // panelBoostTitle
+ //
+ panelBoostTitle.AutoSize = true;
+ panelBoostTitle.AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ panelBoostTitle.Controls.Add(pictureBoost);
+ panelBoostTitle.Controls.Add(labelBoost);
+ panelBoostTitle.Dock = DockStyle.Top;
+ panelBoostTitle.Location = new Point(0, 0);
+ panelBoostTitle.Margin = new Padding(4);
+ panelBoostTitle.Name = "panelBoostTitle";
+ panelBoostTitle.Size = new Size(520, 66);
+ panelBoostTitle.TabIndex = 48;
+ //
+ // pictureBoost
+ //
+ pictureBoost.BackgroundImage = Properties.Resources.icons8_boost_30;
+ pictureBoost.BackgroundImageLayout = ImageLayout.Zoom;
+ pictureBoost.InitialImage = null;
+ pictureBoost.Location = new Point(10, 18);
+ pictureBoost.Margin = new Padding(4, 2, 4, 10);
+ pictureBoost.Name = "pictureBoost";
+ pictureBoost.Size = new Size(36, 38);
+ pictureBoost.TabIndex = 40;
+ pictureBoost.TabStop = false;
+ //
+ // labelBoost
+ //
+ labelBoost.AutoSize = true;
+ labelBoost.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
+ labelBoost.Location = new Point(48, 20);
+ labelBoost.Margin = new Padding(4, 0, 4, 0);
+ labelBoost.Name = "labelBoost";
+ labelBoost.Size = new Size(133, 32);
+ labelBoost.TabIndex = 39;
+ labelBoost.Text = "CPU Boost";
+ //
// panelGPU
//
panelGPU.AutoSize = true;
@@ -694,12 +938,13 @@ namespace GHelper
panelGPU.Controls.Add(panelGPUCore);
panelGPU.Controls.Add(panelTitleGPU);
panelGPU.Dock = DockStyle.Top;
- panelGPU.Location = new Point(5, 0);
- panelGPU.Margin = new Padding(2, 2, 2, 2);
+ panelGPU.Location = new Point(10, 66);
+ panelGPU.Margin = new Padding(4);
panelGPU.Name = "panelGPU";
- panelGPU.Padding = new Padding(0, 0, 0, 9);
- panelGPU.Size = new Size(261, 290);
+ panelGPU.Padding = new Padding(0, 0, 0, 18);
+ panelGPU.Size = new Size(520, 580);
panelGPU.TabIndex = 44;
+ panelGPU.Visible = false;
//
// panelGPUTemp
//
@@ -709,20 +954,20 @@ namespace GHelper
panelGPUTemp.Controls.Add(labelGPUTempTitle);
panelGPUTemp.Controls.Add(trackGPUTemp);
panelGPUTemp.Dock = DockStyle.Top;
- panelGPUTemp.Location = new Point(0, 219);
- panelGPUTemp.Margin = new Padding(2, 2, 2, 2);
- panelGPUTemp.MaximumSize = new Size(0, 62);
+ panelGPUTemp.Location = new Point(0, 438);
+ panelGPUTemp.Margin = new Padding(4);
+ panelGPUTemp.MaximumSize = new Size(0, 124);
panelGPUTemp.Name = "panelGPUTemp";
- panelGPUTemp.Size = new Size(261, 62);
+ panelGPUTemp.Size = new Size(520, 124);
panelGPUTemp.TabIndex = 47;
//
// labelGPUTemp
//
labelGPUTemp.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelGPUTemp.Location = new Point(189, 7);
- labelGPUTemp.Margin = new Padding(2, 0, 2, 0);
+ labelGPUTemp.Location = new Point(378, 14);
+ labelGPUTemp.Margin = new Padding(4, 0, 4, 0);
labelGPUTemp.Name = "labelGPUTemp";
- labelGPUTemp.Size = new Size(62, 16);
+ labelGPUTemp.Size = new Size(124, 32);
labelGPUTemp.TabIndex = 44;
labelGPUTemp.Text = "87C";
labelGPUTemp.TextAlign = ContentAlignment.TopRight;
@@ -730,21 +975,21 @@ namespace GHelper
// labelGPUTempTitle
//
labelGPUTempTitle.AutoSize = true;
- labelGPUTempTitle.Location = new Point(5, 7);
- labelGPUTempTitle.Margin = new Padding(2, 0, 2, 0);
+ labelGPUTempTitle.Location = new Point(10, 14);
+ labelGPUTempTitle.Margin = new Padding(4, 0, 4, 0);
labelGPUTempTitle.Name = "labelGPUTempTitle";
- labelGPUTempTitle.Size = new Size(85, 15);
+ labelGPUTempTitle.Size = new Size(173, 32);
labelGPUTempTitle.TabIndex = 43;
labelGPUTempTitle.Text = "Thermal Target";
//
// trackGPUTemp
//
- trackGPUTemp.Location = new Point(3, 28);
- trackGPUTemp.Margin = new Padding(2, 1, 2, 1);
+ trackGPUTemp.Location = new Point(6, 56);
+ trackGPUTemp.Margin = new Padding(4, 2, 4, 2);
trackGPUTemp.Maximum = 87;
trackGPUTemp.Minimum = 75;
trackGPUTemp.Name = "trackGPUTemp";
- trackGPUTemp.Size = new Size(248, 45);
+ trackGPUTemp.Size = new Size(496, 90);
trackGPUTemp.TabIndex = 42;
trackGPUTemp.TickFrequency = 5;
trackGPUTemp.TickStyle = TickStyle.TopLeft;
@@ -758,20 +1003,20 @@ namespace GHelper
panelGPUBoost.Controls.Add(labelGPUBoostTitle);
panelGPUBoost.Controls.Add(trackGPUBoost);
panelGPUBoost.Dock = DockStyle.Top;
- panelGPUBoost.Location = new Point(0, 157);
- panelGPUBoost.Margin = new Padding(2, 2, 2, 2);
- panelGPUBoost.MaximumSize = new Size(0, 62);
+ panelGPUBoost.Location = new Point(0, 314);
+ panelGPUBoost.Margin = new Padding(4);
+ panelGPUBoost.MaximumSize = new Size(0, 124);
panelGPUBoost.Name = "panelGPUBoost";
- panelGPUBoost.Size = new Size(261, 62);
+ panelGPUBoost.Size = new Size(520, 124);
panelGPUBoost.TabIndex = 46;
//
// labelGPUBoost
//
labelGPUBoost.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelGPUBoost.Location = new Point(187, 7);
- labelGPUBoost.Margin = new Padding(2, 0, 2, 0);
+ labelGPUBoost.Location = new Point(374, 14);
+ labelGPUBoost.Margin = new Padding(4, 0, 4, 0);
labelGPUBoost.Name = "labelGPUBoost";
- labelGPUBoost.Size = new Size(62, 16);
+ labelGPUBoost.Size = new Size(124, 32);
labelGPUBoost.TabIndex = 44;
labelGPUBoost.Text = "25W";
labelGPUBoost.TextAlign = ContentAlignment.TopRight;
@@ -779,21 +1024,21 @@ namespace GHelper
// labelGPUBoostTitle
//
labelGPUBoostTitle.AutoSize = true;
- labelGPUBoostTitle.Location = new Point(5, 7);
- labelGPUBoostTitle.Margin = new Padding(2, 0, 2, 0);
+ labelGPUBoostTitle.Location = new Point(10, 14);
+ labelGPUBoostTitle.Margin = new Padding(4, 0, 4, 0);
labelGPUBoostTitle.Name = "labelGPUBoostTitle";
- labelGPUBoostTitle.Size = new Size(87, 15);
+ labelGPUBoostTitle.Size = new Size(174, 32);
labelGPUBoostTitle.TabIndex = 43;
labelGPUBoostTitle.Text = "Dynamic Boost";
//
// trackGPUBoost
//
- trackGPUBoost.Location = new Point(3, 24);
- trackGPUBoost.Margin = new Padding(2, 1, 2, 1);
+ trackGPUBoost.Location = new Point(6, 48);
+ trackGPUBoost.Margin = new Padding(4, 2, 4, 2);
trackGPUBoost.Maximum = 25;
trackGPUBoost.Minimum = 5;
trackGPUBoost.Name = "trackGPUBoost";
- trackGPUBoost.Size = new Size(248, 45);
+ trackGPUBoost.Size = new Size(496, 90);
trackGPUBoost.TabIndex = 42;
trackGPUBoost.TickFrequency = 5;
trackGPUBoost.TickStyle = TickStyle.TopLeft;
@@ -807,20 +1052,20 @@ namespace GHelper
panelGPUMemory.Controls.Add(labelGPUMemoryTitle);
panelGPUMemory.Controls.Add(trackGPUMemory);
panelGPUMemory.Dock = DockStyle.Top;
- panelGPUMemory.Location = new Point(0, 95);
- panelGPUMemory.Margin = new Padding(2, 2, 2, 2);
- panelGPUMemory.MaximumSize = new Size(0, 62);
+ panelGPUMemory.Location = new Point(0, 190);
+ panelGPUMemory.Margin = new Padding(4);
+ panelGPUMemory.MaximumSize = new Size(0, 124);
panelGPUMemory.Name = "panelGPUMemory";
- panelGPUMemory.Size = new Size(261, 62);
+ panelGPUMemory.Size = new Size(520, 124);
panelGPUMemory.TabIndex = 45;
//
// labelGPUMemory
//
labelGPUMemory.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelGPUMemory.Location = new Point(172, 7);
- labelGPUMemory.Margin = new Padding(2, 0, 2, 0);
+ labelGPUMemory.Location = new Point(344, 14);
+ labelGPUMemory.Margin = new Padding(4, 0, 4, 0);
labelGPUMemory.Name = "labelGPUMemory";
- labelGPUMemory.Size = new Size(80, 16);
+ labelGPUMemory.Size = new Size(160, 32);
labelGPUMemory.TabIndex = 44;
labelGPUMemory.Text = "2000 MHz";
labelGPUMemory.TextAlign = ContentAlignment.TopRight;
@@ -828,21 +1073,21 @@ namespace GHelper
// labelGPUMemoryTitle
//
labelGPUMemoryTitle.AutoSize = true;
- labelGPUMemoryTitle.Location = new Point(5, 7);
- labelGPUMemoryTitle.Margin = new Padding(2, 0, 2, 0);
+ labelGPUMemoryTitle.Location = new Point(10, 14);
+ labelGPUMemoryTitle.Margin = new Padding(4, 0, 4, 0);
labelGPUMemoryTitle.Name = "labelGPUMemoryTitle";
- labelGPUMemoryTitle.Size = new Size(120, 15);
+ labelGPUMemoryTitle.Size = new Size(241, 32);
labelGPUMemoryTitle.TabIndex = 43;
labelGPUMemoryTitle.Text = "Memory Clock Offset";
//
// trackGPUMemory
//
trackGPUMemory.LargeChange = 100;
- trackGPUMemory.Location = new Point(3, 24);
- trackGPUMemory.Margin = new Padding(2, 1, 2, 1);
+ trackGPUMemory.Location = new Point(6, 48);
+ trackGPUMemory.Margin = new Padding(4, 2, 4, 2);
trackGPUMemory.Maximum = 300;
trackGPUMemory.Name = "trackGPUMemory";
- trackGPUMemory.Size = new Size(248, 45);
+ trackGPUMemory.Size = new Size(496, 90);
trackGPUMemory.SmallChange = 10;
trackGPUMemory.TabIndex = 42;
trackGPUMemory.TickFrequency = 50;
@@ -856,20 +1101,20 @@ namespace GHelper
panelGPUCore.Controls.Add(trackGPUCore);
panelGPUCore.Controls.Add(labelGPUCoreTitle);
panelGPUCore.Dock = DockStyle.Top;
- panelGPUCore.Location = new Point(0, 33);
- panelGPUCore.Margin = new Padding(2, 2, 2, 2);
- panelGPUCore.MaximumSize = new Size(0, 62);
+ panelGPUCore.Location = new Point(0, 66);
+ panelGPUCore.Margin = new Padding(4);
+ panelGPUCore.MaximumSize = new Size(0, 124);
panelGPUCore.Name = "panelGPUCore";
- panelGPUCore.Size = new Size(261, 62);
+ panelGPUCore.Size = new Size(520, 124);
panelGPUCore.TabIndex = 44;
//
// labelGPUCore
//
labelGPUCore.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelGPUCore.Location = new Point(163, 8);
- labelGPUCore.Margin = new Padding(2, 0, 2, 0);
+ labelGPUCore.Location = new Point(326, 16);
+ labelGPUCore.Margin = new Padding(4, 0, 4, 0);
labelGPUCore.Name = "labelGPUCore";
- labelGPUCore.Size = new Size(88, 16);
+ labelGPUCore.Size = new Size(176, 32);
labelGPUCore.TabIndex = 29;
labelGPUCore.Text = "1500 MHz";
labelGPUCore.TextAlign = ContentAlignment.TopRight;
@@ -877,12 +1122,12 @@ namespace GHelper
// trackGPUCore
//
trackGPUCore.LargeChange = 100;
- trackGPUCore.Location = new Point(3, 24);
- trackGPUCore.Margin = new Padding(2, 1, 2, 1);
+ trackGPUCore.Location = new Point(6, 48);
+ trackGPUCore.Margin = new Padding(4, 2, 4, 2);
trackGPUCore.Maximum = 300;
trackGPUCore.Name = "trackGPUCore";
trackGPUCore.RightToLeft = RightToLeft.No;
- trackGPUCore.Size = new Size(248, 45);
+ trackGPUCore.Size = new Size(496, 90);
trackGPUCore.SmallChange = 10;
trackGPUCore.TabIndex = 18;
trackGPUCore.TickFrequency = 50;
@@ -891,10 +1136,10 @@ namespace GHelper
// labelGPUCoreTitle
//
labelGPUCoreTitle.AutoSize = true;
- labelGPUCoreTitle.Location = new Point(5, 8);
- labelGPUCoreTitle.Margin = new Padding(2, 0, 2, 0);
+ labelGPUCoreTitle.Location = new Point(10, 16);
+ labelGPUCoreTitle.Margin = new Padding(4, 0, 4, 0);
labelGPUCoreTitle.Name = "labelGPUCoreTitle";
- labelGPUCoreTitle.Size = new Size(100, 15);
+ labelGPUCoreTitle.Size = new Size(201, 32);
labelGPUCoreTitle.TabIndex = 17;
labelGPUCoreTitle.Text = "Core Clock Offset";
//
@@ -906,9 +1151,9 @@ namespace GHelper
panelTitleGPU.Controls.Add(labelGPU);
panelTitleGPU.Dock = DockStyle.Top;
panelTitleGPU.Location = new Point(0, 0);
- panelTitleGPU.Margin = new Padding(2, 2, 2, 2);
+ panelTitleGPU.Margin = new Padding(4);
panelTitleGPU.Name = "panelTitleGPU";
- panelTitleGPU.Size = new Size(261, 33);
+ panelTitleGPU.Size = new Size(520, 66);
panelTitleGPU.TabIndex = 43;
//
// pictureGPU
@@ -917,10 +1162,10 @@ namespace GHelper
pictureGPU.BackgroundImageLayout = ImageLayout.Zoom;
pictureGPU.ErrorImage = null;
pictureGPU.InitialImage = null;
- pictureGPU.Location = new Point(5, 9);
- pictureGPU.Margin = new Padding(2, 1, 2, 5);
+ pictureGPU.Location = new Point(10, 18);
+ pictureGPU.Margin = new Padding(4, 2, 4, 10);
pictureGPU.Name = "pictureGPU";
- pictureGPU.Size = new Size(18, 19);
+ pictureGPU.Size = new Size(36, 38);
pictureGPU.TabIndex = 41;
pictureGPU.TabStop = false;
//
@@ -928,26 +1173,111 @@ namespace GHelper
//
labelGPU.AutoSize = true;
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
- labelGPU.Location = new Point(24, 10);
- labelGPU.Margin = new Padding(2, 0, 2, 0);
+ labelGPU.Location = new Point(48, 20);
+ labelGPU.Margin = new Padding(4, 0, 4, 0);
labelGPU.Name = "labelGPU";
- labelGPU.Size = new Size(81, 15);
+ labelGPU.Size = new Size(162, 32);
labelGPU.TabIndex = 40;
labelGPU.Text = "GPU Settings";
//
+ // panelNav
+ //
+ panelNav.AutoSize = true;
+ panelNav.AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ panelNav.Controls.Add(tableNav);
+ panelNav.Dock = DockStyle.Top;
+ panelNav.Location = new Point(10, 0);
+ panelNav.Margin = new Padding(4);
+ panelNav.Name = "panelNav";
+ panelNav.Size = new Size(520, 66);
+ panelNav.TabIndex = 45;
+ //
+ // tableNav
+ //
+ tableNav.ColumnCount = 3;
+ tableNav.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.3333321F));
+ tableNav.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.3333321F));
+ tableNav.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.3333321F));
+ tableNav.Controls.Add(buttonAdvanced, 0, 0);
+ tableNav.Controls.Add(buttonGPU, 0, 0);
+ tableNav.Controls.Add(buttonCPU, 0, 0);
+ tableNav.Dock = DockStyle.Top;
+ tableNav.Location = new Point(0, 0);
+ tableNav.MinimumSize = new Size(0, 62);
+ tableNav.Name = "tableNav";
+ tableNav.Padding = new Padding(0, 3, 0, 1);
+ tableNav.RowCount = 1;
+ tableNav.RowStyles.Add(new RowStyle());
+ tableNav.Size = new Size(520, 66);
+ tableNav.TabIndex = 42;
+ //
+ // buttonAdvanced
+ //
+ buttonAdvanced.Activated = false;
+ buttonAdvanced.BackColor = SystemColors.ControlLight;
+ buttonAdvanced.BorderColor = Color.Transparent;
+ buttonAdvanced.BorderRadius = 2;
+ buttonAdvanced.Dock = DockStyle.Fill;
+ buttonAdvanced.FlatStyle = FlatStyle.Flat;
+ buttonAdvanced.Location = new Point(350, 5);
+ buttonAdvanced.Margin = new Padding(4, 2, 4, 2);
+ buttonAdvanced.Name = "buttonAdvanced";
+ buttonAdvanced.Secondary = true;
+ buttonAdvanced.Size = new Size(166, 58);
+ buttonAdvanced.TabIndex = 51;
+ buttonAdvanced.Text = "Advanced";
+ buttonAdvanced.TextImageRelation = TextImageRelation.ImageBeforeText;
+ buttonAdvanced.UseVisualStyleBackColor = false;
+ //
+ // buttonGPU
+ //
+ buttonGPU.Activated = false;
+ buttonGPU.BackColor = SystemColors.ControlLight;
+ buttonGPU.BorderColor = Color.Transparent;
+ buttonGPU.BorderRadius = 2;
+ buttonGPU.Dock = DockStyle.Fill;
+ buttonGPU.FlatStyle = FlatStyle.Flat;
+ buttonGPU.Location = new Point(177, 5);
+ buttonGPU.Margin = new Padding(4, 2, 4, 2);
+ buttonGPU.Name = "buttonGPU";
+ buttonGPU.Secondary = true;
+ buttonGPU.Size = new Size(165, 58);
+ buttonGPU.TabIndex = 52;
+ buttonGPU.Text = "GPU";
+ buttonGPU.TextImageRelation = TextImageRelation.ImageBeforeText;
+ buttonGPU.UseVisualStyleBackColor = false;
+ //
+ // buttonCPU
+ //
+ buttonCPU.Activated = false;
+ buttonCPU.BackColor = SystemColors.ControlLight;
+ buttonCPU.BorderColor = Color.Transparent;
+ buttonCPU.BorderRadius = 2;
+ buttonCPU.Dock = DockStyle.Fill;
+ buttonCPU.FlatStyle = FlatStyle.Flat;
+ buttonCPU.Location = new Point(4, 5);
+ buttonCPU.Margin = new Padding(4, 2, 4, 2);
+ buttonCPU.Name = "buttonCPU";
+ buttonCPU.Secondary = true;
+ buttonCPU.Size = new Size(165, 58);
+ buttonCPU.TabIndex = 50;
+ buttonCPU.Text = "CPU";
+ buttonCPU.TextImageRelation = TextImageRelation.ImageBeforeText;
+ buttonCPU.UseVisualStyleBackColor = false;
+ //
// Fans
//
- AutoScaleDimensions = new SizeF(96F, 96F);
+ AutoScaleDimensions = new SizeF(192F, 192F);
AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
- ClientSize = new Size(670, 655);
+ ClientSize = new Size(1350, 2023);
Controls.Add(panelFans);
Controls.Add(panelSliders);
- Margin = new Padding(2, 1, 2, 1);
+ Margin = new Padding(4, 2, 4, 2);
MaximizeBox = false;
MinimizeBox = false;
- MinimumSize = new Size(22, 606);
+ MinimumSize = new Size(26, 1100);
Name = "Fans";
ShowIcon = false;
ShowInTaskbar = false;
@@ -967,10 +1297,21 @@ namespace GHelper
panelApplyFans.PerformLayout();
panelSliders.ResumeLayout(false);
panelSliders.PerformLayout();
+ panelAdvanced.ResumeLayout(false);
+ panelAdvanced.PerformLayout();
+ panelAdvancedApply.ResumeLayout(false);
+ panelUViGPU.ResumeLayout(false);
+ panelUViGPU.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)trackUViGPU).EndInit();
+ panelUV.ResumeLayout(false);
+ panelUV.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)trackUV).EndInit();
+ panelTitleAdvanced.ResumeLayout(false);
+ panelTitleAdvanced.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)pictureAdvanced).EndInit();
panelPower.ResumeLayout(false);
panelPower.PerformLayout();
panelApplyPower.ResumeLayout(false);
- panelApplyPower.PerformLayout();
panelB0.ResumeLayout(false);
panelB0.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackB0).EndInit();
@@ -980,10 +1321,13 @@ namespace GHelper
panelA0.ResumeLayout(false);
panelA0.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackA0).EndInit();
- panelBoost.ResumeLayout(false);
panelTitleCPU.ResumeLayout(false);
panelTitleCPU.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
+ ((System.ComponentModel.ISupportInitialize)pictureBoxCPU).EndInit();
+ panelBoost.ResumeLayout(false);
+ panelBoostTitle.ResumeLayout(false);
+ panelBoostTitle.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)pictureBoost).EndInit();
panelGPU.ResumeLayout(false);
panelGPU.PerformLayout();
panelGPUTemp.ResumeLayout(false);
@@ -1001,6 +1345,8 @@ namespace GHelper
panelTitleGPU.ResumeLayout(false);
panelTitleGPU.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureGPU).EndInit();
+ panelNav.ResumeLayout(false);
+ tableNav.ResumeLayout(false);
ResumeLayout(false);
PerformLayout();
}
@@ -1015,7 +1361,6 @@ namespace GHelper
private Chart chartXGM;
private Label labelTip;
private Panel panelPower;
- private Label labelInfo;
private Panel panelB0;
private Label labelB0;
private Label labelLeftB0;
@@ -1025,7 +1370,7 @@ namespace GHelper
private Label labelLeftA0;
private TrackBar trackA0;
private Panel panelTitleCPU;
- private PictureBox pictureBox1;
+ private PictureBox pictureBoxCPU;
private Label labelPowerLimits;
private Panel panelGPU;
private Panel panelGPUMemory;
@@ -1039,7 +1384,6 @@ namespace GHelper
private Panel panelTitleGPU;
private PictureBox pictureGPU;
private Label labelGPU;
- private Panel panelApplyPower;
private RCheckBox checkApplyPower;
private Panel panelGPUBoost;
private Label labelGPUBoost;
@@ -1055,6 +1399,7 @@ namespace GHelper
private RCheckBox checkApplyFans;
private RButton buttonReset;
private Label labelBoost;
+ private RCheckBox checkApplyUV;
private RComboBox comboBoost;
private PictureBox picturePerf;
private Label labelFans;
@@ -1067,5 +1412,29 @@ namespace GHelper
private RButton buttonAdd;
private RButton buttonRemove;
private RButton buttonRename;
+ private Panel panelUV;
+ private Label labelUV;
+ private Label labelLeftUV;
+ private TrackBar trackUV;
+ private PictureBox pictureAdvanced;
+ private Label labelAdvanced;
+ private RButton buttonApplyAdvanced;
+ private Panel panelApplyPower;
+ private Panel panelAdvanced;
+ private Panel panelAdvancedApply;
+ private Panel panelTitleAdvanced;
+ private Panel panelUViGPU;
+ private Label labelUViGPU;
+ private Label labelLeftUViGPU;
+ private TrackBar trackUViGPU;
+ private Panel panelNav;
+ private TableLayoutPanel tableNav;
+ private RButton buttonCPU;
+ private RButton buttonGPU;
+ private RButton buttonAdvanced;
+ private Panel panelBoostTitle;
+ private PictureBox pictureBoost;
+ private Label labelBoostTitle;
+ private Label labelRisky;
}
}
\ No newline at end of file
diff --git a/app/Fans.cs b/app/Fans.cs
index cf836994..005049a0 100644
--- a/app/Fans.cs
+++ b/app/Fans.cs
@@ -1,8 +1,10 @@
using CustomControls;
using GHelper.Gpu;
+using Ryzen;
using System;
using System.Diagnostics;
using System.Net.Sockets;
+using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
namespace GHelper
@@ -31,13 +33,12 @@ namespace GHelper
InitializeComponent();
- float dpi = ControlHelper.GetDpiScale(this).Value;
- comboModes.Size = new Size((int)dpi*150, (int)dpi * 18);
- comboModes.ClientSize = new Size((int)dpi * 150, (int)dpi * 18);
+ //float dpi = ControlHelper.GetDpiScale(this).Value;
+ //comboModes.Size = new Size(comboModes.Width, (int)dpi * 18);
+ comboModes.ClientSize = new Size(comboModes.Width, comboModes.Height - 4);
Text = Properties.Strings.FansAndPower;
labelPowerLimits.Text = Properties.Strings.PowerLimits;
- labelInfo.Text = Properties.Strings.PPTExperimental;
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
labelFans.Text = Properties.Strings.FanCurves;
@@ -129,16 +130,10 @@ namespace GHelper
trackGPUTemp.MouseUp += TrackGPU_MouseUp;
//labelInfo.MaximumSize = new Size(280, 0);
- labelInfo.Text = Properties.Strings.PPTExperimental;
labelFansResult.Visible = false;
FillModes();
-
- InitMode();
- InitFans();
- InitPower();
- InitBoost();
- InitGPU(true);
+ InitAll();
comboBoost.SelectedValueChanged += ComboBoost_Changed;
@@ -152,6 +147,132 @@ namespace GHelper
buttonRemove.Click += ButtonRemove_Click;
buttonRename.Click += ButtonRename_Click;
+ trackUV.Minimum = -30;
+ trackUV.Maximum = 0;
+
+ trackUViGPU.Minimum = -20;
+ trackUViGPU.Maximum = 0;
+
+ trackUV.Scroll += TrackUV_Scroll;
+ trackUViGPU.Scroll += TrackUV_Scroll;
+
+ buttonApplyAdvanced.Click += ButtonApplyAdvanced_Click;
+
+ buttonCPU.BorderColor = colorStandard;
+ buttonGPU.BorderColor = colorTurbo;
+ buttonAdvanced.BorderColor = Color.Gray;
+
+ buttonCPU.Click += ButtonCPU_Click;
+ buttonGPU.Click += ButtonGPU_Click;
+ buttonAdvanced.Click += ButtonAdvanced_Click;
+
+ checkApplyUV.Click += CheckApplyUV_Click;
+
+ ToggleNavigation(0);
+
+ }
+
+ private void CheckApplyUV_Click(object? sender, EventArgs e)
+ {
+ AppConfig.SetMode("auto_uv", checkApplyUV.Checked ? 1 : 0);
+ }
+
+ public void InitAll()
+ {
+ InitMode();
+ InitFans();
+ InitPower();
+ InitBoost();
+ InitUV();
+ InitGPU();
+ }
+
+ public void ToggleNavigation(int index = 0)
+ {
+
+ SuspendLayout();
+
+ buttonCPU.Activated = false;
+ buttonGPU.Activated = false;
+ buttonAdvanced.Activated = false;
+
+ panelPower.Visible = false;
+ panelGPU.Visible = false;
+ panelAdvanced.Visible = false;
+
+ switch (index)
+ {
+ case 1:
+ buttonGPU.Activated = true;
+ panelGPU.Visible = true;
+ break;
+ case 2:
+ buttonAdvanced.Activated = true;
+ panelAdvanced.Visible = true;
+ break;
+ default:
+ buttonCPU.Activated = true;
+ panelPower.Visible = true;
+ break;
+ }
+
+ ResumeLayout(false);
+ PerformLayout();
+ }
+
+ private void ButtonAdvanced_Click(object? sender, EventArgs e)
+ {
+ ToggleNavigation(2);
+ }
+
+ private void ButtonGPU_Click(object? sender, EventArgs e)
+ {
+ ToggleNavigation(1);
+ }
+
+ private void ButtonCPU_Click(object? sender, EventArgs e)
+ {
+ ToggleNavigation(0);
+ }
+
+ private void ButtonApplyAdvanced_Click(object? sender, EventArgs e)
+ {
+ Program.settingsForm.SetUV(true);
+ checkApplyUV.Enabled = true;
+ }
+
+ public void InitUV()
+ {
+
+ //if (!ProcessHelper.IsUserAdministrator()) return;
+
+ int cpuUV = Math.Max(trackUV.Minimum, Math.Min(trackUV.Maximum, AppConfig.GetMode("cpu_uv", 0)));
+ int igpuUV = Math.Max(trackUViGPU.Minimum, Math.Min(trackUViGPU.Maximum, AppConfig.GetMode("igpu_uv", 0)));
+
+ checkApplyUV.Enabled = checkApplyUV.Checked = AppConfig.IsMode("auto_uv");
+
+ trackUV.Value = cpuUV;
+ labelUV.Text = trackUV.Value.ToString();
+
+ trackUViGPU.Value = igpuUV;
+ labelUViGPU.Text = trackUViGPU.Value.ToString();
+
+ buttonAdvanced.Visible = Undervolter.IsAMD();
+
+ }
+
+
+ private void TrackUV_Scroll(object? sender, EventArgs e)
+ {
+ AppConfig.SetMode("auto_uv", 0);
+ checkApplyUV.Enabled = checkApplyUV.Checked = false;
+
+ labelUV.Text = trackUV.Value.ToString();
+ labelUViGPU.Text = trackUViGPU.Value.ToString();
+
+ AppConfig.SetMode("cpu_uv", trackUV.Value);
+ AppConfig.SetMode("igpu_uv", trackUViGPU.Value);
+
}
private void ComboModes_KeyPress(object? sender, KeyPressEventArgs e)
@@ -235,12 +356,12 @@ namespace GHelper
Program.settingsForm.SetGPUClocks(true);
}
- public void InitGPU(bool readClocks = false)
+ public void InitGPU()
{
if (Program.acpi.DeviceGet(AsusACPI.GPUEco) == 1)
{
- gpuVisible = panelGPU.Visible = false;
+ gpuVisible = buttonGPU.Visible = false;
return;
}
@@ -252,13 +373,13 @@ namespace GHelper
}
else
{
- gpuVisible = panelGPU.Visible = false;
+ gpuVisible = buttonGPU.Visible = false;
return;
}
try
{
- gpuVisible = panelGPU.Visible = true;
+ gpuVisible = buttonGPU.Visible = true;
int gpu_boost = AppConfig.GetMode("gpu_boost");
int gpu_temp = AppConfig.GetMode("gpu_temp");
@@ -306,7 +427,7 @@ namespace GHelper
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
- gpuVisible = panelGPU.Visible = false;
+ gpuVisible = buttonGPU.Visible = false;
}
}
@@ -691,6 +812,11 @@ namespace GHelper
if (Program.acpi.IsXGConnected())
AsusUSB.ResetXGM();
+ trackUV.Value = 0;
+ trackUViGPU.Value = 0;
+ AppConfig.SetMode("cpu_uv", 0);
+ AppConfig.SetMode("igpu_uv", 0);
+
if (gpuVisible)
{
trackGPUCore.Value = 0;
diff --git a/app/Fans.resx b/app/Fans.resx
index a395bffc..2a7cab8d 100644
--- a/app/Fans.resx
+++ b/app/Fans.resx
@@ -117,4 +117,7 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Undervolting is experimental and risky feature. If applied values are too low for your hardware, it can become unstable or shut down. Try small negative values first, click Apply and test what works for you.
+
\ No newline at end of file
diff --git a/app/GHelper.csproj b/app/GHelper.csproj
index 1f12a432..04ecc84b 100644
--- a/app/GHelper.csproj
+++ b/app/GHelper.csproj
@@ -16,7 +16,7 @@
AnyCPU
False
True
- 0.86
+ 0.87
@@ -133,6 +133,12 @@
SettingsSingleFileGenerator
Settings.Designer.cs
+
+ Always
+
+
+ Always
+
\ No newline at end of file
diff --git a/app/InputDispatcher.cs b/app/InputDispatcher.cs
index 612f19a8..10ba6a1a 100644
--- a/app/InputDispatcher.cs
+++ b/app/InputDispatcher.cs
@@ -25,7 +25,7 @@ namespace GHelper
while (!cancellationTokenSource.Token.IsCancellationRequested)
{
var data = input.Read().Data;
- if (data.Length > 1 && data[0] == AsusUSB.INPUT_HID_ID && data[1] > 0)
+ if (data.Length > 1 && data[0] == AsusUSB.INPUT_HID_ID && data[1] > 0 && data[1] != 236)
{
Logger.WriteLine($"Key: {data[1]}");
KeyHandler(data[1]);
diff --git a/app/Program.cs b/app/Program.cs
index 5f23b2e1..6b5e96b7 100644
--- a/app/Program.cs
+++ b/app/Program.cs
@@ -1,4 +1,5 @@
using Microsoft.Win32;
+using Ryzen;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
@@ -73,6 +74,7 @@ namespace GHelper
Application.EnableVisualStyles();
HardwareControl.RecreateGpuControl();
+ Undervolter.Init();
var ds = settingsForm.Handle;
@@ -193,7 +195,7 @@ namespace GHelper
{
case "gpu":
Startup.ReScheduleAdmin();
- settingsForm.FansToggle();
+ settingsForm.FansToggle(1);
break;
case "gpurestart":
settingsForm.RestartGPU(false);
@@ -203,6 +205,11 @@ namespace GHelper
settingsForm.keyb.Show();
settingsForm.keyb.ServiesToggle();
break;
+ case "uv":
+ Startup.ReScheduleAdmin();
+ settingsForm.FansToggle(2);
+ settingsForm.SetUV();
+ break;
}
}
}
diff --git a/app/Properties/Resources.Designer.cs b/app/Properties/Resources.Designer.cs
index 83f34072..5784fa03 100644
--- a/app/Properties/Resources.Designer.cs
+++ b/app/Properties/Resources.Designer.cs
@@ -140,6 +140,16 @@ namespace GHelper.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap icons8_boost_30 {
+ get {
+ object obj = ResourceManager.GetObject("icons8-boost-30", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -400,6 +410,16 @@ namespace GHelper.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap icons8_save_32 {
+ get {
+ object obj = ResourceManager.GetObject("icons8-save-32", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
@@ -490,6 +510,16 @@ namespace GHelper.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap icons8_voltage_60 {
+ get {
+ object obj = ResourceManager.GetObject("icons8-voltage-60", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
diff --git a/app/Properties/Resources.resx b/app/Properties/Resources.resx
index aa3382de..cecdedaf 100644
--- a/app/Properties/Resources.resx
+++ b/app/Properties/Resources.resx
@@ -121,14 +121,17 @@
..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-software-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\icons8-leaf-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\icons8-launch-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-charging-battery-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\icons8-organic-food-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -139,8 +142,8 @@
..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -154,29 +157,50 @@
..\Resources\icons8-processor-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-fan-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\icons8-add-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\icons8-game-controller-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\icons8-spa-flower-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-edit-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\icons8-share-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\standard.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-charged-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\icons8-voltage-60.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\icons8-keyboard-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\brightness-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-save-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
..\Resources\icons8-fan-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-speed-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -184,11 +208,11 @@
..\Resources\icons8-laptop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-video-card-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-charging-battery-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -196,8 +220,8 @@
..\Resources\icons8-spa-flower-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-organic-food-961.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-speed-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\icons8-function-mac-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -205,14 +229,14 @@
..\Resources\icons8-balance-symbol-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-fan-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-organic-food-961.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\icons8-matrix-desktop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-remove-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\icons8-xbox-controller-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -220,8 +244,8 @@
..\Resources\icons8-project-management-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-video-card-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Resources\icons8-leaf-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -235,25 +259,10 @@
..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-software-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\icons8-charged-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\icons8-add-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\icons8-edit-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\icons8-remove-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- ..\Resources\icons8-share-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\icons8-boost-30.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
\ No newline at end of file
diff --git a/app/Properties/Strings.Designer.cs b/app/Properties/Strings.Designer.cs
index bfba75f1..3be60002 100644
--- a/app/Properties/Strings.Designer.cs
+++ b/app/Properties/Strings.Designer.cs
@@ -160,7 +160,7 @@ namespace GHelper.Properties {
}
///
- /// Looks up a localized string similar to Apply Power Limits.
+ /// Looks up a localized string similar to Apply.
///
internal static string ApplyPowerLimits {
get {
diff --git a/app/Resources/icons8-boost-30.png b/app/Resources/icons8-boost-30.png
new file mode 100644
index 00000000..11cd43f9
Binary files /dev/null and b/app/Resources/icons8-boost-30.png differ
diff --git a/app/Resources/icons8-save-32.png b/app/Resources/icons8-save-32.png
new file mode 100644
index 00000000..3782210e
Binary files /dev/null and b/app/Resources/icons8-save-32.png differ
diff --git a/app/Resources/icons8-voltage-60.png b/app/Resources/icons8-voltage-60.png
new file mode 100644
index 00000000..e3eb0307
Binary files /dev/null and b/app/Resources/icons8-voltage-60.png differ
diff --git a/app/Ryzen/OpenLibSys.cs b/app/Ryzen/OpenLibSys.cs
new file mode 100644
index 00000000..06da32cf
--- /dev/null
+++ b/app/Ryzen/OpenLibSys.cs
@@ -0,0 +1,446 @@
+//-----------------------------------------------------------------------------
+// Author : hiyohiyo
+// Mail : hiyohiyo@crystalmark.info
+// Web : http://openlibsys.org/
+// License : The modified BSD license
+//
+// Copyright 2007-2009 OpenLibSys.org. All rights reserved.
+//-----------------------------------------------------------------------------
+// This is support library for WinRing0 1.3.x.
+
+using System.Runtime.InteropServices;
+
+namespace Ryzen
+{
+ public class Ols : IDisposable
+ {
+ const string dllNameX64 = "WinRing0x64.dll";
+ const string dllName = "WinRing0.dll";
+
+ // for this support library
+ public enum Status
+ {
+ NO_ERROR = 0,
+ DLL_NOT_FOUND = 1,
+ DLL_INCORRECT_VERSION = 2,
+ DLL_INITIALIZE_ERROR = 3,
+ }
+
+ // for WinRing0
+ public enum OlsDllStatus
+ {
+ OLS_DLL_NO_ERROR = 0,
+ OLS_DLL_UNSUPPORTED_PLATFORM = 1,
+ OLS_DLL_DRIVER_NOT_LOADED = 2,
+ OLS_DLL_DRIVER_NOT_FOUND = 3,
+ OLS_DLL_DRIVER_UNLOADED = 4,
+ OLS_DLL_DRIVER_NOT_LOADED_ON_NETWORK = 5,
+ OLS_DLL_UNKNOWN_ERROR = 9
+ }
+
+ // for WinRing0
+ public enum OlsDriverType
+ {
+ OLS_DRIVER_TYPE_UNKNOWN = 0,
+ OLS_DRIVER_TYPE_WIN_9X = 1,
+ OLS_DRIVER_TYPE_WIN_NT = 2,
+ OLS_DRIVER_TYPE_WIN_NT4 = 3, // Obsolete
+ OLS_DRIVER_TYPE_WIN_NT_X64 = 4,
+ OLS_DRIVER_TYPE_WIN_NT_IA64 = 5
+ }
+
+ // for WinRing0
+ public enum OlsErrorPci : uint
+ {
+ OLS_ERROR_PCI_BUS_NOT_EXIST = 0xE0000001,
+ OLS_ERROR_PCI_NO_DEVICE = 0xE0000002,
+ OLS_ERROR_PCI_WRITE_CONFIG = 0xE0000003,
+ OLS_ERROR_PCI_READ_CONFIG = 0xE0000004
+ }
+
+ // Bus Number, Device Number and Function Number to PCI Device Address
+ public uint PciBusDevFunc(uint bus, uint dev, uint func)
+ {
+ return (bus & 0xFF) << 8 | (dev & 0x1F) << 3 | func & 7;
+ }
+
+ // PCI Device Address to Bus Number
+ public uint PciGetBus(uint address)
+ {
+ return address >> 8 & 0xFF;
+ }
+
+ // PCI Device Address to Device Number
+ public uint PciGetDev(uint address)
+ {
+ return address >> 3 & 0x1F;
+ }
+
+ // PCI Device Address to Function Number
+ public uint PciGetFunc(uint address)
+ {
+ return address & 7;
+ }
+
+ [DllImport("kernel32")]
+ public extern static nint LoadLibrary(string lpFileName);
+
+
+ [DllImport("kernel32", SetLastError = true)]
+ private static extern bool FreeLibrary(nint hModule);
+
+ [DllImport("kernel32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = false)]
+ private static extern nint GetProcAddress(nint hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName);
+
+ private nint module = nint.Zero;
+ private uint status = (uint)Status.NO_ERROR;
+
+ public Ols()
+ {
+ string fileName;
+
+ if (nint.Size == 8)
+ {
+ fileName = dllNameX64;
+ }
+ else
+ {
+ fileName = dllName;
+ }
+
+ module = LoadLibrary(fileName);
+ if (module == nint.Zero)
+ {
+ status = (uint)Status.DLL_NOT_FOUND;
+ }
+ else
+ {
+
+ GetDllStatus = (_GetDllStatus)GetDelegate("GetDllStatus", typeof(_GetDllStatus));
+ GetDllVersion = (_GetDllVersion)GetDelegate("GetDllVersion", typeof(_GetDllVersion));
+ GetDriverVersion = (_GetDriverVersion)GetDelegate("GetDriverVersion", typeof(_GetDriverVersion));
+ GetDriverType = (_GetDriverType)GetDelegate("GetDriverType", typeof(_GetDriverType));
+
+ InitializeOls = (_InitializeOls)GetDelegate("InitializeOls", typeof(_InitializeOls));
+ DeinitializeOls = (_DeinitializeOls)GetDelegate("DeinitializeOls", typeof(_DeinitializeOls));
+
+ IsCpuid = (_IsCpuid)GetDelegate("IsCpuid", typeof(_IsCpuid));
+ IsMsr = (_IsMsr)GetDelegate("IsMsr", typeof(_IsMsr));
+ IsTsc = (_IsTsc)GetDelegate("IsTsc", typeof(_IsTsc));
+ Hlt = (_Hlt)GetDelegate("Hlt", typeof(_Hlt));
+ HltTx = (_HltTx)GetDelegate("HltTx", typeof(_HltTx));
+ HltPx = (_HltPx)GetDelegate("HltPx", typeof(_HltPx));
+ Rdmsr = (_Rdmsr)GetDelegate("Rdmsr", typeof(_Rdmsr));
+ RdmsrTx = (_RdmsrTx)GetDelegate("RdmsrTx", typeof(_RdmsrTx));
+ RdmsrPx = (_RdmsrPx)GetDelegate("RdmsrPx", typeof(_RdmsrPx));
+ Wrmsr = (_Wrmsr)GetDelegate("Wrmsr", typeof(_Wrmsr));
+ WrmsrTx = (_WrmsrTx)GetDelegate("WrmsrTx", typeof(_WrmsrTx));
+ WrmsrPx = (_WrmsrPx)GetDelegate("WrmsrPx", typeof(_WrmsrPx));
+ Rdpmc = (_Rdpmc)GetDelegate("Rdpmc", typeof(_Rdpmc));
+ RdpmcTx = (_RdpmcTx)GetDelegate("RdpmcTx", typeof(_RdpmcTx));
+ RdpmcPx = (_RdpmcPx)GetDelegate("RdpmcPx", typeof(_RdpmcPx));
+ Cpuid = (_Cpuid)GetDelegate("Cpuid", typeof(_Cpuid));
+ CpuidTx = (_CpuidTx)GetDelegate("CpuidTx", typeof(_CpuidTx));
+ CpuidPx = (_CpuidPx)GetDelegate("CpuidPx", typeof(_CpuidPx));
+ Rdtsc = (_Rdtsc)GetDelegate("Rdtsc", typeof(_Rdtsc));
+ RdtscTx = (_RdtscTx)GetDelegate("RdtscTx", typeof(_RdtscTx));
+ RdtscPx = (_RdtscPx)GetDelegate("RdtscPx", typeof(_RdtscPx));
+
+ ReadIoPortByte = (_ReadIoPortByte)GetDelegate("ReadIoPortByte", typeof(_ReadIoPortByte));
+ ReadIoPortWord = (_ReadIoPortWord)GetDelegate("ReadIoPortWord", typeof(_ReadIoPortWord));
+ ReadIoPortDword = (_ReadIoPortDword)GetDelegate("ReadIoPortDword", typeof(_ReadIoPortDword));
+ ReadIoPortByteEx = (_ReadIoPortByteEx)GetDelegate("ReadIoPortByteEx", typeof(_ReadIoPortByteEx));
+ ReadIoPortWordEx = (_ReadIoPortWordEx)GetDelegate("ReadIoPortWordEx", typeof(_ReadIoPortWordEx));
+ ReadIoPortDwordEx = (_ReadIoPortDwordEx)GetDelegate("ReadIoPortDwordEx", typeof(_ReadIoPortDwordEx));
+
+ WriteIoPortByte = (_WriteIoPortByte)GetDelegate("WriteIoPortByte", typeof(_WriteIoPortByte));
+ WriteIoPortWord = (_WriteIoPortWord)GetDelegate("WriteIoPortWord", typeof(_WriteIoPortWord));
+ WriteIoPortDword = (_WriteIoPortDword)GetDelegate("WriteIoPortDword", typeof(_WriteIoPortDword));
+ WriteIoPortByteEx = (_WriteIoPortByteEx)GetDelegate("WriteIoPortByteEx", typeof(_WriteIoPortByteEx));
+ WriteIoPortWordEx = (_WriteIoPortWordEx)GetDelegate("WriteIoPortWordEx", typeof(_WriteIoPortWordEx));
+ WriteIoPortDwordEx = (_WriteIoPortDwordEx)GetDelegate("WriteIoPortDwordEx", typeof(_WriteIoPortDwordEx));
+
+ SetPciMaxBusIndex = (_SetPciMaxBusIndex)GetDelegate("SetPciMaxBusIndex", typeof(_SetPciMaxBusIndex));
+ ReadPciConfigByte = (_ReadPciConfigByte)GetDelegate("ReadPciConfigByte", typeof(_ReadPciConfigByte));
+ ReadPciConfigWord = (_ReadPciConfigWord)GetDelegate("ReadPciConfigWord", typeof(_ReadPciConfigWord));
+ ReadPciConfigDword = (_ReadPciConfigDword)GetDelegate("ReadPciConfigDword", typeof(_ReadPciConfigDword));
+ ReadPciConfigByteEx = (_ReadPciConfigByteEx)GetDelegate("ReadPciConfigByteEx", typeof(_ReadPciConfigByteEx));
+ ReadPciConfigWordEx = (_ReadPciConfigWordEx)GetDelegate("ReadPciConfigWordEx", typeof(_ReadPciConfigWordEx));
+ ReadPciConfigDwordEx = (_ReadPciConfigDwordEx)GetDelegate("ReadPciConfigDwordEx", typeof(_ReadPciConfigDwordEx));
+ ReadPciConfigDwordEx64 = (_ReadPciConfigDwordEx64)GetDelegate("ReadPciConfigDwordEx", typeof(_ReadPciConfigDwordEx64));
+ WritePciConfigByte = (_WritePciConfigByte)GetDelegate("WritePciConfigByte", typeof(_WritePciConfigByte));
+ WritePciConfigWord = (_WritePciConfigWord)GetDelegate("WritePciConfigWord", typeof(_WritePciConfigWord));
+ WritePciConfigDword = (_WritePciConfigDword)GetDelegate("WritePciConfigDword", typeof(_WritePciConfigDword));
+ WritePciConfigByteEx = (_WritePciConfigByteEx)GetDelegate("WritePciConfigByteEx", typeof(_WritePciConfigByteEx));
+ WritePciConfigWordEx = (_WritePciConfigWordEx)GetDelegate("WritePciConfigWordEx", typeof(_WritePciConfigWordEx));
+ WritePciConfigDwordEx = (_WritePciConfigDwordEx)GetDelegate("WritePciConfigDwordEx", typeof(_WritePciConfigDwordEx));
+ WritePciConfigDwordEx64 = (_WritePciConfigDwordEx64)GetDelegate("WritePciConfigDwordEx", typeof(_WritePciConfigDwordEx64));
+ FindPciDeviceById = (_FindPciDeviceById)GetDelegate("FindPciDeviceById", typeof(_FindPciDeviceById));
+ FindPciDeviceByClass = (_FindPciDeviceByClass)GetDelegate("FindPciDeviceByClass", typeof(_FindPciDeviceByClass));
+
+ /*
+ ReadDmiMemory = (_ReadDmiMemory)GetDelegate("ReadDmiMemory", typeof(_ReadDmiMemory));
+ ReadPhysicalMemory = (_ReadPhysicalMemory)GetDelegate("ReadPhysicalMemory", typeof(_ReadPhysicalMemory));
+ WritePhysicalMemory = (_WritePhysicalMemory)GetDelegate("WritePhysicalMemory", typeof(_WritePhysicalMemory));
+ */
+
+ if (!(
+ GetDllStatus != null
+ && GetDllVersion != null
+ && GetDriverVersion != null
+ && GetDriverType != null
+ && InitializeOls != null
+ && DeinitializeOls != null
+ && IsCpuid != null
+ && IsMsr != null
+ && IsTsc != null
+ && Hlt != null
+ && HltTx != null
+ && HltPx != null
+ && Rdmsr != null
+ && RdmsrTx != null
+ && RdmsrPx != null
+ && Wrmsr != null
+ && WrmsrTx != null
+ && WrmsrPx != null
+ && Rdpmc != null
+ && RdpmcTx != null
+ && RdpmcPx != null
+ && Cpuid != null
+ && CpuidTx != null
+ && CpuidPx != null
+ && Rdtsc != null
+ && RdtscTx != null
+ && RdtscPx != null
+ && ReadIoPortByte != null
+ && ReadIoPortWord != null
+ && ReadIoPortDword != null
+ && ReadIoPortByteEx != null
+ && ReadIoPortWordEx != null
+ && ReadIoPortDwordEx != null
+ && WriteIoPortByte != null
+ && WriteIoPortWord != null
+ && WriteIoPortDword != null
+ && WriteIoPortByteEx != null
+ && WriteIoPortWordEx != null
+ && WriteIoPortDwordEx != null
+ && SetPciMaxBusIndex != null
+ && ReadPciConfigByte != null
+ && ReadPciConfigWord != null
+ && ReadPciConfigDword != null
+ && ReadPciConfigByteEx != null
+ && ReadPciConfigWordEx != null
+ && ReadPciConfigDwordEx != null
+ && ReadPciConfigDwordEx64 != null
+ && WritePciConfigByte != null
+ && WritePciConfigWord != null
+ && WritePciConfigDword != null
+ && WritePciConfigByteEx != null
+ && WritePciConfigWordEx != null
+ && WritePciConfigDwordEx != null
+ && WritePciConfigDwordEx64 != null
+ && FindPciDeviceById != null
+ && FindPciDeviceByClass != null
+ /*&& ReadDmiMemory != null
+ && ReadPhysicalMemory != null
+ && WritePhysicalMemory != null
+ */
+ ))
+ {
+ status = (uint)Status.DLL_INCORRECT_VERSION;
+ }
+
+ if (InitializeOls() == 0)
+ {
+ status = (uint)Status.DLL_INITIALIZE_ERROR;
+ }
+ }
+ }
+
+ public uint GetStatus()
+ {
+ return status;
+ }
+
+ public void Dispose()
+ {
+ if (module != nint.Zero)
+ {
+ DeinitializeOls();
+ FreeLibrary(module);
+ module = nint.Zero;
+ }
+ }
+
+ public Delegate GetDelegate(string procName, Type delegateType)
+ {
+ nint ptr = GetProcAddress(module, procName);
+ if (ptr != nint.Zero)
+ {
+ Delegate d = Marshal.GetDelegateForFunctionPointer(ptr, delegateType);
+ return d;
+ }
+
+ int result = Marshal.GetHRForLastWin32Error();
+ throw Marshal.GetExceptionForHR(result);
+ }
+
+ //-----------------------------------------------------------------------------
+ // DLL Information
+ //-----------------------------------------------------------------------------
+ public delegate uint _GetDllStatus();
+ public delegate uint _GetDllVersion(ref byte major, ref byte minor, ref byte revision, ref byte release);
+ public delegate uint _GetDriverVersion(ref byte major, ref byte minor, ref byte revision, ref byte release);
+ public delegate uint _GetDriverType();
+
+ public delegate int _InitializeOls();
+ public delegate void _DeinitializeOls();
+
+ public _GetDllStatus GetDllStatus = null;
+ public _GetDriverType GetDriverType = null;
+ public _GetDllVersion GetDllVersion = null;
+ public _GetDriverVersion GetDriverVersion = null;
+
+ public _InitializeOls InitializeOls = null;
+ public _DeinitializeOls DeinitializeOls = null;
+
+ //-----------------------------------------------------------------------------
+ // CPU
+ //-----------------------------------------------------------------------------
+ public delegate int _IsCpuid();
+ public delegate int _IsMsr();
+ public delegate int _IsTsc();
+ public delegate int _Hlt();
+ public delegate int _HltTx(nuint threadAffinityMask);
+ public delegate int _HltPx(nuint processAffinityMask);
+ public delegate int _Rdmsr(uint index, ref uint eax, ref uint edx);
+ public delegate int _RdmsrTx(uint index, ref uint eax, ref uint edx, nuint threadAffinityMask);
+ public delegate int _RdmsrPx(uint index, ref uint eax, ref uint edx, nuint processAffinityMask);
+ public delegate int _Wrmsr(uint index, uint eax, uint edx);
+ public delegate int _WrmsrTx(uint index, uint eax, uint edx, nuint threadAffinityMask);
+ public delegate int _WrmsrPx(uint index, uint eax, uint edx, nuint processAffinityMask);
+ public delegate int _Rdpmc(uint index, ref uint eax, ref uint edx);
+ public delegate int _RdpmcTx(uint index, ref uint eax, ref uint edx, nuint threadAffinityMask);
+ public delegate int _RdpmcPx(uint index, ref uint eax, ref uint edx, nuint processAffinityMask);
+ public delegate int _Cpuid(uint index, ref uint eax, ref uint ebx, ref uint ecx, ref uint edx);
+ public delegate int _CpuidTx(uint index, ref uint eax, ref uint ebx, ref uint ecx, ref uint edx, nuint threadAffinityMask);
+ public delegate int _CpuidPx(uint index, ref uint eax, ref uint ebx, ref uint ecx, ref uint edx, nuint processAffinityMask);
+ public delegate int _Rdtsc(ref uint eax, ref uint edx);
+ public delegate int _RdtscTx(ref uint eax, ref uint edx, nuint threadAffinityMask);
+ public delegate int _RdtscPx(ref uint eax, ref uint edx, nuint processAffinityMask);
+
+ public _IsCpuid IsCpuid = null;
+ public _IsMsr IsMsr = null;
+ public _IsTsc IsTsc = null;
+ public _Hlt Hlt = null;
+ public _HltTx HltTx = null;
+ public _HltPx HltPx = null;
+ public _Rdmsr Rdmsr = null;
+ public _RdmsrTx RdmsrTx = null;
+ public _RdmsrPx RdmsrPx = null;
+ public _Wrmsr Wrmsr = null;
+ public _WrmsrTx WrmsrTx = null;
+ public _WrmsrPx WrmsrPx = null;
+ public _Rdpmc Rdpmc = null;
+ public _RdpmcTx RdpmcTx = null;
+ public _RdpmcPx RdpmcPx = null;
+ public _Cpuid Cpuid = null;
+ public _CpuidTx CpuidTx = null;
+ public _CpuidPx CpuidPx = null;
+ public _Rdtsc Rdtsc = null;
+ public _RdtscTx RdtscTx = null;
+ public _RdtscPx RdtscPx = null;
+
+ //-----------------------------------------------------------------------------
+ // I/O
+ //-----------------------------------------------------------------------------
+ public delegate byte _ReadIoPortByte(ushort port);
+ public delegate ushort _ReadIoPortWord(ushort port);
+ public delegate uint _ReadIoPortDword(ushort port);
+ public _ReadIoPortByte ReadIoPortByte;
+ public _ReadIoPortWord ReadIoPortWord;
+ public _ReadIoPortDword ReadIoPortDword;
+
+ public delegate int _ReadIoPortByteEx(ushort port, ref byte value);
+ public delegate int _ReadIoPortWordEx(ushort port, ref ushort value);
+ public delegate int _ReadIoPortDwordEx(ushort port, ref uint value);
+ public _ReadIoPortByteEx ReadIoPortByteEx;
+ public _ReadIoPortWordEx ReadIoPortWordEx;
+ public _ReadIoPortDwordEx ReadIoPortDwordEx;
+
+ public delegate void _WriteIoPortByte(ushort port, byte value);
+ public delegate void _WriteIoPortWord(ushort port, ushort value);
+ public delegate void _WriteIoPortDword(ushort port, uint value);
+ public _WriteIoPortByte WriteIoPortByte;
+ public _WriteIoPortWord WriteIoPortWord;
+ public _WriteIoPortDword WriteIoPortDword;
+
+ public delegate int _WriteIoPortByteEx(ushort port, byte value);
+ public delegate int _WriteIoPortWordEx(ushort port, ushort value);
+ public delegate int _WriteIoPortDwordEx(ushort port, uint value);
+ public _WriteIoPortByteEx WriteIoPortByteEx;
+ public _WriteIoPortWordEx WriteIoPortWordEx;
+ public _WriteIoPortDwordEx WriteIoPortDwordEx;
+
+ //-----------------------------------------------------------------------------
+ // PCI
+ //-----------------------------------------------------------------------------
+ public delegate void _SetPciMaxBusIndex(byte max);
+ public _SetPciMaxBusIndex SetPciMaxBusIndex;
+
+ public delegate byte _ReadPciConfigByte(uint pciAddress, byte regAddress);
+ public delegate ushort _ReadPciConfigWord(uint pciAddress, byte regAddress);
+ public delegate uint _ReadPciConfigDword(uint pciAddress, byte regAddress);
+ public _ReadPciConfigByte ReadPciConfigByte;
+ public _ReadPciConfigWord ReadPciConfigWord;
+ public _ReadPciConfigDword ReadPciConfigDword;
+
+ public delegate int _ReadPciConfigByteEx(uint pciAddress, uint regAddress, ref byte value);
+ public delegate int _ReadPciConfigWordEx(uint pciAddress, uint regAddress, ref ushort value);
+ public delegate int _ReadPciConfigDwordEx(uint pciAddress, uint regAddress, ref uint value);
+ public _ReadPciConfigByteEx ReadPciConfigByteEx;
+ public _ReadPciConfigWordEx ReadPciConfigWordEx;
+ public _ReadPciConfigDwordEx ReadPciConfigDwordEx;
+
+
+ public delegate int _ReadPciConfigDwordEx64(uint pciAddress, uint regAddress, ref ulong value);
+ public _ReadPciConfigDwordEx64 ReadPciConfigDwordEx64;
+
+ public delegate void _WritePciConfigByte(uint pciAddress, byte regAddress, byte value);
+ public delegate void _WritePciConfigWord(uint pciAddress, byte regAddress, ushort value);
+ public delegate void _WritePciConfigDword(uint pciAddress, byte regAddress, uint value);
+ public _WritePciConfigByte WritePciConfigByte;
+ public _WritePciConfigWord WritePciConfigWord;
+ public _WritePciConfigDword WritePciConfigDword;
+
+ public delegate int _WritePciConfigByteEx(uint pciAddress, uint regAddress, byte value);
+ public delegate int _WritePciConfigWordEx(uint pciAddress, uint regAddress, ushort value);
+ public delegate int _WritePciConfigDwordEx(uint pciAddress, uint regAddress, uint value);
+ public _WritePciConfigByteEx WritePciConfigByteEx;
+ public _WritePciConfigWordEx WritePciConfigWordEx;
+ public _WritePciConfigDwordEx WritePciConfigDwordEx;
+
+ public delegate int _WritePciConfigDwordEx64(uint pciAddress, uint regAddress, ulong value);
+ public _WritePciConfigDwordEx64 WritePciConfigDwordEx64;
+
+ public delegate uint _FindPciDeviceById(ushort vendorId, ushort deviceId, byte index);
+ public delegate uint _FindPciDeviceByClass(byte baseClass, byte subClass, byte programIf, byte index);
+ public _FindPciDeviceById FindPciDeviceById;
+ public _FindPciDeviceByClass FindPciDeviceByClass;
+
+ //-----------------------------------------------------------------------------
+ // Physical Memory (unsafe)
+ //-----------------------------------------------------------------------------
+
+ /*public unsafe delegate uint _ReadDmiMemory(byte* buffer, uint count, uint unitSize);
+ public _ReadDmiMemory ReadDmiMemory;
+
+ public unsafe delegate uint _ReadPhysicalMemory(UIntPtr address, byte* buffer, uint count, uint unitSize);
+ public unsafe delegate uint _WritePhysicalMemory(UIntPtr address, byte* buffer, uint count, uint unitSize);
+
+ public _ReadPhysicalMemory ReadPhysicalMemory;
+ public _WritePhysicalMemory WritePhysicalMemory;
+ */
+ }
+}
+
diff --git a/app/Ryzen/RyzenSmu.cs b/app/Ryzen/RyzenSmu.cs
new file mode 100644
index 00000000..d031f03c
--- /dev/null
+++ b/app/Ryzen/RyzenSmu.cs
@@ -0,0 +1,239 @@
+//
+// This is a optimised/simplified version of Ryzen System Management Unit from https://github.com/JamesCJ60/Universal-x86-Tuning-Utility
+// I do not take credit for the full functionality of the code (c)
+//
+
+[assembly: CLSCompliant(false)]
+
+
+namespace Ryzen
+{
+ class Smu
+ {
+
+ public enum Status : int
+ {
+ BAD = 0x0,
+ OK = 0x1,
+ FAILED = 0xFF,
+ UNKNOWN_CMD = 0xFE,
+ CMD_REJECTED_PREREQ = 0xFD,
+ CMD_REJECTED_BUSY = 0xFC
+ }
+
+ private static readonly Dictionary status = new Dictionary()
+ {
+ { Status.BAD, "BAD" },
+ { Status.OK, "OK" },
+ { Status.FAILED, "Failed" },
+ { Status.UNKNOWN_CMD, "Unknown Command" },
+ { Status.CMD_REJECTED_PREREQ, "CMD Rejected Prereq" },
+ { Status.CMD_REJECTED_BUSY, "CMD Rejected Busy" }
+ };
+
+
+
+ Ols RyzenNbAccesss;
+
+
+ public Smu(bool EnableDebug)
+ {
+ ShowDebug = EnableDebug;
+ RyzenNbAccesss = new Ols();
+
+ // Check WinRing0 status
+ switch (RyzenNbAccesss.GetDllStatus())
+ {
+ case (uint)Ols.OlsDllStatus.OLS_DLL_NO_ERROR:
+ if (ShowDebug)
+ {
+ //MessageBox.Show("Ols Dll is OK.", "Ols.OlsDllStatus:");
+ }
+ break;
+ case (uint)Ols.OlsDllStatus.OLS_DLL_DRIVER_NOT_LOADED:
+ //MessageBox.Show("WinRing OLS_DRIVER_NOT_LOADED", "Ols.OlsDllStatus:");
+ throw new ApplicationException("WinRing OLS_DRIVER_NOT_LOADED");
+
+ case (uint)Ols.OlsDllStatus.OLS_DLL_UNSUPPORTED_PLATFORM:
+ //MessageBox.Show("WinRing OLS_UNSUPPORTED_PLATFORM", "Ols.OlsDllStatus:");
+ throw new ApplicationException("WinRing OLS_UNSUPPORTED_PLATFORM");
+
+ case (uint)Ols.OlsDllStatus.OLS_DLL_DRIVER_NOT_FOUND:
+ //MessageBox.Show("WinRing OLS_DLL_DRIVER_NOT_FOUND", "Ols.OlsDllStatus:");
+ throw new ApplicationException("WinRing OLS_DLL_DRIVER_NOT_FOUND");
+
+ case (uint)Ols.OlsDllStatus.OLS_DLL_DRIVER_UNLOADED:
+ //MessageBox.Show("WinRing OLS_DLL_DRIVER_UNLOADED", "Ols.OlsDllStatus:");
+ throw new ApplicationException("WinRing OLS_DLL_DRIVER_UNLOADED");
+
+ case (uint)Ols.OlsDllStatus.OLS_DLL_DRIVER_NOT_LOADED_ON_NETWORK:
+ //MessageBox.Show("WinRing DRIVER_NOT_LOADED_ON_NETWORK", "Ols.OlsDllStatus:");
+ throw new ApplicationException("WinRing DRIVER_NOT_LOADED_ON_NETWORK");
+
+ case (uint)Ols.OlsDllStatus.OLS_DLL_UNKNOWN_ERROR:
+ //MessageBox.Show("WinRing OLS_DLL_UNKNOWN_ERROR", "Ols.OlsDllStatus:");
+ throw new ApplicationException("WinRing OLS_DLL_UNKNOWN_ERROR");
+ }
+
+ }
+
+ public void Initialize()
+ {
+ amdSmuMutex = new Mutex();
+ RyzenNbAccesss.InitializeOls();
+
+ // Check WinRing0 status
+ switch (RyzenNbAccesss.GetStatus())
+ {
+ case (uint)Ols.Status.NO_ERROR:
+ if (ShowDebug)
+ {
+ //MessageBox.Show("Ols is OK.", "Ols.Status:");
+ ShowDebug = false;
+ }
+ break;
+ case (uint)Ols.Status.DLL_NOT_FOUND:
+ //MessageBox.Show("WinRing Status: DLL_NOT_FOUND", "Ols.Status:");
+ throw new ApplicationException("WinRing DLL_NOT_FOUND");
+ break;
+ case (uint)Ols.Status.DLL_INCORRECT_VERSION:
+ //MessageBox.Show("WinRing Status: DLL_INCORRECT_VERSION", "Ols.Status:");
+ throw new ApplicationException("WinRing DLL_INCORRECT_VERSION");
+ break;
+ case (uint)Ols.Status.DLL_INITIALIZE_ERROR:
+ //MessageBox.Show("WinRing Status: DLL_INITIALIZE_ERROR", "Ols.Status:");
+ throw new ApplicationException("WinRing DLL_INITIALIZE_ERROR");
+ break;
+ default:
+ break;
+ }
+ }
+
+
+ public void Deinitialize()
+ {
+ RyzenNbAccesss.DeinitializeOls();
+ }
+
+ public static uint SMU_PCI_ADDR { get; set; }
+ public static uint SMU_OFFSET_ADDR { get; set; }
+ public static uint SMU_OFFSET_DATA { get; set; }
+
+ public static uint MP1_ADDR_MSG { get; set; }
+ public static uint MP1_ADDR_RSP { get; set; }
+ public static uint MP1_ADDR_ARG { get; set; }
+
+ public static uint PSMU_ADDR_MSG { get; set; }
+ public static uint PSMU_ADDR_RSP { get; set; }
+ public static uint PSMU_ADDR_ARG { get; set; }
+ public static uint[] args { get; set; }
+
+ public bool ShowDebug { get; set; }
+
+ private static Mutex amdSmuMutex;
+ private const ushort SMU_TIMEOUT = 8192;
+
+ public Status SendMp1(uint message, ref uint[] arguments)
+ {
+ return SendMsg(MP1_ADDR_MSG, MP1_ADDR_RSP, MP1_ADDR_ARG, message, ref arguments);
+ }
+
+ public Status SendPsmu(uint message, ref uint[] arguments)
+ {
+ return SendMsg(PSMU_ADDR_MSG, PSMU_ADDR_RSP, PSMU_ADDR_ARG, message, ref arguments);
+ }
+
+
+ public Status SendMsg(uint SMU_ADDR_MSG, uint SMU_ADDR_RSP, uint SMU_ADDR_ARG, uint msg, ref uint[] args)
+ {
+ ushort timeout = SMU_TIMEOUT;
+ uint[] cmdArgs = new uint[6];
+ int argsLength = args.Length;
+ uint status = 0;
+
+ if (argsLength > cmdArgs.Length)
+ argsLength = cmdArgs.Length;
+
+ for (int i = 0; i < argsLength; ++i)
+ cmdArgs[i] = args[i];
+
+ if (amdSmuMutex.WaitOne(5000))
+ {
+ // Clear response register
+ bool temp;
+ do
+ temp = SmuWriteReg(SMU_ADDR_RSP, 0);
+ while (!temp && --timeout > 0);
+
+ if (timeout == 0)
+ {
+ amdSmuMutex.ReleaseMutex();
+ SmuReadReg(SMU_ADDR_RSP, ref status);
+ return (Status)status;
+ }
+
+ // Write data
+ for (int i = 0; i < cmdArgs.Length; ++i)
+ SmuWriteReg(SMU_ADDR_ARG + (uint)(i * 4), cmdArgs[i]);
+
+ // Send message
+ SmuWriteReg(SMU_ADDR_MSG, msg);
+
+ // Wait done
+ if (!SmuWaitDone(SMU_ADDR_RSP))
+ {
+ amdSmuMutex.ReleaseMutex();
+ SmuReadReg(SMU_ADDR_RSP, ref status);
+ return (Status)status;
+ }
+
+ // Read back args
+ for (int i = 0; i < args.Length; ++i)
+ SmuReadReg(SMU_ADDR_ARG + (uint)(i * 4), ref args[i]);
+ }
+
+ amdSmuMutex.ReleaseMutex();
+ SmuReadReg(SMU_ADDR_RSP, ref status);
+
+ return (Status)status;
+ }
+
+
+ public bool SmuWaitDone(uint SMU_ADDR_RSP)
+ {
+ bool res;
+ ushort timeout = SMU_TIMEOUT;
+ uint data = 0;
+
+ do
+ res = SmuReadReg(SMU_ADDR_RSP, ref data);
+ while ((!res || data != 1) && --timeout > 0);
+
+ if (timeout == 0 || data != 1) res = false;
+
+ return res;
+ }
+
+
+ private bool SmuWriteReg(uint addr, uint data)
+ {
+ if (RyzenNbAccesss.WritePciConfigDwordEx(SMU_PCI_ADDR, SMU_OFFSET_ADDR, addr) == 1)
+ {
+ return RyzenNbAccesss.WritePciConfigDwordEx(SMU_PCI_ADDR, SMU_OFFSET_DATA, data) == 1;
+ }
+ return false;
+ }
+
+ private bool SmuReadReg(uint addr, ref uint data)
+ {
+ if (RyzenNbAccesss.WritePciConfigDwordEx(SMU_PCI_ADDR, SMU_OFFSET_ADDR, addr) == 1)
+ {
+ return RyzenNbAccesss.ReadPciConfigDwordEx(SMU_PCI_ADDR, SMU_OFFSET_DATA, ref data) == 1;
+ }
+ return false;
+ }
+
+
+
+ }
+}
diff --git a/app/Ryzen/SendCommand.cs b/app/Ryzen/SendCommand.cs
new file mode 100644
index 00000000..fa488e80
--- /dev/null
+++ b/app/Ryzen/SendCommand.cs
@@ -0,0 +1,1198 @@
+//
+// This is a optimised/simplified version of Ryzen System Management Unit from https://github.com/JamesCJ60/Universal-x86-Tuning-Utility
+// I do not take credit for the full functionality of the code (c)
+//
+
+
+namespace Ryzen
+{
+ internal class SendCommand
+ {
+
+ //RAVEN - 0
+ //PICASSO - 1
+ //DALI - 2
+ //RENOIR/LUCIENNE - 3
+ //MATISSE - 4
+ //VANGOGH - 5
+ //VERMEER - 6
+ //CEZANNE/BARCELO - 7
+ //REMBRANDT - 8
+ //PHEONIX - 9
+ //RAPHAEL/DRAGON RANGE - 10
+
+ public static Smu RyzenAccess = new Smu(false);
+ public static int FAMID = Undervolter.FAMID;
+
+
+ //STAMP Limit
+ public static void set_stapm_limit(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x1a, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x14, ref Args);
+ RyzenAccess.SendPsmu(0x31, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //STAMP2 Limit
+ public static void set_stapm2_limit(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendPsmu(0x31, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Fast Limit
+ public static void set_fast_limit(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x1b, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x15, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Slow Limit
+ public static void set_slow_limit(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x1c, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x16, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Slow time
+ public static void set_slow_time(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x1d, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x17, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //STAMP Time
+ public static void set_stapm_time(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x1e, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x18, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //TCTL Temp Limit
+ public static void set_tctl_temp(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendPsmu(0x68, ref Args);
+ break;
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x1f, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x19, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendMp1(0x23, ref Args);
+ RyzenAccess.SendPsmu(0x56, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x59, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //cHTC Temp Limit
+ public static void set_cHTC_temp(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendPsmu(0x56, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendPsmu(0x37, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Skin Temp limit
+ public static void set_apu_skin_temp_limit(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 5:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x33, ref Args);
+ break;
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x38, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //VRM Current
+ public static void set_vrm_current(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x20, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x1a, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //VRM SoC Current
+ public static void set_vrmsoc_current(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x21, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x1b, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //VRM GFX Current
+ public static void set_vrmgfx_current(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 5:
+ RyzenAccess.SendMp1(0x1c, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //VRM CVIP Current
+ public static void set_vrmcvip_current(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 5:
+ RyzenAccess.SendMp1(0x1d, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //VRM Max Current
+ public static void set_vrmmax_current(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x22, ref Args);
+ break;
+ case 5:
+ RyzenAccess.SendMp1(0x1e, ref Args);
+ break;
+ case 3:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x1c, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //VRM GFX Max Current
+ public static void set_vrmgfxmax_current(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 5:
+ RyzenAccess.SendMp1(0x1f, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //VRM SoC Max Current
+ public static void set_vrmsocmax_current(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x23, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x1d, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //GFX Clock Max
+ public static void set_max_gfxclk_freq(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x46, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //GFX Clock Min
+ public static void set_min_gfxclk_freq(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x47, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //SoC Clock Max
+ public static void set_max_socclk_freq(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x48, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //SoC Clock Min
+ public static void set_min_socclk_freq(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x49, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //FCLK Clock Max
+ public static void set_max_fclk_freq(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x4a, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //FCLK Clock Min
+ public static void set_min_fclk_freq(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x4b, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //VCN Clock Max
+ public static void set_max_vcn_freq(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x4c, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //VCN Clock Min
+ public static void set_min_vcn_freq(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x4d, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //LCLK Clock Max
+ public static void set_max_lclk(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x4e, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //LCLK Clock Min
+ public static void set_min_lclk(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x4f, ref Args);
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Prochot Ramp
+ public static void set_prochot_deassertion_ramp(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x26, ref Args);
+ break;
+ case 5:
+ RyzenAccess.SendMp1(0x22, ref Args);
+ break;
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x20, ref Args);
+ break;
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x1f, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //GFX Clock
+ public static void set_gfx_clk(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 3:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendPsmu(0x89, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //dGPU Skin Temp
+ public static void set_dGPU_skin(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x37, ref Args);
+ break;
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x32, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Power Saving
+ public static void set_power_saving(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x19, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x12, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Max Performance
+ public static void set_max_performance(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendMp1(0x18, ref Args);
+ break;
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x11, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Set All Core OC
+ public static void set_oc_clk(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendPsmu(0x6c, ref Args);
+ break;
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendPsmu(0x7d, ref Args);
+ break;
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x31, ref Args);
+ RyzenAccess.SendPsmu(0x19, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendMp1(0x26, ref Args);
+ RyzenAccess.SendPsmu(0x5c, ref Args);
+ break;
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendPsmu(0x19, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x5F, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Set Per Core OC
+ public static void set_per_core_oc_clk(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendPsmu(0x6d, ref Args);
+ break;
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendPsmu(0x7E, ref Args);
+ break;
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x32, ref Args);
+ RyzenAccess.SendPsmu(0x1a, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendMp1(0x27, ref Args);
+ RyzenAccess.SendPsmu(0x5d, ref Args);
+ break;
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendPsmu(0x1a, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x60, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Set VID
+ public static void set_oc_volt(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendPsmu(0x6e, ref Args);
+ break;
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendPsmu(0x7f, ref Args);
+ break;
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x33, ref Args);
+ RyzenAccess.SendPsmu(0x1b, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendMp1(0x28, ref Args);
+ RyzenAccess.SendPsmu(0x61, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x61, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Set All Core Curve Optimiser
+ public static void set_coall(int value)
+ {
+
+ uint uvalue = Convert.ToUInt32(0x100000 - (uint)(-1 * value));
+
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = uvalue;
+
+ Smu.Status? result = null;
+
+ switch (FAMID)
+ {
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x55, ref Args);
+ result = RyzenAccess.SendPsmu(0xB1, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendMp1(0x36, ref Args);
+ result = RyzenAccess.SendPsmu(0xB, ref Args);
+ break;
+ case 5:
+ case 8:
+ case 9:
+ case 11:
+ result = RyzenAccess.SendPsmu(0x5D, ref Args);
+ break;
+ case 10:
+ result = RyzenAccess.SendPsmu(0x7, ref Args);
+ break;
+ default:
+ break;
+ }
+
+ Logger.WriteLine($"UV: {value} {result}");
+
+ RyzenAccess.Deinitialize();
+ }
+
+ //Set Per Core Curve Optimiser
+ public static void set_coper(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x54, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendMp1(0x35, ref Args);
+ break;
+ case 5:
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendMp1(0x4b, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x6, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Set iGPU Curve Optimiser
+ public static void set_cogfx(int value)
+ {
+
+ uint uvalue = Convert.ToUInt32(0x100000 - (uint)(-1 * value));
+
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = uvalue;
+
+ Smu.Status? result = null;
+
+ switch (FAMID)
+ {
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x64, ref Args);
+ result = RyzenAccess.SendPsmu(0x57, ref Args);
+ break;
+ case 5:
+ case 8:
+ case 9:
+ case 11:
+ result = RyzenAccess.SendPsmu(0xb7, ref Args);
+ break;
+ default:
+ break;
+ }
+
+ Logger.WriteLine($"iGPU UV: {value} {result}");
+
+ RyzenAccess.Deinitialize();
+ }
+
+ //Disable OC
+ public static void set_disable_oc()
+ {
+ uint value = 0x0;
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendMp1(0x24, ref Args);
+ break;
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendPsmu(0x6A, ref Args);
+ break;
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x30, ref Args);
+ RyzenAccess.SendPsmu(0x1d, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendMp1(0x25, ref Args);
+ RyzenAccess.SendPsmu(0x5b, ref Args);
+ break;
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendPsmu(0x18, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x5E, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Enable OC
+ public static void set_enable_oc()
+ {
+ uint value = 0x0;
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendMp1(0x23, ref Args);
+ break;
+ case 0:
+ case 1:
+ case 2:
+ RyzenAccess.SendPsmu(0x69, ref Args);
+ break;
+ case 3:
+ case 7:
+ RyzenAccess.SendMp1(0x2f, ref Args);
+ RyzenAccess.SendPsmu(0x1d, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendMp1(0x24, ref Args);
+ RyzenAccess.SendPsmu(0x5a, ref Args);
+ break;
+ case 8:
+ case 9:
+ case 11:
+ RyzenAccess.SendPsmu(0x17, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x5D, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Set PBO Scaler
+ public static void set_scaler(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendPsmu(0x6a, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendPsmu(0x58, ref Args);
+ RyzenAccess.SendMp1(0x2F, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x5b, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+
+ //Set PPT
+ public static void set_ppt(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendPsmu(0x64, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendPsmu(0x53, ref Args);
+ RyzenAccess.SendMp1(0x3D, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x56, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+
+ //Set TDC
+ public static void set_tdc(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendPsmu(0x65, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendPsmu(0x54, ref Args);
+ RyzenAccess.SendMp1(0x3B, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x57, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+
+ //Set EDC
+ public static void set_edc(uint value)
+ {
+ RyzenAccess.Initialize();
+ uint[] Args = new uint[6];
+ Args[0] = value;
+
+ switch (FAMID)
+ {
+ case -1:
+ RyzenAccess.SendPsmu(0x66, ref Args);
+ break;
+ case 4:
+ case 6:
+ RyzenAccess.SendPsmu(0x55, ref Args);
+ RyzenAccess.SendMp1(0x3c, ref Args);
+ break;
+ case 10:
+ RyzenAccess.SendPsmu(0x58, ref Args);
+ break;
+ default:
+ break;
+ }
+ RyzenAccess.Deinitialize();
+ }
+ }
+}
diff --git a/app/Ryzen/Undervolter.cs b/app/Ryzen/Undervolter.cs
new file mode 100644
index 00000000..45a6d5fc
--- /dev/null
+++ b/app/Ryzen/Undervolter.cs
@@ -0,0 +1,199 @@
+//
+// This is a optimised/simplified version of Ryzen System Management Unit from https://github.com/JamesCJ60/Universal-x86-Tuning-Utility
+// I do not take credit for the full functionality of the code (c)
+//
+
+
+using System.Management;
+
+namespace Ryzen
+{
+ internal class Undervolter
+ {
+ public static string[] FAM = { "RAVEN", "PICASSO", "DALI", "RENOIR/LUCIENNE", "MATISSE", "VANGOGH", "VERMEER", "CEZANNE/BARCELO", "REMBRANDT", "PHOENIX", "RAPHAEL/DRAGON RANGE" };
+ public static int FAMID { get; protected set; }
+
+ public static string CPUModel = "";
+ public static string CPUName = "";
+
+ //Zen1/+ - -1
+ //RAVEN - 0
+ //PICASSO - 1
+ //DALI - 2
+ //RENOIR/LUCIENNE - 3
+ //MATISSE - 4
+ //VANGOGH - 5
+ //VERMEER - 6
+ //CEZANNE/BARCELO - 7
+ //REMBRANDT - 8
+ //PHEONIX - 9
+ //RAPHAEL/DRAGON RANGE - 10
+ //MENDOCINO - 11
+
+ public static void Init()
+ {
+ //Get CPU name
+
+ try
+ {
+ ManagementObjectSearcher myProcessorObject = new ManagementObjectSearcher("select * from Win32_Processor");
+ foreach (ManagementObject obj in myProcessorObject.Get())
+ {
+ CPUName = obj["Name"].ToString();
+ CPUModel = obj["Caption"].ToString();
+ }
+ } catch (Exception ex)
+ {
+ Logger.WriteLine(ex.Message);
+ }
+
+ FAMID = 99999;
+
+ if (CPUModel.Contains("Model " + Convert.ToString(1)) || CPUModel.Contains("Model " + Convert.ToString(8)))
+ {
+ FAMID = -1; //Zen1/+ DT
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(17)))
+ {
+ FAMID = 0; //RAVEN
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(24)))
+ {
+ FAMID = 1; //PICASSO
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(32)))
+ {
+ FAMID = 2; //DALI
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(33)))
+ {
+ FAMID = 6; //VERMEER
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(96)) || CPUModel.Contains("Model " + Convert.ToString(104)))
+ {
+ FAMID = 3; //RENOIR/LUCIENNE
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(144)))
+ {
+ FAMID = 5; //VANGOGH
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(80)))
+ {
+ FAMID = 7; //CEZANNE/BARCELO
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(64)) || CPUModel.Contains("Model " + Convert.ToString(68)))
+ {
+ FAMID = 8; //REMBRANDT
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(116)))
+ {
+ FAMID = 9; //PHEONIX
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(97)))
+ {
+ FAMID = 10; //RAPHAEL/DRAGON RANGE
+ }
+
+ if (CPUModel.Contains("Model " + Convert.ToString(160)))
+ {
+ FAMID = 11; //MENDOCINO
+ }
+
+ Logger.WriteLine($"CPU: {FAMID} - {CPUName} - {CPUModel}");
+
+ SetAddresses();
+ }
+
+ public static bool IsAMD()
+ {
+
+ if (CPUName.Length == 0) Init();
+
+ return CPUName.Contains("AMD") || CPUName.Contains("Ryzen") || CPUName.Contains("Athlon") || CPUName.Contains("Radeon") || CPUName.Contains("AMD Custom APU 0405");
+
+ }
+
+ public static void SetAddresses()
+ {
+
+ Smu.SMU_PCI_ADDR = 0x00000000;
+ Smu.SMU_OFFSET_ADDR = 0xB8;
+ Smu.SMU_OFFSET_DATA = 0xBC;
+
+ if (FAMID == -1)
+ {
+ Smu.MP1_ADDR_MSG = 0X3B10528;
+ Smu.MP1_ADDR_RSP = 0X3B10564;
+ Smu.MP1_ADDR_ARG = 0X3B10598;
+
+ Smu.PSMU_ADDR_MSG = 0x3B1051C;
+ Smu.PSMU_ADDR_RSP = 0X3B10568;
+ Smu.PSMU_ADDR_ARG = 0X3B10590;
+ }
+
+
+ if (FAMID == 0 || FAMID == 1 || FAMID == 2 || FAMID == 3 || FAMID == 7)
+ {
+ Smu.MP1_ADDR_MSG = 0x3B10528;
+ Smu.MP1_ADDR_RSP = 0x3B10564;
+ Smu.MP1_ADDR_ARG = 0x3B10998;
+
+ Smu.PSMU_ADDR_MSG = 0x3B10A20;
+ Smu.PSMU_ADDR_RSP = 0x3B10A80;
+ Smu.PSMU_ADDR_ARG = 0x3B10A88;
+ }
+ else if (FAMID == 5 || FAMID == 8 || FAMID == 9 || FAMID == 11)
+ {
+ Smu.MP1_ADDR_MSG = 0x3B10528;
+ Smu.MP1_ADDR_RSP = 0x3B10578;
+ Smu.MP1_ADDR_ARG = 0x3B10998;
+
+ Smu.PSMU_ADDR_MSG = 0x3B10a20;
+ Smu.PSMU_ADDR_RSP = 0x3B10a80;
+ Smu.PSMU_ADDR_ARG = 0x3B10a88;
+ }
+ else if (FAMID == 4 || FAMID == 6)
+ {
+ Smu.MP1_ADDR_MSG = 0x3B10530;
+ Smu.MP1_ADDR_RSP = 0x3B1057C;
+ Smu.MP1_ADDR_ARG = 0x3B109C4;
+
+ Smu.PSMU_ADDR_MSG = 0x3B10524;
+ Smu.PSMU_ADDR_RSP = 0x3B10570;
+ Smu.PSMU_ADDR_ARG = 0x3B10A40;
+ }
+ else if (FAMID == 10)
+ {
+ Smu.MP1_ADDR_MSG = 0x3010508;
+ Smu.MP1_ADDR_RSP = 0x3010988;
+ Smu.MP1_ADDR_ARG = 0x3010984;
+
+ Smu.PSMU_ADDR_MSG = 0x3B10524;
+ Smu.PSMU_ADDR_RSP = 0x3B10570;
+ Smu.PSMU_ADDR_ARG = 0x3B10A40;
+ }
+ else
+ {
+ Smu.MP1_ADDR_MSG = 0;
+ Smu.MP1_ADDR_RSP = 0;
+ Smu.MP1_ADDR_ARG = 0;
+
+ Smu.PSMU_ADDR_MSG = 0;
+ Smu.PSMU_ADDR_RSP = 0;
+ Smu.PSMU_ADDR_ARG = 0;
+ }
+
+
+ }
+ }
+}
diff --git a/app/Settings.cs b/app/Settings.cs
index 9a634970..f769ce34 100644
--- a/app/Settings.cs
+++ b/app/Settings.cs
@@ -1,6 +1,7 @@
using CustomControls;
using GHelper.AnimeMatrix;
using GHelper.Gpu;
+using Ryzen;
using System.Diagnostics;
using System.Net;
using System.Reflection;
@@ -692,7 +693,7 @@ namespace GHelper
}
}
- public void FansToggle()
+ public void FansToggle(int index = 0)
{
if (fans == null || fans.Text == "")
{
@@ -707,6 +708,7 @@ namespace GHelper
{
fans.FormPosition();
fans.Show();
+ fans.ToggleNavigation(index);
}
}
@@ -886,8 +888,6 @@ namespace GHelper
bool screenEnabled = (frequency >= 0);
- Debug.WriteLine(frequency.ToString());
-
ButtonEnabled(button60Hz, screenEnabled);
ButtonEnabled(button120Hz, screenEnabled);
ButtonEnabled(buttonScreenAuto, screenEnabled);
@@ -1125,6 +1125,39 @@ namespace GHelper
}
+
+ public void AutoUV()
+ {
+ if (!AppConfig.IsMode("auto_uv")) return;
+ SetUV();
+ }
+
+ public void SetUV(bool launchAsAdmin = false)
+ {
+
+ if (!ProcessHelper.IsUserAdministrator())
+ {
+ if (launchAsAdmin) ProcessHelper.RunAsAdmin("uv");
+ return;
+ }
+
+ if (!Undervolter.IsAMD()) return;
+
+ int cpuUV = AppConfig.GetMode("cpu_uv", 0);
+ int igpuUV = AppConfig.GetMode("igpu_uv", 0);
+
+ if (cpuUV >= -40 && cpuUV <= 0)
+ {
+ SendCommand.set_coall(cpuUV);
+ }
+
+ if (igpuUV >= -40 && igpuUV <= 0)
+ {
+ SendCommand.set_cogfx(igpuUV);
+ }
+ }
+
+
protected void LabelFansResult(string text)
{
if (fans != null && fans.Text != "")
@@ -1229,8 +1262,10 @@ namespace GHelper
{
timer.Stop();
timer.Dispose();
+
if (applyPower) SetPower();
SetGPUPower();
+ AutoUV();
};
timer.Start();
}
@@ -1238,6 +1273,7 @@ namespace GHelper
{
if (applyPower) SetPower();
SetGPUPower();
+ AutoUV();
}
}
@@ -1347,11 +1383,7 @@ namespace GHelper
if (fans != null && fans.Text != "")
{
- fans.InitMode();
- fans.InitFans();
- fans.InitPower();
- fans.InitBoost();
- fans.InitGPU();
+ fans.InitAll();
}
}
diff --git a/app/WinRing0x64.dll b/app/WinRing0x64.dll
new file mode 100644
index 00000000..4a48c7a1
Binary files /dev/null and b/app/WinRing0x64.dll differ
diff --git a/app/WinRing0x64.sys b/app/WinRing0x64.sys
new file mode 100644
index 00000000..197c255a
Binary files /dev/null and b/app/WinRing0x64.sys differ