P-cores fix

This commit is contained in:
Serge
2024-02-25 19:55:39 +01:00
parent b644402155
commit 6d696c5c77
2 changed files with 4 additions and 2 deletions

View File

@@ -686,7 +686,7 @@ public class AsusACPI
public (int, int) GetCores(bool max = false) public (int, int) GetCores(bool max = false)
{ {
int value = Program.acpi.DeviceGet(max ? CORES_MAX : CORES_CPU); int value = Program.acpi.DeviceGet(max ? CORES_MAX : CORES_CPU);
//value = max ? 0x806 : 0x605; //value = max ? 0x406 : 0x605;
if (value < 0) return (-1, -1); if (value < 0) return (-1, -1);
Logger.WriteLine("Cores" + (max ? "Max" : "") + ": 0x" + value.ToString("X4")); Logger.WriteLine("Cores" + (max ? "Max" : "") + ": 0x" + value.ToString("X4"));

View File

@@ -414,6 +414,8 @@ namespace GHelper
return; return;
} }
eCoresMax = Math.Max(8, eCoresMax);
panelCores.Visible = true; panelCores.Visible = true;
comboCoresE.DropDownStyle = ComboBoxStyle.DropDownList; comboCoresE.DropDownStyle = ComboBoxStyle.DropDownList;
@@ -431,11 +433,11 @@ namespace GHelper
private void ButtonCores_Click(object? sender, EventArgs e) private void ButtonCores_Click(object? sender, EventArgs e)
{ {
Program.acpi.SetCores(AsusACPI.ECoreMin + comboCoresE.SelectedIndex, AsusACPI.PCoreMin + comboCoresP.SelectedIndex);
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertAPUMemoryRestart, Properties.Strings.AlertAPUMemoryRestartTitle, MessageBoxButtons.YesNo); DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertAPUMemoryRestart, Properties.Strings.AlertAPUMemoryRestartTitle, MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes) if (dialogResult == DialogResult.Yes)
{ {
Program.acpi.SetCores(comboCoresE.SelectedIndex, comboCoresP.SelectedIndex);
Process.Start("shutdown", "/r /t 1"); Process.Start("shutdown", "/r /t 1");
} }
} }