Merge branch 'main' into srgb

This commit is contained in:
Serge
2024-03-05 15:31:12 +01:00
11 changed files with 96 additions and 948 deletions

View File

@@ -522,9 +522,19 @@ public static class AppConfig
} }
} }
public static bool IsResetRequired()
{
return ContainsModel("GA403");
}
public static bool IsFanRequired() 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() public static bool IsPowerRequired()

View File

@@ -308,6 +308,14 @@ public class AsusACPI
{ {
MaxGPUBoost = 15; MaxGPUBoost = 15;
} }
if (AppConfig.IsAMDLight())
{
MaxTotal = 90;
}
} }
public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer) public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
@@ -421,9 +429,16 @@ public class AsusACPI
{ {
return null; 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) public int SetGPUEco(int eco)
{ {
int ecoFlag = DeviceGet(GPUEco); int ecoFlag = DeviceGet(GPUEco);

View File

@@ -1008,7 +1008,7 @@ namespace GHelper
try try
{ {
if (chartCount > 2) 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) catch (Exception ex)
{ {

View File

@@ -676,7 +676,8 @@ namespace GHelper.Input
return; return;
case 51: // Fn+F6 on old TUFs case 51: // Fn+F6 on old TUFs
case 53: // Fn+F6 on GA-502DU model case 53: // Fn+F6 on GA-502DU model
NativeMethods.TurnOffScreen(); SleepEvent();
//NativeMethods.TurnOffScreen();
return; return;
} }
} }

View File

@@ -62,39 +62,45 @@ namespace GHelper.Mode
if (!Modes.Exists(mode)) mode = 0; if (!Modes.Exists(mode)) mode = 0;
customFans = false;
customPower = 0;
settings.ShowMode(mode); settings.ShowMode(mode);
SetModeLabel();
Modes.SetCurrent(mode); Modes.SetCurrent(mode);
int status = Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode");
// Vivobook fallback Task.Run(async () =>
if (status != 1)
{ {
int vivoMode = Modes.GetBase(mode); bool reset = AppConfig.IsResetRequired() && (Modes.GetBase(oldMode) == Modes.GetBase(mode)) && customPower > 0;
if (vivoMode == 1) vivoMode = 2;
else if (vivoMode == 2) vivoMode = 1; customFans = false;
Program.acpi.DeviceSet(AsusACPI.VivoBookMode, vivoMode, "VivoMode"); 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 (AppConfig.Is("xgm_fan") && Program.acpi.IsXGConnected()) XGM.Reset();
if (notify) if (notify)
Program.toast.RunToast(Modes.GetCurrentName(), SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online ? ToastIcon.Charger : ToastIcon.Battery); 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 // Power plan from config or defaulting to balanced

View File

@@ -37,7 +37,12 @@
} }
public override int DPIIncrements() public override int DPIIncrements()
{ {
return 100; return 50;
}
public override int MinDPI()
{
return 50;
} }
public override bool HasDebounceSetting() public override bool HasDebounceSetting()

View File

@@ -7,6 +7,10 @@
{ {
} }
public StrixImpactII(ushort pid) : base(0x0B05, pid, "mi_00", false)
{
}
public override int DPIProfileCount() public override int DPIProfileCount()
{ {
return 4; 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";
}
}
} }

View File

@@ -209,6 +209,7 @@ namespace GHelper.Peripherals
DetectMouse(new PugioII()); DetectMouse(new PugioII());
DetectMouse(new PugioIIWired()); DetectMouse(new PugioIIWired());
DetectMouse(new StrixImpactII()); DetectMouse(new StrixImpactII());
DetectMouse(new StrixImpactIIElectroPunk());
DetectMouse(new Chakram()); DetectMouse(new Chakram());
DetectMouse(new ChakramWired()); DetectMouse(new ChakramWired());
DetectMouse(new ChakramCore()); DetectMouse(new ChakramCore());

View File

@@ -13,7 +13,7 @@ namespace Ryzen
internal class RyzenControl 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 MaxCPUUV = 0;
public const int MinIGPUUV = -20; public const int MinIGPUUV = -20;

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{ {
"sdk": { "sdk": {
"version": "7.0.400" "version": "7.0.406"
} }
} }