mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
8 Commits
cpu-auto-t
...
v0.156
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abc9acd3a8 | ||
|
|
53d7382417 | ||
|
|
64f4572113 | ||
|
|
8ab1f1fc81 | ||
|
|
251d32e115 | ||
|
|
947e32b97c | ||
|
|
091303d90f | ||
|
|
c8b929310a |
@@ -365,9 +365,9 @@ public static class AppConfig
|
||||
return ContainsModel("ProArt");
|
||||
}
|
||||
|
||||
public static bool IsVivobook()
|
||||
public static bool IsVivoZenbook()
|
||||
{
|
||||
return ContainsModel("Vivobook");
|
||||
return ContainsModel("Vivobook") || ContainsModel("Zenbook");
|
||||
}
|
||||
|
||||
// Devices with bugged bios command to change brightness
|
||||
@@ -514,7 +514,7 @@ public static class AppConfig
|
||||
try
|
||||
{
|
||||
var (bios, model) = GetBiosAndModel();
|
||||
return (Int32.Parse(bios) == 317);
|
||||
return (Int32.Parse(bios) == 317 || Int32.Parse(bios) == 316);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -522,9 +522,19 @@ public static class AppConfig
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsResetRequired()
|
||||
{
|
||||
return ContainsModel("GA403");
|
||||
}
|
||||
|
||||
public static bool IsFanRequired()
|
||||
{
|
||||
return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P");
|
||||
return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P") || ContainsModel("GU605") || ContainsModel("GA403");
|
||||
}
|
||||
|
||||
public static bool IsAMDLight()
|
||||
{
|
||||
return ContainsModel("GA402X") || ContainsModel("GU605") || ContainsModel("GA403") || ContainsModel("FA507N") || ContainsModel("FA507X") || ContainsModel("FA707N") || ContainsModel("FA707X");
|
||||
}
|
||||
|
||||
public static bool IsPowerRequired()
|
||||
|
||||
@@ -308,6 +308,14 @@ public class AsusACPI
|
||||
{
|
||||
MaxGPUBoost = 15;
|
||||
}
|
||||
|
||||
if (AppConfig.IsAMDLight())
|
||||
{
|
||||
MaxTotal = 90;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
|
||||
@@ -421,9 +429,16 @@ public class AsusACPI
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int SetVivoMode(int mode)
|
||||
{
|
||||
if (mode == 1) mode = 2;
|
||||
else if (mode == 2) mode = 1;
|
||||
return Program.acpi.DeviceSet(VivoBookMode, mode, "VivoMode");
|
||||
}
|
||||
|
||||
public int SetGPUEco(int eco)
|
||||
{
|
||||
int ecoFlag = DeviceGet(GPUEco);
|
||||
|
||||
@@ -1008,7 +1008,7 @@ namespace GHelper
|
||||
try
|
||||
{
|
||||
if (chartCount > 2)
|
||||
Size = MinimumSize = new Size(Size.Width, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100)));
|
||||
Size = MinimumSize = new Size(Size.Width, Math.Max(MinimumSize.Height, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100))));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -1115,6 +1115,7 @@ namespace GHelper
|
||||
if (gpuVisible)
|
||||
{
|
||||
int gpuPowerVar = Program.acpi.DeviceGet(AsusACPI.GPU_POWER);
|
||||
Logger.WriteLine("Default GPU Power: " + gpuPowerVar);
|
||||
|
||||
trackGPUClockLimit.Value = NvidiaGpuControl.MaxClockLimit;
|
||||
trackGPUCore.Value = 0;
|
||||
@@ -1122,7 +1123,7 @@ namespace GHelper
|
||||
|
||||
trackGPUBoost.Value = AsusACPI.MaxGPUBoost;
|
||||
trackGPUTemp.Value = AsusACPI.MaxGPUTemp;
|
||||
trackGPUPower.Value = (gpuPowerVar >= 0) ? gpuPowerVar : AsusACPI.MaxGPUPower;
|
||||
trackGPUPower.Value = Math.Max(Math.Min((gpuPowerVar >= 0) ? gpuPowerVar : AsusACPI.MaxGPUPower, AsusACPI.MaxGPUPower), AsusACPI.MinGPUPower);
|
||||
|
||||
AppConfig.SetMode("gpu_boost", trackGPUBoost.Value);
|
||||
AppConfig.SetMode("gpu_temp", trackGPUTemp.Value);
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace GHelper.Input
|
||||
|
||||
InitBacklightTimer();
|
||||
|
||||
if (AppConfig.ContainsModel("VivoBook")) Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ? 1 : 0, "FnLock");
|
||||
if (AppConfig.IsVivoZenbook()) Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ? 1 : 0, "FnLock");
|
||||
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace GHelper.Input
|
||||
|
||||
// FN-Lock group
|
||||
|
||||
if (AppConfig.Is("fn_lock") && !AppConfig.ContainsModel("VivoBook"))
|
||||
if (AppConfig.Is("fn_lock") && !AppConfig.IsVivoZenbook())
|
||||
for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i);
|
||||
|
||||
// Arrow-lock group
|
||||
@@ -500,7 +500,7 @@ namespace GHelper.Input
|
||||
case "micmute":
|
||||
bool muteStatus = Audio.ToggleMute();
|
||||
Program.toast.RunToast(muteStatus ? "Muted" : "Unmuted", muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
|
||||
if (AppConfig.IsVivobook()) Program.acpi.DeviceSet(AsusACPI.MicMuteLed, muteStatus ? 1 : 0, "MicmuteLed");
|
||||
if (AppConfig.IsVivoZenbook()) Program.acpi.DeviceSet(AsusACPI.MicMuteLed, muteStatus ? 1 : 0, "MicmuteLed");
|
||||
break;
|
||||
case "brightness_up":
|
||||
SetBrightness(+10);
|
||||
@@ -568,7 +568,7 @@ namespace GHelper.Input
|
||||
int fnLock = AppConfig.Is("fn_lock") ? 0 : 1;
|
||||
AppConfig.Set("fn_lock", fnLock);
|
||||
|
||||
if (AppConfig.ContainsModel("VivoBook"))
|
||||
if (AppConfig.IsVivoZenbook())
|
||||
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock == 1 ? 1 : 0, "FnLock");
|
||||
else
|
||||
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);
|
||||
|
||||
@@ -62,39 +62,45 @@ namespace GHelper.Mode
|
||||
|
||||
if (!Modes.Exists(mode)) mode = 0;
|
||||
|
||||
customFans = false;
|
||||
customPower = 0;
|
||||
|
||||
settings.ShowMode(mode);
|
||||
SetModeLabel();
|
||||
|
||||
Modes.SetCurrent(mode);
|
||||
|
||||
int status = Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode");
|
||||
|
||||
// Vivobook fallback
|
||||
if (status != 1)
|
||||
Task.Run(async () =>
|
||||
{
|
||||
int vivoMode = Modes.GetBase(mode);
|
||||
if (vivoMode == 1) vivoMode = 2;
|
||||
else if (vivoMode == 2) vivoMode = 1;
|
||||
Program.acpi.DeviceSet(AsusACPI.VivoBookMode, vivoMode, "VivoMode");
|
||||
}
|
||||
bool reset = AppConfig.IsResetRequired() && (Modes.GetBase(oldMode) == Modes.GetBase(mode)) && customPower > 0;
|
||||
|
||||
customFans = false;
|
||||
customPower = 0;
|
||||
SetModeLabel();
|
||||
|
||||
// Workaround for not properly resetting limits on G14 2024
|
||||
if (reset)
|
||||
{
|
||||
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, (Modes.GetBase(oldMode) != 1) ? AsusACPI.PerformanceTurbo : AsusACPI.PerformanceBalanced, "Reset");
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(1500));
|
||||
}
|
||||
|
||||
int status = Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode");
|
||||
// Vivobook fallback
|
||||
if (status != 1) Program.acpi.SetVivoMode(Modes.GetBase(mode));
|
||||
|
||||
SetGPUClocks();
|
||||
|
||||
AutoFans();
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(1000));
|
||||
AutoPower();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
if (AppConfig.Is("xgm_fan") && Program.acpi.IsXGConnected()) XGM.Reset();
|
||||
|
||||
if (notify)
|
||||
Program.toast.RunToast(Modes.GetCurrentName(), SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online ? ToastIcon.Charger : ToastIcon.Battery);
|
||||
|
||||
SetGPUClocks();
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(100));
|
||||
AutoFans();
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(1000));
|
||||
AutoPower();
|
||||
});
|
||||
|
||||
|
||||
// Power plan from config or defaulting to balanced
|
||||
|
||||
@@ -37,7 +37,12 @@
|
||||
}
|
||||
public override int DPIIncrements()
|
||||
{
|
||||
return 100;
|
||||
return 50;
|
||||
}
|
||||
|
||||
public override int MinDPI()
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
|
||||
public override bool HasDebounceSetting()
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
{
|
||||
}
|
||||
|
||||
public StrixImpactII(ushort pid) : base(0x0B05, pid, "mi_00", false)
|
||||
{
|
||||
}
|
||||
|
||||
public override int DPIProfileCount()
|
||||
{
|
||||
return 4;
|
||||
@@ -174,4 +178,19 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class StrixImpactIIElectroPunk : StrixImpactII
|
||||
{
|
||||
|
||||
public StrixImpactIIElectroPunk() : base(0x1956)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override string GetDisplayName()
|
||||
{
|
||||
return "ROG Strix Impact II Electro Punk";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,6 +209,7 @@ namespace GHelper.Peripherals
|
||||
DetectMouse(new PugioII());
|
||||
DetectMouse(new PugioIIWired());
|
||||
DetectMouse(new StrixImpactII());
|
||||
DetectMouse(new StrixImpactIIElectroPunk());
|
||||
DetectMouse(new Chakram());
|
||||
DetectMouse(new ChakramWired());
|
||||
DetectMouse(new ChakramCore());
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Ryzen
|
||||
internal class RyzenControl
|
||||
{
|
||||
|
||||
public static int MinCPUUV => AppConfig.Get("min_uv", -30);
|
||||
public static int MinCPUUV => AppConfig.Get("min_uv", -40);
|
||||
public const int MaxCPUUV = 0;
|
||||
|
||||
public const int MinIGPUUV = -20;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -79,7 +79,7 @@ namespace GHelper.USB
|
||||
public static Color Color1 = Color.White;
|
||||
public static Color Color2 = Color.Black;
|
||||
|
||||
static bool isACPI = AppConfig.IsTUF() || AppConfig.IsVivobook() || AppConfig.IsProArt();
|
||||
static bool isACPI = AppConfig.IsTUF() || AppConfig.IsVivoZenbook() || AppConfig.IsProArt();
|
||||
static bool isStrix = AppConfig.IsStrix() && !AppConfig.IsNoDirectRGB();
|
||||
|
||||
static bool isStrix4Zone = AppConfig.IsStrixLimitedRGB();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "7.0.400"
|
||||
"version": "7.0.406"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user