From 428b624ec6ae95015f2f564a015269e41c5fc52d Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 9 Feb 2024 15:48:24 +0100 Subject: [PATCH] Anime Matrix hibernate wake-up tweak --- app/AppConfig.cs | 16 ++++++++++++++++ app/AsusACPI.cs | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/AppConfig.cs b/app/AppConfig.cs index 9c68b277c..f9b7fa28a 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -465,6 +465,22 @@ public static bool IsFanScale() } } + public static bool IsSwappedFans() + { + if (!ContainsModel("GA503")) return false; + if (Modes.GetCurrent() != 0) return false; + + try + { + var (bios, model) = GetBiosAndModel(); + return (Int32.Parse(bios) == 317); + } + catch + { + return false; + } + } + public static bool IsFanRequired() { return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P"); diff --git a/app/AsusACPI.cs b/app/AsusACPI.cs index 7430cb6e9..36df33eb5 100644 --- a/app/AsusACPI.cs +++ b/app/AsusACPI.cs @@ -477,7 +477,11 @@ public int SetFanCurve(AsusFan device, byte[] curve) if (fanScale != 100 && device == AsusFan.CPU) Logger.WriteLine("Custom fan scale: " + fanScale); - // it seems to be a bug, when some old model's bios can go nuts if fan is set to 100% + if (AppConfig.IsSwappedFans()) + { + device = (device == AsusFan.CPU) ? AsusFan.GPU : AsusFan.CPU; + Logger.WriteLine("Swapped fan fix"); + } for (int i = 8; i < curve.Length; i++) curve[i] = (byte)(Math.Max((byte)0, Math.Min((byte)100, curve[i])) * fanScale / 100);