Skip to content

Commit

Permalink
Update core DLL to v 1.6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
irusanov committed Nov 22, 2023
1 parent b960a65 commit 780f965
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 91 deletions.
Binary file modified Common/ZenStates-Core.dll
Binary file not shown.
103 changes: 51 additions & 52 deletions WPF-no-themes/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,63 +397,62 @@ private void ReadMemoryConfig()

if (MEMCFG.Type == MemType.DDR4)
{

// Get APCB config from BIOS. Holds memory parameters.
BiosACPIFunction cmd = GetFunctionByIdString("Get APCB Config");
if (cmd == null)
// Get APCB config from BIOS. Holds memory parameters.
BiosACPIFunction cmd = GetFunctionByIdString("Get APCB Config");
if (cmd == null)
{
// throw new Exception("Could not get memory controller config");
// Use AOD table as an alternative path for now
BMC.Table = cpu.info.aod.Table.rawAodTable;
BMC.Table = cpu.info.aod.Table.RawAodTable;
}
else
{
byte[] apcbConfig = WMI.RunCommand(classInstance, cmd.ID);
// BiosACPIFunction cmd = new BiosACPIFunction("Get APCB Config", 0x00010001);
cmd = GetFunctionByIdString("Get memory voltages");
if (cmd != null)
{
cmd = GetFunctionByIdString("Get memory voltages");
if (cmd != null)
{
byte[] voltages = WMI.RunCommand(classInstance, cmd.ID);

// MEM_VDDIO is ushort, offset 27
// MEM_VTT is ushort, offset 29
// MEM_VDDIO is ushort, offset 27
// MEM_VTT is ushort, offset 29
for (int i = 27; i <= 30; i++)
{
{
byte value = voltages[i];
if (value > 0)
apcbConfig[i] = value;
}
}
if (value > 0)
apcbConfig[i] = value;
}
}

BMC.Table = apcbConfig ?? new byte[] { };
}

float vdimm = Convert.ToSingle(Convert.ToDecimal(BMC.Config.MemVddio) / 1000);
if (vdimm > 0 && vdimm < 3)
{
textBoxMemVddio.Text = $"{vdimm:F4}V";
}
else if (AsusWmi != null && AsusWmi.Status == 1)
{
AsusSensorInfo sensor = AsusWmi.FindSensorByName("DRAM Voltage");
float temp = 0;
bool valid = sensor != null && float.TryParse(sensor.Value, out temp);
if (vdimm > 0 && vdimm < 3)
{
textBoxMemVddio.Text = $"{vdimm:F4}V";
}
else if (AsusWmi != null && AsusWmi.Status == 1)
{
AsusSensorInfo sensor = AsusWmi.FindSensorByName("DRAM Voltage");
float temp = 0;
bool valid = sensor != null && float.TryParse(sensor.Value, out temp);

if (valid && temp > 0 && temp < 3)
textBoxMemVddio.Text = sensor.Value;
if (valid && temp > 0 && temp < 3)
textBoxMemVddio.Text = sensor.Value;
else
labelMemVddio.IsEnabled = false;
}
else
{
labelMemVddio.IsEnabled = false;
}
else
{
labelMemVddio.IsEnabled = false;
}
}

float vtt = Convert.ToSingle(Convert.ToDecimal(BMC.Config.MemVtt) / 1000);
if (vtt > 0)
textBoxMemVtt.Text = $"{vtt:F4}V";
else
labelMemVtt.IsEnabled = false;
if (vtt > 0)
textBoxMemVtt.Text = $"{vtt:F4}V";
else
labelMemVtt.IsEnabled = false;

// When ProcODT is 0, then all other resistance values are 0
// Happens when one DIMM installed in A1 or A2 slot
Expand All @@ -472,27 +471,27 @@ private void ReadMemoryConfig()
labelAddrCmdSetup.IsEnabled = true;
labelCsOdtSetup.IsEnabled = true;
labelCkeSetup.IsEnabled = true;
textBoxProcODT.Text = BMC.GetProcODTString(BMC.Config.ProcODT);
textBoxProcODT.Text = BMC.GetProcODTString(BMC.Config.ProcODT);

textBoxClkDrvStren.Text = BMC.GetDrvStrenString(BMC.Config.ClkDrvStren);
textBoxAddrCmdDrvStren.Text = BMC.GetDrvStrenString(BMC.Config.AddrCmdDrvStren);
textBoxCsOdtCmdDrvStren.Text = BMC.GetDrvStrenString(BMC.Config.CsOdtCmdDrvStren);
textBoxCkeDrvStren.Text = BMC.GetDrvStrenString(BMC.Config.CkeDrvStren);
textBoxClkDrvStren.Text = BMC.GetDrvStrenString(BMC.Config.ClkDrvStren);
textBoxAddrCmdDrvStren.Text = BMC.GetDrvStrenString(BMC.Config.AddrCmdDrvStren);
textBoxCsOdtCmdDrvStren.Text = BMC.GetDrvStrenString(BMC.Config.CsOdtCmdDrvStren);
textBoxCkeDrvStren.Text = BMC.GetDrvStrenString(BMC.Config.CkeDrvStren);

textBoxRttNom.Text = BMC.GetRttString(BMC.Config.RttNom);
textBoxRttWr.Text = BMC.GetRttWrString(BMC.Config.RttWr);
textBoxRttPark.Text = BMC.GetRttString(BMC.Config.RttPark);
textBoxRttNom.Text = BMC.GetRttString(BMC.Config.RttNom);
textBoxRttWr.Text = BMC.GetRttWrString(BMC.Config.RttWr);
textBoxRttPark.Text = BMC.GetRttString(BMC.Config.RttPark);

textBoxAddrCmdSetup.Text = $"{BMC.Config.AddrCmdSetup}";
textBoxCsOdtSetup.Text = $"{BMC.Config.CsOdtSetup}";
textBoxCkeSetup.Text = $"{BMC.Config.CkeSetup}";
}
textBoxAddrCmdSetup.Text = $"{BMC.Config.AddrCmdSetup}";
textBoxCsOdtSetup.Text = $"{BMC.Config.CsOdtSetup}";
textBoxCkeSetup.Text = $"{BMC.Config.CkeSetup}";
}
else
{
if (Utils.AllZero(cpu.info.aod.Table.rawAodTable))
if (Utils.AllZero(cpu.info.aod.Table.RawAodTable))
return;

AOD.AodData Data = cpu.info.aod.Table.Data;
AodData Data = cpu.info.aod.Table.Data;

labelMemVdd.IsEnabled = true;
labelMemVddq.IsEnabled = true;
Expand Down Expand Up @@ -893,9 +892,9 @@ private void Window_Initialized(object sender, EventArgs e)
SetWindowTitle();
if (cpu != null)
{
labelCPU.Text = cpu.systemInfo.CpuName;
labelMB.Text =
$"{cpu.systemInfo.MbName} | BIOS {cpu.systemInfo.BiosVersion} | SMU {cpu.systemInfo.GetSmuVersionString()}";
labelCPU.Text = cpu.systemInfo.CpuName;
labelMB.Text =
$"{cpu.systemInfo.MbName} | BIOS {cpu.systemInfo.BiosVersion} | SMU {cpu.systemInfo.GetSmuVersionString()}";
}
//ShowWindow();

Expand Down
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.30.1173")]
[assembly: AssemblyFileVersion("1.30.1173")]
[assembly: AssemblyVersion("1.30.1177")]
[assembly: AssemblyFileVersion("1.30.1177")]
44 changes: 22 additions & 22 deletions WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,24 @@ public MainWindow()
MessageBoxImage.Warning
);
}
/* else if (cpu.info.codeName.Equals(Cpu.CodeName.Rembrandt) && !settings.NotifiedRembrandt.Equals(AssemblyVersion))
{
MessageBox.Show(
"DDR5 support is experimental and Advanced mode is not supported yet."
+ Environment.NewLine
+ Environment.NewLine
+ "You can still enable it in Tools -> Options, but it will most probably fail."
+ Environment.NewLine
+ Environment.NewLine
+ "If you're not able to turn off the Advanced mode from the UI, edit settings.xml manually and set AdvancedMode to 'false'. "
+ "You can also delete settings.xml file and it will be regenerated on next application launch.",
"Limited Support",
MessageBoxButton.OK,
MessageBoxImage.Information);
settings.AdvancedMode = false;
settings.NotifiedRembrandt = AssemblyVersion;
settings.Save();
}*/
/* else if (cpu.info.codeName.Equals(Cpu.CodeName.Rembrandt) && !settings.NotifiedRembrandt.Equals(AssemblyVersion))
{
MessageBox.Show(
"DDR5 support is experimental and Advanced mode is not supported yet."
+ Environment.NewLine
+ Environment.NewLine
+ "You can still enable it in Tools -> Options, but it will most probably fail."
+ Environment.NewLine
+ Environment.NewLine
+ "If you're not able to turn off the Advanced mode from the UI, edit settings.xml manually and set AdvancedMode to 'false'. "
+ "You can also delete settings.xml file and it will be regenerated on next application launch.",
"Limited Support",
MessageBoxButton.OK,
MessageBoxImage.Information);
settings.AdvancedMode = false;
settings.NotifiedRembrandt = AssemblyVersion;
settings.Save();
}*/

IconSource = GetIcon("pack://application:,,,/ZenTimings;component/Resources/ZenTimings2022.ico", 16);
_notifyIcon = GetTrayIcon();
Expand Down Expand Up @@ -431,7 +431,7 @@ private void ReadMemoryConfig()
{
// throw new Exception("Could not get memory controller config");
// Use AOD table as an alternative path for now
BMC.Table = cpu.info.aod.Table.rawAodTable;
BMC.Table = cpu.info.aod.Table.RawAodTable;
}
else
{
Expand Down Expand Up @@ -517,10 +517,10 @@ private void ReadMemoryConfig()
}
else
{
if (cpu.info.aod == null || Utils.AllZero(cpu.info.aod.Table.rawAodTable))
if (cpu.info.aod == null || Utils.AllZero(cpu.info.aod.Table.RawAodTable))
return;

AOD.AodData Data = cpu.info.aod.Table.Data;
AodData Data = cpu.info.aod.Table.Data;

labelMemVdd.IsEnabled = true;
labelMemVddq.IsEnabled = true;
Expand Down Expand Up @@ -750,7 +750,7 @@ private bool WaitForPowerTable()
{
if (cpu.powerTable == null || cpu.powerTable.DramBaseAddress == 0)
{
HandleError("Could not initialize power table.\nClose the application and try again.");
HandleError("Could not initialize power table.\n\nClose the application and try again. If the issue persists, you might want to try a system restart.");
return false;
}

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.30.1173")]
[assembly: AssemblyFileVersion("1.30.1173")]
[assembly: AssemblyVersion("1.30.1177")]
[assembly: AssemblyFileVersion("1.30.1177")]
17 changes: 7 additions & 10 deletions WPF/Windows/Changelog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,14 @@
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Margin="15" Grid.ColumnSpan="2">
<!-- TextBlock Text="Changelog" FontSize="14" FontWeight="Bold" Style="{DynamicResource ValueStyles}" Height="auto" HorizontalAlignment="Left" /-->
<TextBlock Text="v1.2.9 Dec 21, 2022" FontSize="13" Style="{DynamicResource ValueStyles}" Height="auto" HorizontalAlignment="Left" />
<TextBlock Text="v1.30 Nov 22, 2023" FontSize="13" Style="{DynamicResource ValueStyles}" Height="auto" HorizontalAlignment="Left" />
<TextBlock Text="" />
<TextBlock Text=" - Fixed DRAM speed string syncronization with MCLK" />
<StackPanel Orientation="Horizontal">
<TextBlock Text=" - Added a workaround for false-postives, see github " />
<TextBlock>
<Hyperlink NavigateUri="https://github.com/irusanov/ZenTimings/issues/33" RequestNavigate="Hyperlink_RequestNavigate">
<Run Text="issue 33" />
</Hyperlink>
</TextBlock>
</StackPanel>
<TextBlock Text=" - Enhanced compatibility with StormPeak and Genoa, offering partial support." />
<TextBlock Text=" - Introduced initial support for Mendocino and Phoenix." />
<TextBlock Text=" - Optimized the refresh process for power management tables, enhancing efficiency." />
<TextBlock Text=" - Improved support for Dali cores." />
<TextBlock Text=" - Addressed and fixed issues with the PM table of Picasso." />
<TextBlock Text=" - Simplified the versioning scheme for better clarity." />
<TextBlock Text="" />
<StackPanel Orientation="Horizontal">
<Image Source="/Resources/warning-icon.png" Width="16" VerticalAlignment="Top" />
Expand Down
4 changes: 2 additions & 2 deletions WPF/Windows/DebugDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ private void Debug()
AddHeading("ACPI: Raw AOD Table");
try
{
for (var i = 0; i < CPU.info.aod.Table.rawAodTable.Length; ++i)
AddLine($"Index {i:D3}: {CPU.info.aod.Table.rawAodTable[i]:X2} ({CPU.info.aod.Table.rawAodTable[i]})");
for (var i = 0; i < CPU.info.aod.Table.RawAodTable.Length; ++i)
AddLine($"Index {i:D3}: {CPU.info.aod.Table.RawAodTable[i]:X2} ({CPU.info.aod.Table.RawAodTable[i]})");
}
catch
{
Expand Down
2 changes: 1 addition & 1 deletion WPF/Windows/SystemInfoWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private class GridItem
public string Value { get; set; }
}

public SystemInfoWindow(SystemInfo si, MemoryConfig mc, Resistances mcConfig, AOD.AodData aodData, List<AsusSensorInfo> asusSensors)
public SystemInfoWindow(SystemInfo si, MemoryConfig mc, Resistances mcConfig, AodData aodData, List<AsusSensorInfo> asusSensors)
{
InitializeComponent();
Type type = si.GetType();
Expand Down

0 comments on commit 780f965

Please sign in to comment.