Skip to content

Commit

Permalink
Debug button
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Feb 15, 2024
1 parent e98cd2f commit 60c4e08
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
24 changes: 17 additions & 7 deletions app/AsusACPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -665,22 +665,32 @@ public int GetAPUMem()
}
}

public void ScanRange()
public string ScanRange()
{
int value;
string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
string logFile = appPath + "\\scan.txt";
for (uint i = 0x00000000; i <= 0x00160000; i++)
using (StreamWriter w = File.AppendText(logFile))
{
value = DeviceGet(i);
if (value >= 0)
using (StreamWriter w = File.AppendText(logFile))
w.WriteLine($"Scan started {DateTime.Now}");
for (uint i = 0x00000000; i <= 0x00160000; i += 0x10000)
{
for (uint j = 0x00; j <= 0xFF; j++)
{
w.WriteLine(i.ToString("X8") + ": " + value.ToString("X4") + " (" + value + ")");
w.Close();
uint id = i + j;
value = DeviceGet(id);
if (value >= 0)
{
w.WriteLine(id.ToString("X8") + ": " + value.ToString("X4") + " (" + value + ")");
}
}
}
w.WriteLine($"---------------------");
w.Close();
}

return logFile;

}

public void TUFKeyboardBrightness(int brightness)
Expand Down
19 changes: 19 additions & 0 deletions app/Extra.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions app/Extra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ public Extra()
buttonServices.Click += ButtonServices_Click;

pictureLog.Click += PictureLog_Click;
pictureScan.Click += PictureScan_Click;

checkGPUFix.Visible = Program.acpi.IsNVidiaGPU();
checkGPUFix.Checked = AppConfig.IsGPUFix();
Expand All @@ -398,6 +399,18 @@ public Extra()
InitHibernate();
}

private void PictureScan_Click(object? sender, EventArgs e)
{
string logFile = Program.acpi.ScanRange();
new Process
{
StartInfo = new ProcessStartInfo(logFile)
{
UseShellExecute = true
}
}.Start();
}

private void ComboAPU_SelectedIndexChanged(object? sender, EventArgs e)
{
int mem = comboAPU.SelectedIndex;
Expand Down

0 comments on commit 60c4e08

Please sign in to comment.