From 1827450f4b292f3ec24d1ef90fbd7b31c1ddcfc3 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:15:57 +0200 Subject: [PATCH] Restored RGB for GA503RM https://github.com/seerge/g-helper/discussions/1033, limited max power slider for X13 https://github.com/seerge/g-helper/issues/1029 --- app/AppConfig.cs | 8 +++++++- app/AsusACPI.cs | 15 ++++++++++++--- app/AsusUSB.cs | 4 +++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/app/AppConfig.cs b/app/AppConfig.cs index c26e5c86..15acc8cf 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -300,7 +300,7 @@ public static class AppConfig public static bool NoAuraColor() { - return ContainsModel("GA401") || ContainsModel("X13") || ContainsModel("GA503RM"); + return ContainsModel("GA401") || ContainsModel("X13"); } public static bool IsStrix() @@ -318,6 +318,12 @@ public static class AppConfig return ContainsModel("X16") || ContainsModel("X13"); } + public static bool IsX13() + { + return ContainsModel("X13"); + } + + public static bool IsAdvantageEdition() { return ContainsModel("13QY"); diff --git a/app/AsusACPI.cs b/app/AsusACPI.cs index cdf6602a..cf5985d9 100644 --- a/app/AsusACPI.cs +++ b/app/AsusACPI.cs @@ -109,12 +109,13 @@ public class AsusACPI public const int GPUModeStandard = 1; public const int GPUModeUltimate = 2; - public static int MaxTotal => AppConfig.IsAdvantageEdition() ? 250 : 150; public const int MinTotal = 5; - public const int DefaultTotal = 125; - public const int MaxCPU = 100; + public static int MaxTotal = 150; + public static int DefaultTotal = 125; + public const int MinCPU = 5; + public const int MaxCPU = 100; public const int DefaultCPU = 80; public const int MinGPUBoost = 5; @@ -212,6 +213,14 @@ public class AsusACPI throw new Exception("Can't connect to ACPI"); } + if (AppConfig.IsAdvantageEdition()) MaxTotal = 250; + if (AppConfig.IsX13()) + { + MaxTotal = 75; + DefaultTotal = 50; + } + + } public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer) diff --git a/app/AsusUSB.cs b/app/AsusUSB.cs index 1cde6279..866d0466 100644 --- a/app/AsusUSB.cs +++ b/app/AsusUSB.cs @@ -63,6 +63,8 @@ namespace GHelper static bool isTuf = AppConfig.IsTUF(); static bool isStrix = AppConfig.IsStrix(); + static bool isOldHeatmap = AppConfig.Is("old_heatmap"); + static System.Timers.Timer timer = new System.Timers.Timer(2000); static HidDevice? auraDevice = null; @@ -464,7 +466,7 @@ namespace GHelper if (auraDevice is null || !auraDevice.IsConnected) GetAuraDevice(); if (auraDevice is null || !auraDevice.IsConnected) return; - if (isStrix) + if (isStrix && !isOldHeatmap) { byte[] msg = new byte[0x40];