mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Overdrive UI Tweaks https://github.com/seerge/g-helper/issues/2497
This commit is contained in:
@@ -416,7 +416,7 @@ public static class AppConfig
|
||||
|
||||
public static bool IsNoOverdrive()
|
||||
{
|
||||
return Is("no_overdrive") || IsOLED();
|
||||
return Is("no_overdrive");
|
||||
}
|
||||
|
||||
public static bool IsNoSleepEvent()
|
||||
|
||||
@@ -167,6 +167,9 @@ public class AsusACPI
|
||||
public const int PCoreMax = 16;
|
||||
public const int ECoreMax = 16;
|
||||
|
||||
private bool? _allAMD = null;
|
||||
private bool? _overdrive = null;
|
||||
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
private static extern IntPtr CreateFile(
|
||||
@@ -636,8 +639,14 @@ public class AsusACPI
|
||||
|
||||
public bool IsAllAmdPPT()
|
||||
{
|
||||
//return false;
|
||||
return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0;
|
||||
if (_allAMD is null) _allAMD = DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0;
|
||||
return (bool)_allAMD;
|
||||
}
|
||||
|
||||
public bool IsOverdriveSupported()
|
||||
{
|
||||
if (_overdrive is null) _overdrive = DeviceGet(ScreenOverdrive) >= 0;
|
||||
return (bool)_overdrive;
|
||||
}
|
||||
|
||||
public bool IsNVidiaGPU()
|
||||
|
||||
@@ -51,10 +51,10 @@ namespace GHelper.Display
|
||||
ScreenNative.SetRefreshRate(laptopScreen, frequency);
|
||||
}
|
||||
|
||||
if (overdrive >= 0)
|
||||
if (Program.acpi.IsOverdriveSupported() && overdrive >= 0)
|
||||
{
|
||||
if (AppConfig.IsNoOverdrive()) overdrive = 0;
|
||||
if (!AppConfig.IsOLED() && overdrive != Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive))
|
||||
if (overdrive != Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive))
|
||||
{
|
||||
Program.acpi.DeviceSet(AsusACPI.ScreenOverdrive, overdrive, "ScreenOverdrive");
|
||||
}
|
||||
@@ -119,7 +119,7 @@ namespace GHelper.Display
|
||||
int maxFrequency = ScreenNative.GetMaxRefreshRate(laptopScreen);
|
||||
|
||||
bool screenAuto = AppConfig.Is("screen_auto");
|
||||
bool overdriveSetting = !AppConfig.IsNoOverdrive();
|
||||
bool overdriveSetting = Program.acpi.IsOverdriveSupported() && !AppConfig.IsNoOverdrive();
|
||||
|
||||
int overdrive = AppConfig.IsNoOverdrive() ? 0 : Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive);
|
||||
|
||||
|
||||
@@ -223,10 +223,7 @@ namespace GHelper
|
||||
checkUSBC.Visible = false;
|
||||
}
|
||||
|
||||
if (AppConfig.IsOLED())
|
||||
{
|
||||
checkNoOverdrive.Visible = false;
|
||||
}
|
||||
checkNoOverdrive.Visible = Program.acpi.IsOverdriveSupported();
|
||||
|
||||
// Change text and hide irrelevant options on the ROG Ally,
|
||||
// which is a bit of a special case piece of hardware.
|
||||
@@ -256,7 +253,6 @@ namespace GHelper
|
||||
checkGpuApps.Visible = false;
|
||||
checkUSBC.Visible = false;
|
||||
checkAutoToggleClamshellMode.Visible = false;
|
||||
checkNoOverdrive.Visible = false;
|
||||
|
||||
int apuMem = Program.acpi.GetAPUMem();
|
||||
if (apuMem >= 0)
|
||||
|
||||
Reference in New Issue
Block a user