Skip to content

Commit

Permalink
Add AGESA version line if available
Browse files Browse the repository at this point in the history
  • Loading branch information
irusanov committed Feb 12, 2025
1 parent a48174a commit fc34983
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 15 deletions.
Binary file modified Common/ZenStates-Core.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions WPF-no-themes/Properties/BuildNumberTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

using System.Reflection;

[assembly: AssemblyVersion("1.33.1592")]
[assembly: AssemblyFileVersion("1.33.1592")]
[assembly: AssemblyVersion("1.33.1599")]
[assembly: AssemblyFileVersion("1.33.1599")]
3 changes: 2 additions & 1 deletion WPF/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<TextBlock x:Name="labelCPU" Text="N/A" Padding="12 5 5 0" />
<TextBlock x:Name="labelMB" Text="N/A" Padding="12 0 5 5" />
<TextBlock x:Name="labelMB" Text="N/A" Padding="12 0 5 0" />
<TextBlock x:Name="labelAgesaVersion" Text="N/A" Padding="12 0 5 5" />
</StackPanel>
<Border Padding="0 0 5 0" Grid.Column="2"
Visibility="{Binding IsRogMotherboard, Mode=OneTime, Converter={StaticResource BoolToVis}}">
Expand Down
26 changes: 18 additions & 8 deletions WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ public MainWindow()

InitializeComponent();
SplashWindow.Loading("Memory modules");
modules = cpu.GetMemoryConfig().Modules;
modules = cpu.GetMemoryConfig()?.Modules ?? new List<MemoryModule>();
ReadMemoryModulesInfo();
SplashWindow.Loading("Timings");

// Read from first enabled DCT
if (modules.Count > 0)
if (modules?.Count > 0)
{
ReadTimings(modules[0].DctOffset);
}
Expand Down Expand Up @@ -232,7 +232,7 @@ private BiosACPIFunction GetFunctionByIdString(string name)

private void ReadMemoryModulesInfo()
{
if (modules.Count > 0)
if (modules?.Count > 0)
{
foreach (MemoryModule module in modules)
{
Expand Down Expand Up @@ -769,7 +769,7 @@ private void PowerCfgTimer_Tick(object sender, EventArgs e)
Dispatcher.Invoke(DispatcherPriority.ApplicationIdle, new Action(() =>
{
int selectedIndex = comboBoxPartNumber?.SelectedIndex ?? 0;
MemoryModule module = modules.Count > 0 ? modules[selectedIndex] : null;
MemoryModule module = modules?.Count > 0 ? modules[selectedIndex] : null;
ReadTimings(module?.DctOffset ?? 0);
ReadMemoryConfig();
cpu.RefreshPowerTable();
Expand Down Expand Up @@ -927,16 +927,25 @@ private void Window_Initialized(object sender, EventArgs e)
}

SetWindowTitle();
if (cpu != null)
if (cpu?.systemInfo != null)
{
labelCPU.Text = GetCpuNameString(cpu.systemInfo);
//string mbLabel = $@"{cpu.systemInfo.MbName} | BIOS {cpu.systemInfo.BiosVersion} | SMU {cpu.systemInfo.GetSmuVersionString()}";

//if (mbLabel.Length > 58)
//{
// mbLabel = $@"{cpu.systemInfo.MbName} | BIOS {cpu.systemInfo.BiosVersion} ({cpu.systemInfo.GetSmuVersionString()})";
//}
labelMB.Text = $@"{cpu.systemInfo.MbName} | BIOS {cpu.systemInfo.BiosVersion} ({cpu.systemInfo.GetSmuVersionString()})";
if (String.IsNullOrEmpty(cpu.systemInfo.AgesaVersion))
{
labelMB.Text = $@"{cpu.systemInfo.MbName} | BIOS {cpu.systemInfo.BiosVersion} ({cpu.systemInfo.GetSmuVersionString()})";
labelAgesaVersion.Visibility = Visibility.Collapsed;
}
else
{
labelMB.Text = $@"{cpu.systemInfo.MbName} | BIOS {cpu.systemInfo.BiosVersion}";
labelAgesaVersion.Text = $"AGESA {cpu.systemInfo.AgesaVersion} (SMU version {cpu.systemInfo.GetSmuVersionString()})";
}
}
//ShowWindow();

Expand Down Expand Up @@ -1077,7 +1086,8 @@ private void ButtonScreenshot_Click(object sender, RoutedEventArgs e)

private void ComboBoxPartNumber_SelectionChanged(object sender, RoutedEventArgs e)
{
if (sender is ComboBox combo) ReadTimings(modules[combo.SelectedIndex].DctOffset);
if (sender is ComboBox combo && combo.Items.Count > 0)
ReadTimings(modules[combo.SelectedIndex].DctOffset);
}

private void SystemInfoToolstripMenuItem_Click(object sender, RoutedEventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions WPF/Properties/BuildNumberTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

using System.Reflection;

[assembly: AssemblyVersion("1.35.1592")]
[assembly: AssemblyFileVersion("1.35.1592")]
[assembly: AssemblyVersion("1.36.1599")]
[assembly: AssemblyFileVersion("1.36.1599")]
4 changes: 2 additions & 2 deletions WPF/Properties/BuildNumberTemplate.tt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

using System.Reflection;

[assembly: AssemblyVersion("1.35.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.35.<#= this.RevisionNumber #>")]
[assembly: AssemblyVersion("1.36.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.36.<#= this.RevisionNumber #>")]
<#+
int RevisionNumber = (int)(DateTime.UtcNow - new DateTime(2020,9,1)).TotalDays;
#>
15 changes: 15 additions & 0 deletions WPF/Windows/DebugDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Globalization;
using System.IO;
using System.Management;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;
using ZenStates.Core;
Expand Down Expand Up @@ -262,6 +263,20 @@ private void Debug()

// AOD Table
AddHeading("ACPI: AOD Table");
var aodAcpiTableHeader = cpu.info.aod.Table.AcpiTable.GetValueOrDefault().Header;
type = aodAcpiTableHeader.GetType();
try
{
foreach (FieldInfo field in type.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public))
{
AddLine($"{field.Name + ":",-19}{field.GetValue(aodAcpiTableHeader)}");
}
}
catch
{
AddLine("<FAILED>");
}

type = cpu.info.aod.Table.GetType();
properties = type.GetProperties();
try
Expand Down

0 comments on commit fc34983

Please sign in to comment.