ACPI modes support for Vivobook https://github.com/seerge/g-helper/issues/1089
This commit is contained in:
Serge
2023-08-15 13:59:07 +02:00
parent bd7985e817
commit a985cc5bbb
4 changed files with 27 additions and 4 deletions

View File

@@ -55,7 +55,8 @@ public class AsusACPI
public const uint GPU_Fan = 0x00110014;
public const uint Mid_Fan = 0x00110031;
public const uint PerformanceMode = 0x00120075; // Thermal Control
public const uint PerformanceMode = 0x00120075; // Performance modes
public const uint VivoBookMode = 0x00110019; // Vivobook performance modes
public const uint GPUEco = 0x00090020;
public const uint GPUXGConnected = 0x00090018;

View File

@@ -1,8 +1,19 @@
using System.Runtime.InteropServices;
using System.Collections;
using System.Runtime.InteropServices;
using static GHelper.Display.ScreenInterrogatory;
namespace GHelper.Display
{
class ScreenComparer : IComparer
{
public int Compare(object x, object y)
{
int displayX = Int32.Parse(((Screen)x).DeviceName.Replace(@"\\.\DISPLAY", ""));
int displayY = Int32.Parse(((Screen)y).DeviceName.Replace(@"\\.\DISPLAY", ""));
return (new CaseInsensitiveComparer()).Compare(displayX, displayY);
}
}
internal class ScreenNative
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
@@ -166,6 +177,8 @@ namespace GHelper.Display
count++;
}
Array.Sort(screens, new ScreenComparer());
count = 0;
foreach (var screen in screens)
{

View File

@@ -183,7 +183,6 @@ namespace GHelper
SetKeyCombo(comboFNF4, textFNF4, "paddle");
}
else
{
SetKeyCombo(comboM1, textM1, "m1");
@@ -197,6 +196,10 @@ namespace GHelper
SetKeyCombo(comboFNE, textFNE, "fne");
}
if (AppConfig.IsStrix())
{
labelM4.Text = "M5/ROG";
}
InitTheme();

View File

@@ -70,7 +70,13 @@ namespace GHelper.Mode
Modes.SetCurrent(mode);
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode");
int status = Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode");
// Vivobook fallback
if (status != 1)
{
Program.acpi.DeviceSet(AsusACPI.VivoBookMode, Modes.GetBase(mode), "VivoMode");
}
if (AppConfig.Is("xgm_fan") && Program.acpi.IsXGConnected()) AsusUSB.ResetXGM();