mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c2eed4fe2 | ||
|
|
8d6b277fda | ||
|
|
d3de136dd3 | ||
|
|
8e6f54e833 | ||
|
|
0b030da41b | ||
|
|
05aae069b4 | ||
|
|
28e949bee4 | ||
|
|
9a82a54b04 | ||
|
|
8aff60546a | ||
|
|
d5039207ec | ||
|
|
f940d343c3 | ||
|
|
1848612434 | ||
|
|
fe253de0e1 | ||
|
|
7211fd5f22 | ||
|
|
c1a8eb12f9 | ||
|
|
0477d03ecc | ||
|
|
e923d82732 | ||
|
|
6558d66e8d | ||
|
|
ec8605dfe6 | ||
|
|
ac462b628f | ||
|
|
1cd9c30c4a |
@@ -14,8 +14,18 @@ public static class AppConfig
|
||||
static AppConfig()
|
||||
{
|
||||
|
||||
string startupPath = Application.StartupPath.Trim('\\');
|
||||
string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
|
||||
configFile = appPath + "\\config.json";
|
||||
string configName = "\\config.json";
|
||||
|
||||
if (File.Exists(startupPath + configName))
|
||||
{
|
||||
configFile = startupPath + configName;
|
||||
} else
|
||||
{
|
||||
configFile = appPath + configName;
|
||||
}
|
||||
|
||||
|
||||
if (!System.IO.Directory.Exists(appPath))
|
||||
System.IO.Directory.CreateDirectory(appPath);
|
||||
@@ -29,6 +39,7 @@ public static class AppConfig
|
||||
}
|
||||
catch
|
||||
{
|
||||
Logger.WriteLine("Broken config: " + text);
|
||||
Init();
|
||||
}
|
||||
}
|
||||
@@ -208,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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -428,7 +428,6 @@ public class AsusACPI
|
||||
return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0;
|
||||
}
|
||||
|
||||
/*
|
||||
public void ScanRange()
|
||||
{
|
||||
int value;
|
||||
@@ -446,7 +445,6 @@ public class AsusACPI
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
public void TUFKeyboardBrightness(int brightness)
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace GHelper
|
||||
static byte[] MESSAGE_SET = { AURA_HID_ID, 0xb5, 0, 0, 0 };
|
||||
static byte[] MESSAGE_APPLY = { AURA_HID_ID, 0xb4 };
|
||||
|
||||
static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0, 0x18c6 };
|
||||
static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0, 0x18c6, 0x1abe };
|
||||
|
||||
private static int mode = 0;
|
||||
private static int speed = 1;
|
||||
|
||||
888
app/Fans.Designer.cs
generated
888
app/Fans.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
178
app/Fans.cs
178
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
|
||||
@@ -20,7 +22,7 @@ namespace GHelper
|
||||
|
||||
static int MinRPM, MaxRPM;
|
||||
|
||||
static bool powerVisible = true, gpuVisible = true;
|
||||
static bool gpuVisible = true;
|
||||
|
||||
const int fansMax = 100;
|
||||
|
||||
@@ -31,9 +33,12 @@ namespace GHelper
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
//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;
|
||||
@@ -48,7 +53,7 @@ namespace GHelper
|
||||
labelGPUBoostTitle.Text = Properties.Strings.GPUBoost;
|
||||
labelGPUTempTitle.Text = Properties.Strings.GPUTempTarget;
|
||||
|
||||
InitTheme();
|
||||
InitTheme(true);
|
||||
|
||||
MinRPM = 18;
|
||||
MaxRPM = HardwareControl.GetFanMax();
|
||||
@@ -125,16 +130,21 @@ 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);
|
||||
trackUV.Minimum = -30;
|
||||
trackUV.Maximum = 0;
|
||||
|
||||
trackUViGPU.Minimum = -20;
|
||||
trackUViGPU.Maximum = 0;
|
||||
|
||||
trackTemp.Minimum = 75;
|
||||
trackTemp.Maximum = 97;
|
||||
|
||||
|
||||
FillModes();
|
||||
InitAll();
|
||||
|
||||
comboBoost.SelectedValueChanged += ComboBoost_Changed;
|
||||
|
||||
@@ -148,6 +158,135 @@ namespace GHelper
|
||||
buttonRemove.Click += ButtonRemove_Click;
|
||||
buttonRename.Click += ButtonRename_Click;
|
||||
|
||||
|
||||
trackUV.Scroll += TrackUV_Scroll;
|
||||
trackUViGPU.Scroll += TrackUV_Scroll;
|
||||
trackTemp.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)));
|
||||
int temp = Math.Max(trackTemp.Minimum, Math.Min(trackTemp.Maximum, AppConfig.GetMode("cpu_temp", 96)));
|
||||
|
||||
checkApplyUV.Enabled = checkApplyUV.Checked = AppConfig.IsMode("auto_uv");
|
||||
|
||||
trackUV.Value = cpuUV;
|
||||
labelUV.Text = trackUV.Value.ToString();
|
||||
|
||||
trackUViGPU.Value = igpuUV;
|
||||
labelUViGPU.Text = trackUViGPU.Value.ToString();
|
||||
|
||||
trackTemp.Value = temp;
|
||||
labelTemp.Text = trackTemp.Value.ToString() + "°C";
|
||||
|
||||
|
||||
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();
|
||||
labelTemp.Text = trackTemp.Value.ToString() + "°C";
|
||||
|
||||
AppConfig.SetMode("cpu_temp", trackTemp.Value);
|
||||
AppConfig.SetMode("cpu_uv", trackUV.Value);
|
||||
AppConfig.SetMode("igpu_uv", trackUViGPU.Value);
|
||||
|
||||
}
|
||||
|
||||
private void ComboModes_KeyPress(object? sender, KeyPressEventArgs e)
|
||||
@@ -231,12 +370,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;
|
||||
}
|
||||
|
||||
@@ -248,13 +387,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");
|
||||
@@ -302,7 +441,7 @@ namespace GHelper
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.WriteLine(ex.ToString());
|
||||
gpuVisible = panelGPU.Visible = false;
|
||||
gpuVisible = buttonGPU.Visible = false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -394,8 +533,6 @@ namespace GHelper
|
||||
|
||||
public void FormPosition()
|
||||
{
|
||||
panelSliders.Visible = gpuVisible || powerVisible;
|
||||
|
||||
if (Height > Program.settingsForm.Height)
|
||||
{
|
||||
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
|
||||
@@ -484,7 +621,7 @@ namespace GHelper
|
||||
bool modeB0 = Program.acpi.IsAllAmdPPT();
|
||||
bool modeC1 = Program.acpi.DeviceGet(AsusACPI.PPT_APUC1) >= 0;
|
||||
|
||||
powerVisible = panelPower.Visible = modeA0;
|
||||
panelA0.Visible = modeA0;
|
||||
panelB0.Visible = modeB0;
|
||||
|
||||
|
||||
@@ -689,6 +826,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;
|
||||
|
||||
@@ -117,44 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="buttonRename.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
|
||||
DAAACwwBP0AiyAAAAR9JREFUWEftlEuKwkAURTPQHruB3oMINk5chNtRHAnuwFX0R3vQq2lw6kRxCXqP
|
||||
5EE6dPKqNOWoDhw0lUrdS6VIkckkpCeXcl/Kf8aeQl++y0vNhUwO4R+SwJN8k9Py+lcmpR4+kjCRwQWY
|
||||
GCNbzbsl/LMcq4bzyzXjcwY8qot7VsO/yrGmcJvrYouHUg0/y7GEoTxKxtkZ5gURU4BFt7KzcAgt8CI7
|
||||
D4eQAsnCwStA+LdkTtOB40wQfteXzyswk23h7IyFc/Kj8QqsJPfXt6u/4TvJDoF9iqPxCvxI7m8kJSyc
|
||||
12Lh4K3TiPfgQdocsx4Odi+atgdfJfcowU7wOjgT9XBIUmAgKRFCkgIx5AK5wMMFujKa/xZ5xEymhaK4
|
||||
AsqsxiD2d6spAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonRemove.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
|
||||
DAAACwwBP0AiyAAAAclJREFUWEftls0uBEEQx+fkI1zWjeAusTyBeAC8EC68Ahu8DImvp8ANF44EB/x/
|
||||
na3LRM9099YSyf6TXzJdU13T011d3dVI/02rYl+ciQfx0YdnbLzDx13r4lJ8JXIh6DOwJsWJ+BQEfhIH
|
||||
YkMsiLE+PGM7FPjgSx/6EqNIM+JaEOxFbIsp0SZ8dsSroC8xOiJLjNo+fiOWRa6WxK2wQWTNBFNnH5/F
|
||||
UCj62iCOMKSI5GH9mPaSP6+LGCwHMdcwtMmynTX3ErGIeR5aDVoROJLJKQmXKmLZ7uAbUVFIcGKreasn
|
||||
iL0XWhFRzXBiT3trUxD7NLQiehQ4zYeWrxYFsSnbUb0LnKhudWHPoa5xgf0ttCL68wHYElDbvWVLcB9a
|
||||
EQ0zCbcEsRuT0LYhp5q3krbhsArRtHgWxG4sRIjLBI4cqV7aFcRsLcXIDiMOkC6GAZV9GKFjwYg5Sucw
|
||||
FIq+d4JYyccx4vJwJWwQJRdNZs8+zoVkQmSJa5QNgikkJ0imNuHDmtuVjBjZVzITM8HUsX4EI5PZThws
|
||||
FBa7lPLMPuedZTt96Jv95z+J5CGDCZwCvskJlyP2MIWEakZJ5ewAnrHxzmPnjPRbqqpvzOytki4+4b0A
|
||||
AAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
|
||||
DAAACwwBP0AiyAAAAddJREFUWEftlssuBUEQhmflEjbsCPYSlycQD4AXwoZXQPAyJG5PgR02LAkW+L/O
|
||||
qc3J6emqOXOI5PzJl0z3VNfUdFdXdzXUf9Oq2Bfn4lF8duCZPt5h07rWxZX4dnIpGNO3xsWp+BI4fhYH
|
||||
YkPMi5EOPNN3KLDBljGMxUcjTYsbgbNXsS0mREnY7Ig3wVh8TImQiNo+fiuWRFSL4k5YEKGZYOrs4zN0
|
||||
NBRjLYhjOjwieVg/pr3Jn3cLHywHPtfoKMmynTVvS/jC50Vq1WhFYEgmexIOWygJX7Y7+EZWFBKM2Goe
|
||||
eQNARwLbvdTKiGqGEXvao0gAmwLbs9TK6ElgNJdaZUUCWBDYUraz+hAYUd16yT5YopdGBe/eUyujPw/A
|
||||
loDa7lHdB7tlS/CQWhkNMgm3BLa1SWjbkFPNo0gArm04qEI0KV4EtrWFCHGZwJAjtS3tCnwWSzGyw4gD
|
||||
ZJmOPhU+jNCJIGKO0lk6Goqx9wJf7uMYcXm4FhZEk4sms2cf50IyJkLiGmVBMIXkBMlUEjasuV3J8BG+
|
||||
kpmYCaaO9cMZmcx24mChsNillGf2Oe8s2xnD2PCf9xLJQwbj2AO27oSLiD1MIaGaUVI5O4Bn+njXxs4Z
|
||||
6rdUVT8f7bmGe+JHiAAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
<data name="labelRisky.Text" xml:space="preserve">
|
||||
<value>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.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -16,7 +16,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<AssemblyVersion>0.83</AssemblyVersion>
|
||||
<AssemblyVersion>0.88</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
@@ -133,6 +133,12 @@
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Update="WinRing0x64.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="WinRing0x64.sys">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -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]);
|
||||
@@ -242,21 +242,21 @@ namespace GHelper
|
||||
case Keys.F7:
|
||||
if (AppConfig.ContainsModel("TUF"))
|
||||
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, ScreenBrightness.Adjust(-10) + "%", ToastIcon.BrightnessDown);
|
||||
HandleEvent(16);
|
||||
HandleOptimizationEvent(16);
|
||||
break;
|
||||
case Keys.F8:
|
||||
if (AppConfig.ContainsModel("TUF"))
|
||||
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, ScreenBrightness.Adjust(+10) + "%", ToastIcon.BrightnessUp);
|
||||
HandleEvent(32);
|
||||
HandleOptimizationEvent(32);
|
||||
break;
|
||||
case Keys.F9:
|
||||
KeyboardHook.KeyWinPress(Keys.P);
|
||||
break;
|
||||
case Keys.F10:
|
||||
HandleEvent(107);
|
||||
HandleOptimizationEvent(107);
|
||||
break;
|
||||
case Keys.F11:
|
||||
HandleEvent(108);
|
||||
HandleOptimizationEvent(108);
|
||||
break;
|
||||
case Keys.F12:
|
||||
KeyboardHook.KeyWinPress(Keys.A);
|
||||
@@ -343,10 +343,10 @@ namespace GHelper
|
||||
}
|
||||
break;
|
||||
case "brightness_up":
|
||||
HandleEvent(32);
|
||||
HandleOptimizationEvent(32);
|
||||
break;
|
||||
case "brightness_down":
|
||||
HandleEvent(16);
|
||||
HandleOptimizationEvent(16);
|
||||
break;
|
||||
case "custom":
|
||||
CustomKey(name);
|
||||
@@ -429,10 +429,17 @@ namespace GHelper
|
||||
return;
|
||||
}
|
||||
|
||||
if (OptimizationService.IsRunning()) return;
|
||||
if (!OptimizationService.IsRunning())
|
||||
|
||||
HandleOptimizationEvent(EventID);
|
||||
|
||||
// Asus Optimization service Events
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void HandleOptimizationEvent(int EventID)
|
||||
{
|
||||
switch (EventID)
|
||||
{
|
||||
case 16: // FN+F7
|
||||
@@ -449,14 +456,7 @@ namespace GHelper
|
||||
case 108: // FN+F11
|
||||
Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.KB_Sleep, "Sleep");
|
||||
break;
|
||||
case 106: // Zephyrus DUO special key for turning on/off second display.
|
||||
//Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.KB_DUO_SecondDisplay, "SecondDisplay");
|
||||
break;
|
||||
case 75: // Zephyrus DUO special key for changing between arrows and pgup/pgdn
|
||||
//Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.KB_DUO_PgUpDn, "PgUpDown");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -724,6 +724,14 @@ public class NativeMethods
|
||||
int iRet = NativeMethods.ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
|
||||
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
|
||||
|
||||
//Fallback scenario
|
||||
if (iRet != 0)
|
||||
{
|
||||
Thread.Sleep(300);
|
||||
iRet = NativeMethods.ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
|
||||
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
|
||||
}
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
@@ -796,9 +804,25 @@ public class NativeMethods
|
||||
|
||||
public static void SetPowerScheme(string scheme)
|
||||
{
|
||||
PowerSetActiveScheme(IntPtr.Zero, new Guid(scheme));
|
||||
PowerSetActiveOverlayScheme(new Guid(scheme));
|
||||
Logger.WriteLine(scheme);
|
||||
List<string> overlays = new() {
|
||||
"00000000-0000-0000-0000-000000000000",
|
||||
"ded574b5-45a0-4f42-8737-46345c09c238",
|
||||
"961cc777-2547-4f9d-8174-7d86181b8a7a",
|
||||
"3af9B8d9-7c97-431d-ad78-34a8bfea439f"
|
||||
};
|
||||
|
||||
if (overlays.Contains(scheme))
|
||||
{
|
||||
PowerSetActiveOverlayScheme(new Guid(scheme));
|
||||
Logger.WriteLine("Power mode:" + scheme);
|
||||
}
|
||||
else
|
||||
{
|
||||
PowerSetActiveScheme(IntPtr.Zero, new Guid(scheme));
|
||||
Logger.WriteLine("Power plan:" + scheme);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void SetPowerScheme(int mode)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -177,15 +179,23 @@ namespace GHelper
|
||||
if (settingsForm.Visible) settingsForm.HideAll();
|
||||
else
|
||||
{
|
||||
|
||||
settingsForm.Left = Screen.FromControl(settingsForm).WorkingArea.Width - 10 - settingsForm.Width;
|
||||
settingsForm.Top = Screen.FromControl(settingsForm).WorkingArea.Height - 10 - settingsForm.Height;
|
||||
|
||||
settingsForm.Show();
|
||||
settingsForm.Activate();
|
||||
|
||||
settingsForm.Left = Screen.FromControl(settingsForm).WorkingArea.Width - 10 - settingsForm.Width;
|
||||
settingsForm.Top = Screen.FromControl(settingsForm).WorkingArea.Height - 10 - settingsForm.Height;
|
||||
|
||||
settingsForm.VisualiseGPUMode();
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case "gpu":
|
||||
Startup.ReScheduleAdmin();
|
||||
settingsForm.FansToggle();
|
||||
settingsForm.FansToggle(1);
|
||||
break;
|
||||
case "gpurestart":
|
||||
settingsForm.RestartGPU(false);
|
||||
@@ -195,6 +205,11 @@ namespace GHelper
|
||||
settingsForm.keyb.Show();
|
||||
settingsForm.keyb.ServiesToggle();
|
||||
break;
|
||||
case "uv":
|
||||
Startup.ReScheduleAdmin();
|
||||
settingsForm.FansToggle(2);
|
||||
settingsForm.SetUV();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
80
app/Properties/Resources.Designer.cs
generated
80
app/Properties/Resources.Designer.cs
generated
@@ -110,6 +110,16 @@ namespace GHelper.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_add_64 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8_add_64", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -130,6 +140,16 @@ namespace GHelper.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_boost_30 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8-boost-30", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -160,6 +180,16 @@ namespace GHelper.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_edit_32 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8_edit_32", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -360,6 +390,16 @@ namespace GHelper.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_remove_64 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8_remove_64", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -370,6 +410,26 @@ namespace GHelper.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_save_32 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8-save-32", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_share_32 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8_share_32", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -420,6 +480,16 @@ namespace GHelper.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_temperature_48 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8-temperature-48", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -450,6 +520,16 @@ namespace GHelper.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap icons8_voltage_60 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("icons8-voltage-60", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
||||
@@ -118,17 +118,23 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="icons8-video-card-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-video-card-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="brightness_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-software-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-software-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-leaf-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-leaf-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-launch-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-launch-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-charging-battery-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-charging-battery-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icons8_mute_unmute_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-organic-food-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-organic-food-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
@@ -139,8 +145,8 @@
|
||||
<data name="icons8_microphone_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-rocket-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-bicycle-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
@@ -154,15 +160,27 @@
|
||||
<data name="icons8-processor-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-processor-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8_add_64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-add-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-game-controller-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-game-controller-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-spa-flower-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-spa-flower-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8_share_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-share-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="standard" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\standard.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8_charged_battery_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-charged-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-voltage-60" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-voltage-60.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-keyboard-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-keyboard-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@@ -175,8 +193,8 @@
|
||||
<data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-speed-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-speed-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icons8_charging_battery_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="eco" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
@@ -184,11 +202,14 @@
|
||||
<data name="icons8-laptop-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-laptop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icons8-rocket-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-video-card-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-video-card-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icons8-charging-battery-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-charging-battery-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8_edit_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-edit-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="backlight_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
@@ -196,8 +217,8 @@
|
||||
<data name="icons8-spa-flower-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-spa-flower-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-organic-food-961" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-organic-food-961.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icons8-save-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-save-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8_function" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-function-mac-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
@@ -211,18 +232,21 @@
|
||||
<data name="icons8-matrix-desktop-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-matrix-desktop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8_mute_unmute_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icons8_remove_64" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-remove-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-speed-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-speed-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-xbox-controller-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-xbox-controller-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-organic-food-961" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-organic-food-961.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-project-management-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-project-management-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8_video_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-leaf-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-leaf-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@@ -232,16 +256,16 @@
|
||||
<data name="backlight_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\backlight-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-boost-30" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-boost-30.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8-software-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-software-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icons8_video_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8_charged_battery_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-charged-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="icons8_charging_battery_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="icons8-temperature-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons8-temperature-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
2
app/Properties/Strings.Designer.cs
generated
2
app/Properties/Strings.Designer.cs
generated
@@ -160,7 +160,7 @@ namespace GHelper.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Apply Power Limits.
|
||||
/// Looks up a localized string similar to Apply.
|
||||
/// </summary>
|
||||
internal static string ApplyPowerLimits {
|
||||
get {
|
||||
|
||||
@@ -148,13 +148,16 @@
|
||||
<value>G-Helper já está em execução. Verifique a barra de sistema</value>
|
||||
</data>
|
||||
<data name="ApplyFanCurve" xml:space="preserve">
|
||||
<value>Aplicar a curva de ventilador personalizada</value>
|
||||
<value>Aplicar a curva personalizada</value>
|
||||
</data>
|
||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||
<value>Aplicar as limitações de energia</value>
|
||||
</data>
|
||||
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||
<value>Automaticamente ajustar os Modos de Energia Windows</value>
|
||||
<value>Ajuste automático dos modos de energia do Windows</value>
|
||||
</data>
|
||||
<data name="AsusServicesRunning" xml:space="preserve">
|
||||
<value>Serviços da Asus em execução</value>
|
||||
</data>
|
||||
<data name="AuraBreathe" xml:space="preserve">
|
||||
<value>Repiração</value>
|
||||
@@ -184,25 +187,28 @@
|
||||
<value>Automático</value>
|
||||
</data>
|
||||
<data name="AutoRefreshTooltip" xml:space="preserve">
|
||||
<value>Estabelece 60Hz para economizar energia</value>
|
||||
<value>Menor taxa de atualização quando estiver na bateria</value>
|
||||
</data>
|
||||
<data name="Awake" xml:space="preserve">
|
||||
<value>Acordado</value>
|
||||
</data>
|
||||
<data name="BacklightTimeout" xml:space="preserve">
|
||||
<value>Números de segundos para desligar a luz de fundo</value>
|
||||
<value>Tempo limite da iluminação na bateria (em segundos)</value>
|
||||
</data>
|
||||
<data name="BacklightTimeoutPlugged" xml:space="preserve">
|
||||
<value>Tempo limite da iluminação carregando (0 - sempre ligado)</value>
|
||||
</data>
|
||||
<data name="Balanced" xml:space="preserve">
|
||||
<value>Equilibrado</value>
|
||||
</data>
|
||||
<data name="BatteryChargeLimit" xml:space="preserve">
|
||||
<value>Limite de carga da bateria</value>
|
||||
<value>Limite de carga</value>
|
||||
</data>
|
||||
<data name="Boot" xml:space="preserve">
|
||||
<value>Durante o lançamento</value>
|
||||
<value>Ao ligar</value>
|
||||
</data>
|
||||
<data name="Brightness" xml:space="preserve">
|
||||
<value>Luminosidade</value>
|
||||
<value>Nível do brilho</value>
|
||||
</data>
|
||||
<data name="Color" xml:space="preserve">
|
||||
<value>Cor</value>
|
||||
@@ -259,11 +265,14 @@
|
||||
<value>Ventiladores e Energía</value>
|
||||
</data>
|
||||
<data name="FanSpeed" xml:space="preserve">
|
||||
<value>Ventilador</value>
|
||||
<value>Vent</value>
|
||||
</data>
|
||||
<data name="FansPower" xml:space="preserve">
|
||||
<value>Ventiladores + Energía</value>
|
||||
</data>
|
||||
<data name="FnLock" xml:space="preserve">
|
||||
<value>Processar teclas de atalho Fn+F sem pressionar Fn</value>
|
||||
</data>
|
||||
<data name="GPUBoost" xml:space="preserve">
|
||||
<value>Boost dinâmico</value>
|
||||
</data>
|
||||
@@ -297,14 +306,17 @@
|
||||
<data name="KeyboardBacklight" xml:space="preserve">
|
||||
<value>Luz de fundo do teclado</value>
|
||||
</data>
|
||||
<data name="KillGpuApps" xml:space="preserve">
|
||||
<value>Parar todos os aplicativos que usam a GPU ao alternar para o modo Eco</value>
|
||||
</data>
|
||||
<data name="LaptopBacklight" xml:space="preserve">
|
||||
<value>Luz de fundo do computador</value>
|
||||
<value>Configurações de iluminação</value>
|
||||
</data>
|
||||
<data name="LaptopKeyboard" xml:space="preserve">
|
||||
<value>Teclado do computador</value>
|
||||
<value>Teclado</value>
|
||||
</data>
|
||||
<data name="LaptopScreen" xml:space="preserve">
|
||||
<value>Tela do computador</value>
|
||||
<value>Tela</value>
|
||||
</data>
|
||||
<data name="Lid" xml:space="preserve">
|
||||
<value>Tampa</value>
|
||||
@@ -337,13 +349,16 @@
|
||||
<value>Imagem</value>
|
||||
</data>
|
||||
<data name="MaxRefreshTooltip" xml:space="preserve">
|
||||
<value>Taxa de atualização maxíma para abaixar a latência</value>
|
||||
<value>Taxa de atualização máxima e menor latência</value>
|
||||
</data>
|
||||
<data name="MinRefreshTooltip" xml:space="preserve">
|
||||
<value>Taxa de atualização à 60Hz para salvar energía</value>
|
||||
<value>Taxa de atualização à 60Hz para economizar bateria</value>
|
||||
</data>
|
||||
<data name="Multizone" xml:space="preserve">
|
||||
<value>Multizona</value>
|
||||
</data>
|
||||
<data name="MuteMic" xml:space="preserve">
|
||||
<value>Desligar microfone</value>
|
||||
</data>
|
||||
<data name="OpenGHelper" xml:space="preserve">
|
||||
<value>Abrir G-Helper</value>
|
||||
@@ -355,7 +370,7 @@
|
||||
<value>Passar ao Ecônomico em bateria e voltar quando carregando</value>
|
||||
</data>
|
||||
<data name="OptimizedUSBC" xml:space="preserve">
|
||||
<value>Manter o GPU desligado com um carregador USB-C no Modo Otimizado</value>
|
||||
<value>Manter a GPU desativada ao usar um carregador USB-C no modo Otimizado</value>
|
||||
</data>
|
||||
<data name="Other" xml:space="preserve">
|
||||
<value>Outro</value>
|
||||
@@ -364,7 +379,7 @@
|
||||
<value>Overdrive</value>
|
||||
</data>
|
||||
<data name="PerformanceMode" xml:space="preserve">
|
||||
<value>Modo Desempenho</value>
|
||||
<value>Modo</value>
|
||||
</data>
|
||||
<data name="PictureGif" xml:space="preserve">
|
||||
<value>Imagem / Gif</value>
|
||||
@@ -376,7 +391,7 @@
|
||||
<value>Limitações de Energia</value>
|
||||
</data>
|
||||
<data name="PPTExperimental" xml:space="preserve">
|
||||
<value>Limitações de Energia é uma funcionalidade experimental. Usar isso com cuidado </value>
|
||||
<value>Limitações de Energia é uma funcionalidade experimental. Use com cuidado.</value>
|
||||
</data>
|
||||
<data name="PrintScreen" xml:space="preserve">
|
||||
<value>Captura de tela</value>
|
||||
@@ -418,7 +433,19 @@
|
||||
<value>Padrão</value>
|
||||
</data>
|
||||
<data name="StartupError" xml:space="preserve">
|
||||
<value>Erro ao iniciar</value>
|
||||
<value>Erro de inicialização</value>
|
||||
</data>
|
||||
<data name="Start" xml:space="preserve">
|
||||
<value>Iniciar</value>
|
||||
</data>
|
||||
<data name="StartingServices" xml:space="preserve">
|
||||
<value>Iniciando os serviços</value>
|
||||
</data>
|
||||
<data name="Stop" xml:space="preserve">
|
||||
<value>Parar</value>
|
||||
</data>
|
||||
<data name="StoppingServices" xml:space="preserve">
|
||||
<value>Parando os serviços</value>
|
||||
</data>
|
||||
<data name="ToggleAura" xml:space="preserve">
|
||||
<value>Alternar Aura</value>
|
||||
@@ -444,13 +471,22 @@
|
||||
<data name="UltimateMode" xml:space="preserve">
|
||||
<value>Ultimate</value>
|
||||
</data>
|
||||
<data name="Updates" xml:space="preserve">
|
||||
<value>Atualizações</value>
|
||||
</data>
|
||||
<data name="VersionLabel" xml:space="preserve">
|
||||
<value>Versão</value>
|
||||
</data>
|
||||
<data name="VolumeMute" xml:space="preserve">
|
||||
<data name="VolumeDown" xml:space="preserve">
|
||||
<value>Abaixar o volume</value>
|
||||
</data>
|
||||
<data name="VolumeUp" xml:space="preserve">
|
||||
<value>Aumentar o volume</value>
|
||||
</data>
|
||||
<data name="VolumeMute" xml:space="preserve">
|
||||
<value>Mudo</value>
|
||||
</data>
|
||||
<data name="WindowTop" xml:space="preserve">
|
||||
<value>Manter o app em primeiro plano</value>
|
||||
<value>Manter a janela do aplicativo sempre no topo</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
app/Resources/icons8-boost-30.png
Normal file
BIN
app/Resources/icons8-boost-30.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 426 B |
BIN
app/Resources/icons8-save-32.png
Normal file
BIN
app/Resources/icons8-save-32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 195 B |
BIN
app/Resources/icons8-temperature-48.png
Normal file
BIN
app/Resources/icons8-temperature-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 645 B |
BIN
app/Resources/icons8-voltage-60.png
Normal file
BIN
app/Resources/icons8-voltage-60.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 706 B |
446
app/Ryzen/OpenLibSys.cs
Normal file
446
app/Ryzen/OpenLibSys.cs
Normal file
@@ -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;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
239
app/Ryzen/RyzenSmu.cs
Normal file
239
app/Ryzen/RyzenSmu.cs
Normal file
@@ -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, string> status = new Dictionary<Status, string>()
|
||||
{
|
||||
{ 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
1208
app/Ryzen/SendCommand.cs
Normal file
1208
app/Ryzen/SendCommand.cs
Normal file
File diff suppressed because it is too large
Load Diff
199
app/Ryzen/Undervolter.cs
Normal file
199
app/Ryzen/Undervolter.cs
Normal file
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
113
app/Settings.cs
113
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;
|
||||
@@ -30,6 +31,7 @@ namespace GHelper
|
||||
public Extra keyb;
|
||||
public Updates updates;
|
||||
|
||||
static long lastUpdate;
|
||||
static long lastRefresh;
|
||||
|
||||
private bool customFans = false;
|
||||
@@ -181,14 +183,30 @@ namespace GHelper
|
||||
|
||||
SetContextMenu();
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||
CheckForUpdatesAsync();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
|
||||
{
|
||||
aTimer.Enabled = this.Visible;
|
||||
if (this.Visible)
|
||||
{
|
||||
InitScreen();
|
||||
InitXGM();
|
||||
|
||||
// Run update once per 12 hours
|
||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeSeconds() - lastUpdate) < 43200) return;
|
||||
lastUpdate = DateTimeOffset.Now.ToUnixTimeSeconds();
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||
CheckForUpdatesAsync();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonUpdates_Click(object? sender, EventArgs e)
|
||||
{
|
||||
if (updates == null || updates.Text == "")
|
||||
@@ -682,7 +700,7 @@ namespace GHelper
|
||||
}
|
||||
}
|
||||
|
||||
public void FansToggle()
|
||||
public void FansToggle(int index = 0)
|
||||
{
|
||||
if (fans == null || fans.Text == "")
|
||||
{
|
||||
@@ -697,6 +715,7 @@ namespace GHelper
|
||||
{
|
||||
fans.FormPosition();
|
||||
fans.Show();
|
||||
fans.ToggleNavigation(index);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1012,27 +1031,6 @@ namespace GHelper
|
||||
}
|
||||
|
||||
|
||||
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
|
||||
{
|
||||
if (this.Visible)
|
||||
{
|
||||
InitScreen();
|
||||
InitXGM();
|
||||
|
||||
this.Left = Screen.FromControl(this).WorkingArea.Width - 10 - this.Width;
|
||||
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
|
||||
this.Activate();
|
||||
|
||||
aTimer.Enabled = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
aTimer.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SetPerformanceLabel()
|
||||
{
|
||||
labelPerf.Text = Properties.Strings.PerformanceMode + ": " + Modes.GetCurrentName() + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : "");
|
||||
@@ -1134,6 +1132,54 @@ 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);
|
||||
int cpuTemp = AppConfig.GetMode("cpu_temp");
|
||||
|
||||
try
|
||||
{
|
||||
if (cpuUV >= -40 && cpuUV <= 0)
|
||||
{
|
||||
SendCommand.set_coall(cpuUV);
|
||||
}
|
||||
|
||||
if (igpuUV >= -40 && igpuUV <= 0)
|
||||
{
|
||||
SendCommand.set_cogfx(igpuUV);
|
||||
}
|
||||
|
||||
if (cpuTemp >= 70 && cpuTemp <= 97)
|
||||
{
|
||||
SendCommand.set_tctl_temp((uint)cpuTemp);
|
||||
SendCommand.set_apu_skin_temp_limit((uint)cpuTemp);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.WriteLine("UV Error: " + ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void LabelFansResult(string text)
|
||||
{
|
||||
if (fans != null && fans.Text != "")
|
||||
@@ -1238,8 +1284,10 @@ namespace GHelper
|
||||
{
|
||||
timer.Stop();
|
||||
timer.Dispose();
|
||||
|
||||
if (applyPower) SetPower();
|
||||
SetGPUPower();
|
||||
AutoUV();
|
||||
};
|
||||
timer.Start();
|
||||
}
|
||||
@@ -1247,6 +1295,7 @@ namespace GHelper
|
||||
{
|
||||
if (applyPower) SetPower();
|
||||
SetGPUPower();
|
||||
AutoUV();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1356,11 +1405,7 @@ namespace GHelper
|
||||
|
||||
if (fans != null && fans.Text != "")
|
||||
{
|
||||
fans.InitMode();
|
||||
fans.InitFans();
|
||||
fans.InitPower();
|
||||
fans.InitBoost();
|
||||
fans.InitGPU();
|
||||
fans.InitAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1497,8 +1542,10 @@ namespace GHelper
|
||||
|
||||
public void InitXGM()
|
||||
{
|
||||
bool connected = Program.acpi.IsXGConnected();
|
||||
buttonXGM.Enabled = buttonXGM.Visible = connected;
|
||||
|
||||
buttonXGM.Enabled = buttonXGM.Visible = Program.acpi.IsXGConnected();
|
||||
if (!connected) return;
|
||||
|
||||
int activated = Program.acpi.DeviceGet(AsusACPI.GPUXG);
|
||||
if (activated < 0) return;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using OSD;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Drawing2D;
|
||||
using OSD;
|
||||
|
||||
|
||||
namespace GHelper
|
||||
@@ -57,7 +56,7 @@ namespace GHelper
|
||||
Charger
|
||||
}
|
||||
|
||||
public class ToastForm : OSDNativeForm
|
||||
public class ToastForm : OSDNativeForm
|
||||
{
|
||||
|
||||
protected static string toastText = "Balanced";
|
||||
@@ -74,7 +73,7 @@ namespace GHelper
|
||||
|
||||
protected override void PerformPaint(PaintEventArgs e)
|
||||
{
|
||||
Brush brush = new SolidBrush(Color.FromArgb(150,Color.Black));
|
||||
Brush brush = new SolidBrush(Color.FromArgb(150, Color.Black));
|
||||
Drawing.FillRoundedRectangle(e.Graphics, brush, this.Bound, 10);
|
||||
|
||||
StringFormat format = new StringFormat();
|
||||
@@ -144,9 +143,9 @@ namespace GHelper
|
||||
|
||||
Screen screen1 = Screen.FromHandle(base.Handle);
|
||||
|
||||
Width = Math.Max(300, 100 + toastText.Length*22);
|
||||
Width = Math.Max(300, 100 + toastText.Length * 22);
|
||||
Height = 100;
|
||||
X = (screen1.Bounds.Width - this.Width)/2;
|
||||
X = (screen1.Bounds.Width - this.Width) / 2;
|
||||
Y = screen1.Bounds.Height - 300 - this.Height;
|
||||
|
||||
Show();
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace GHelper
|
||||
driver.hardwares = file.GetProperty("HardwareInfoList");
|
||||
drivers.Add(driver);
|
||||
|
||||
BeginInvoke(delegate
|
||||
Invoke(delegate
|
||||
{
|
||||
string versionText = driver.version.Replace("latest version at the ", "");
|
||||
Label versionLabel = new Label { Text = versionText, Anchor = AnchorStyles.Left, AutoSize = true };
|
||||
@@ -170,7 +170,7 @@ namespace GHelper
|
||||
}
|
||||
}
|
||||
|
||||
BeginInvoke(delegate
|
||||
Invoke(delegate
|
||||
{
|
||||
table.Visible = true;
|
||||
ResumeLayout(false);
|
||||
@@ -206,7 +206,7 @@ namespace GHelper
|
||||
var label = table.GetControlFromPosition(2, count) as Label;
|
||||
if (label != null)
|
||||
{
|
||||
BeginInvoke(delegate
|
||||
Invoke(delegate
|
||||
{
|
||||
label.Font = new Font(label.Font, FontStyle.Underline | FontStyle.Bold);
|
||||
label.ForeColor = colorTurbo;
|
||||
|
||||
BIN
app/WinRing0x64.dll
Normal file
BIN
app/WinRing0x64.dll
Normal file
Binary file not shown.
BIN
app/WinRing0x64.sys
Normal file
BIN
app/WinRing0x64.sys
Normal file
Binary file not shown.
@@ -21,7 +21,7 @@ Lightweight Armoury Crate alternative for Asus laptops. A small utility that all
|
||||
## [:floppy_disk: Download App](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
||||
|
||||
If you like this app, please [star :star: it on Github](https://github.com/seerge/g-helper) and spread a word about it!
|
||||
### [:euro: Donate EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [💵 Donate USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) | [:credit_card: Donate via Stripe](https://buy.stripe.com/00gaFJ9Lf79v7WobII)
|
||||
#### Support project in [:euro: EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [💵 USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) | [:credit_card: Stripe](https://buy.stripe.com/00gaFJ9Lf79v7WobII)
|
||||
|
||||
_If you post about the app - please include a link. Thanks._
|
||||
|
||||
@@ -177,17 +177,18 @@ By default app will use your windows language setting. But you can set language
|
||||
|
||||
Add following line to ``%AppData%\GHelper\config.json`` : ``"language" : "en"`` (by replacing "en" with language of your choice)
|
||||
|
||||
### Custom power plans with each mode
|
||||
### Custom windows power plans with each mode
|
||||
|
||||
In ``%AppData%\GHelper\config.json`` you can manually add custom power plan GUID (it can be either "real" power plan that can be switched or "overlay" power plan like the ones g-helper sets by default)
|
||||
In ``%AppData%\GHelper\config.json`` you can manually add custom power plan (or power mode) GUID. It can be either "real" power plan that can be switched or "overlay" power plan like the ones g-helper sets by default.
|
||||
|
||||
Format is following : ``"scheme_<mode>" : "GUID" ``
|
||||
|
||||
Where ``mode = 0 (balanced), 1 (turbo), 2 (silent)``
|
||||
|
||||
Default behaviour is :
|
||||
```
|
||||
"scheme_0": "2ac1d0e0-17a7-44ed-8091-d88ef75a4eb0",
|
||||
"scheme_1": "381b4222-f694-41f0-9685-ff5bb260df2e"
|
||||
"scheme_0": "00000000-0000-0000-0000-000000000000",
|
||||
"scheme_1": "ded574b5-45a0-4f42-8737-46345c09c238",
|
||||
"scheme_2": "961cc777-2547-4f9d-8174-7d86181b8a7a",
|
||||
```
|
||||
|
||||
Make sure to keep json structure (i.e. not to break it with extra or missing comas, etc) - or app will fail to read it and will just recreate a new config instead.
|
||||
@@ -216,8 +217,17 @@ To enable this custom workaround you need to add an extra line in config.json (u
|
||||
|
||||
By default app will toggle performance modes with Ctr+Shift+F5. You can change this binding by adding ``"keybind_profile": 116`` in config.json (under ``%AppData%\GHelper``), where 116 is [numerical code for desired key](https://www.oreilly.com/library/view/javascript-dhtml/9780596514082/apb.html). Put 0 to completely disable this binding.
|
||||
|
||||
### Keybinding to open G-helper from external keyboards
|
||||
Ctrl + Shift + F12
|
||||
|
||||
------------
|
||||
|
||||
**Libraries / projects used**
|
||||
- [Linux Kernel](https://github.com/torvalds/linux/blob/master/drivers/platform/x86/asus-wmi.c) for some basic endpoints in ASUS ACPI/WMI interface
|
||||
- [NvAPIWrapper](https://github.com/falahati/NvAPIWrapper) for accessing Nvidia API
|
||||
- [Starlight](https://github.com/vddCore/Starlight) for anime matrix communication protocol
|
||||
- [UXTU](https://github.com/JamesCJ60/Universal-x86-Tuning-Utility) for undervolting using Ryzen System Management Unit
|
||||
|
||||
**Disclaimers**
|
||||
"ROG", "TUF", and "Armoury Crate" are trademarked by and belong to AsusTek Computer, Inc. I make no claims to these or any assets belonging to AsusTek Computer and use them purely for informational purposes only.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user