This commit is contained in:
Serge
2023-09-13 13:26:35 +02:00
parent 6a6c1f1455
commit dffb239ea7
3 changed files with 33 additions and 12 deletions

View File

@@ -65,6 +65,7 @@ public class AsusACPI
public const uint GPUXG = 0x00090019; public const uint GPUXG = 0x00090019;
public const uint GPUMux = 0x00090016; public const uint GPUMux = 0x00090016;
public const uint GPUMuxVivo = 0x00090026;
public const uint BatteryLimit = 0x00120057; public const uint BatteryLimit = 0x00120057;
public const uint ScreenOverdrive = 0x00050019; public const uint ScreenOverdrive = 0x00050019;

View File

@@ -24,9 +24,13 @@ namespace GHelper.Gpu
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco); int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux); int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
if (mux < 0) mux = Program.acpi.DeviceGet(AsusACPI.GPUMuxVivo);
Logger.WriteLine("Eco flag : " + eco); Logger.WriteLine("Eco flag : " + eco);
Logger.WriteLine("Mux flag : " + mux); Logger.WriteLine("Mux flag : " + mux);
settings.VisualiseGPUButtons(eco >= 0, mux >= 0);
if (mux == 0) if (mux == 0)
{ {
gpuMode = AsusACPI.GPUModeUltimate; gpuMode = AsusACPI.GPUModeUltimate;
@@ -38,9 +42,6 @@ namespace GHelper.Gpu
else else
gpuMode = AsusACPI.GPUModeStandard; gpuMode = AsusACPI.GPUModeStandard;
// Ultimate mode not supported
if (mux != 1) settings.HideUltimateMode();
// GPU mode not supported // GPU mode not supported
if (eco < 0 && mux < 0) if (eco < 0 && mux < 0)
{ {
@@ -73,12 +74,15 @@ namespace GHelper.Gpu
var restart = false; var restart = false;
var changed = false; var changed = false;
int status;
if (CurrentGPU == AsusACPI.GPUModeUltimate) if (CurrentGPU == AsusACPI.GPUModeUltimate)
{ {
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOff, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo); DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOff, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes) if (dialogResult == DialogResult.Yes)
{ {
Program.acpi.DeviceSet(AsusACPI.GPUMux, 1, "GPUMux"); status = Program.acpi.DeviceSet(AsusACPI.GPUMux, 1, "GPUMux");
if (status != 1) Program.acpi.DeviceSet(AsusACPI.GPUMuxVivo, 1, "GPUMuxVivo");
restart = true; restart = true;
changed = true; changed = true;
} }
@@ -93,7 +97,8 @@ namespace GHelper.Gpu
Program.acpi.SetGPUEco(0); Program.acpi.SetGPUEco(0);
Thread.Sleep(100); Thread.Sleep(100);
} }
Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux"); status = Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
if (status != 1) Program.acpi.DeviceSet(AsusACPI.GPUMuxVivo, 0, "GPUMuxVivo");
restart = true; restart = true;
changed = true; changed = true;
} }

View File

@@ -1025,13 +1025,26 @@ namespace GHelper
} }
public void HideUltimateMode() public void VisualiseGPUButtons(bool eco = true, bool ultimate = true)
{ {
tableGPU.Controls.Remove(buttonUltimate); if (!eco)
tablePerf.ColumnCount = 0; {
tableGPU.ColumnCount = 0; menuEco.Visible = buttonEco.Visible = false;
tableScreen.ColumnCount = 0; menuOptimized.Visible = buttonOptimized.Visible = false;
menuUltimate.Visible = false; buttonStopGPU.Visible = true;
tableGPU.ColumnCount = 3;
tableScreen.ColumnCount = 3;
} else
{
buttonStopGPU.Visible = false;
}
if (!ultimate)
{
menuUltimate.Visible = buttonUltimate.Visible = false;
tableGPU.ColumnCount = 3;
tableScreen.ColumnCount = 3;
}
} }
public void HideGPUModes(bool gpuExists) public void HideGPUModes(bool gpuExists)
@@ -1042,15 +1055,17 @@ namespace GHelper
buttonStandard.Visible = false; buttonStandard.Visible = false;
buttonUltimate.Visible = false; buttonUltimate.Visible = false;
buttonOptimized.Visible = false; buttonOptimized.Visible = false;
buttonStopGPU.Visible = true; buttonStopGPU.Visible = true;
tableGPU.ColumnCount = 0;
SetContextMenu(); SetContextMenu();
panelGPU.Visible = gpuExists; panelGPU.Visible = gpuExists;
} }
public void LockGPUModes(string text = null) public void LockGPUModes(string text = null)
{ {
Invoke(delegate Invoke(delegate