Skip to content

Commit

Permalink
Add manual overclock switch, FID and VID.
Browse files Browse the repository at this point in the history
  • Loading branch information
irusanov committed Aug 31, 2019
1 parent 89e2624 commit c2ad89a
Show file tree
Hide file tree
Showing 16 changed files with 2,157 additions and 899 deletions.
16 changes: 15 additions & 1 deletion AsusZenStates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<RunCodeAnalysis>False</RunCodeAnalysis>
<SourceAnalysisOverrideSettingsFile>C:\Users\Jon\AppData\Roaming\ICSharpCode/SharpDevelop4\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>ZenStates.ico</ApplicationIcon>
<ApplicationIcon>Resources\ZenStates.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -106,6 +106,11 @@
<Compile Include="DataInterface.cs" />
<Compile Include="NotificationIcon.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
Expand All @@ -116,9 +121,15 @@
<ItemGroup>
<EmbeddedResource Include="NotificationIcon.resx">
<DependentUpon>NotificationIcon.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="SettingsForm.resx">
<DependentUpon>SettingsForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
Expand All @@ -132,5 +143,8 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="Resources\ZenStates.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
27 changes: 19 additions & 8 deletions AsusZsSrv/AsusZsSrv.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using AsusZenStates;
using AsusZenStates;
using Microsoft.Win32;
using System;
using System.Collections.Specialized;
Expand Down Expand Up @@ -187,6 +187,9 @@ private static void t1Handler(object source, ElapsedEventArgs e)
if ((CLIENT_FLAGS & DataInterface.FLAG_CPB) == 0) cpuh.ZenCorePerfBoost = false;
else cpuh.ZenCorePerfBoost = true;

if ((CLIENT_FLAGS & DataInterface.FLAG_OC) == 0) cpuh.ZenOc = false;
else cpuh.ZenOc = true;

// XFR2
cpuh.ZenPPT = (int)di.MemRead(DataInterface.REG_PPT);
cpuh.ZenTDC = (int)di.MemRead(DataInterface.REG_TDC);
Expand All @@ -200,19 +203,21 @@ private static void t1Handler(object source, ElapsedEventArgs e)
SetStartupService(true);
SetStartupGUI(cpuh.TrayIconAtStart);

cpuh.SetOcMode(cpuh.ZenOc);
// Write new P-states
for (int i = 0; i < CPUHandler.NumPstates; i++)
{
cpuh.WritePstate(i, di.MemRead(DataInterface.REG_P0 + i));
}
cpuh.setOverclockFrequencyAllCores(0, di.MemRead(DataInterface.REG_P0));

cpuh.SetC6Core(cpuh.ZenC6Core);
cpuh.SetC6Package(cpuh.ZenC6Package);
cpuh.SetCpb(cpuh.ZenCorePerfBoost);

cpuh.SetPPT(cpuh.ZenPPT);
/*cpuh.SetPPT(cpuh.ZenPPT);
cpuh.SetTDC(cpuh.ZenTDC);
cpuh.SetEDC(cpuh.ZenEDC);
cpuh.SetEDC(cpuh.ZenEDC);*/
cpuh.SetScalar(cpuh.ZenScalar);

cpuh.SetPerfBias(cpuh.PerformanceBias);
Expand All @@ -231,19 +236,21 @@ private static void t1Handler(object source, ElapsedEventArgs e)

P80Temp = cpuh.P80Temp;

cpuh.SetOcMode(cpuh.ZenOc);
// Write new P-states
for (int i = 0; i < CPUHandler.NumPstates; i++)
{
cpuh.WritePstate(i, cpuh.Pstate[i]);
}
cpuh.setOverclockFrequencyAllCores(0, cpuh.Pstate[0]);

cpuh.SetC6Core(cpuh.ZenC6Core);
cpuh.SetC6Package(cpuh.ZenC6Package);
cpuh.SetCpb(cpuh.ZenCorePerfBoost);

cpuh.SetPPT(cpuh.ZenPPT);
/*cpuh.SetPPT(cpuh.ZenPPT);
cpuh.SetTDC(cpuh.ZenTDC);
cpuh.SetEDC(cpuh.ZenEDC);
cpuh.SetEDC(cpuh.ZenEDC);*/
cpuh.SetScalar(cpuh.ZenScalar);

cpuh.SetPerfBias(cpuh.PerformanceBias);
Expand Down Expand Up @@ -301,7 +308,6 @@ private static void t1Handler(object source, ElapsedEventArgs e)

// Update server flags
SetServerFlags();

}

protected override bool OnPowerEvent(PowerBroadcastStatus powerStatus)
Expand All @@ -313,12 +319,16 @@ protected override bool OnPowerEvent(PowerBroadcastStatus powerStatus)

if (!cpuh.ShutdownUnclean)
{
cpuh.SetOcMode(cpuh.ZenOc);

// Write P-states
for (int i = 0; i < CPUHandler.NumPstates; i++)
{
cpuh.WritePstate(i, cpuh.Pstate[i]);
}

cpuh.setOverclockFrequencyAllCores(0, cpuh.Pstate[0]);

// Write C-states
cpuh.SetC6Core(cpuh.ZenC6Core);
cpuh.SetC6Package(cpuh.ZenC6Package);
Expand All @@ -327,9 +337,9 @@ protected override bool OnPowerEvent(PowerBroadcastStatus powerStatus)
// Perf bias
cpuh.SetPerfBias(cpuh.PerformanceBias);

cpuh.SetPPT(cpuh.ZenPPT);
/*cpuh.SetPPT(cpuh.ZenPPT);
cpuh.SetTDC(cpuh.ZenTDC);
cpuh.SetEDC(cpuh.ZenEDC);
cpuh.SetEDC(cpuh.ZenEDC);*/
cpuh.SetScalar(cpuh.ZenScalar);
}

Expand Down Expand Up @@ -391,6 +401,7 @@ static void SetServerFlags()
if (cpuh.ZenC6Core) server_flags |= DataInterface.FLAG_C6CORE;
if (cpuh.ZenC6Package) server_flags |= DataInterface.FLAG_C6PACKAGE;
if (cpuh.ZenCorePerfBoost) server_flags |= DataInterface.FLAG_CPB;
if (cpuh.ZenOc) server_flags |= DataInterface.FLAG_OC;

di.MemWrite(DataInterface.REG_SERVER_FLAGS, server_flags);
}
Expand Down
5 changes: 4 additions & 1 deletion AsusZsSrv/AsusZsSrv.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<AssemblyName>AsusZsSrv</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<NoWin32Manifest>False</NoWin32Manifest>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
Expand Down Expand Up @@ -67,6 +66,10 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>
</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
Expand Down
Loading

0 comments on commit c2ad89a

Please sign in to comment.