Skip to content

Commit

Permalink
Actually implement the new extra options
Browse files Browse the repository at this point in the history
- Add laptop performance state configuration (different from Windows power plans)

- Add Win/Fn key swap option
  • Loading branch information
Sparronator9999 committed Jul 30, 2024
1 parent 9a89152 commit 3f21884
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 39 deletions.
40 changes: 35 additions & 5 deletions Configs/MSI-GF63-Thin-11SC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,46 @@
<MaxVal>228</MaxVal>
<CurVal>60</CurVal>
</ChargeLimitConf>
<PerfModeConf>
<Reg>210</Reg>
<ModeSel>2</ModeSel>
<PerfModes>
<PerfMode>
<Name>Maximum battery life</Name>
<Desc>Optimises your laptop for maximum battery life.
Limits CPU power draw to 10W.
If set to default fan curve, uses an alternative fan curve.</Desc>
<Value>194</Value>
</PerfMode>
<PerfMode>
<Name>Silent</Name>
<Desc>Reduces the maximum fan speed to 60%.</Desc>
<Value>193</Value>
</PerfMode>
<PerfMode>
<Name>Balanced</Name>
<Desc>Balances battery life and performance.</Desc>
<Value>192</Value>
</PerfMode>
<PerfMode>
<Name>High performance</Name>
<Desc>Optimises your laptop for maximum performance.
Old (pre-alpha) versions of MSI Fan Control/YAMDCC set this setting.</Desc>
<Value>196</Value>
</PerfMode>
</PerfModes>
</PerfModeConf>
<KeySwapConf>
<Reg>232</Reg>
<Enabled>false</Enabled>
<OnVal>16</OnVal>
<OffVal>0</OffVal>
</KeySwapConf>
<RegConfs>
<RegConf>
<Desc>Set fan mode to Advanced. Fixes fans not working at all with certain fan settings.</Desc>
<Reg>212</Reg>
<Value>77</Value>
</RegConf>
<RegConf>
<Desc>Set Performance Level to Turbo. Fixes fan speeds capped at ~60% due to the default setting.</Desc>
<Reg>210</Reg>
<Value>196</Value>
</RegConf>
</RegConfs>
</YAMDCC_Config>
8 changes: 5 additions & 3 deletions Docs/MSI EC Research.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ Controls the performance level of the laptop:

- `0xC4`: Turbo. The `MSI GF63 Thin 11SC.xml` config sets this value when loaded.
- `0xC0`: High
- `0xC1`: Medium (default). Causes maximum fan speeds to be capped at 60%.
- `0xC2`: Low. Causes fan settings set by MSI Fan Control to be ignored,'
and a different default fan curve to be set (not in EC, as far as I know).
- `0xC1`: Medium (default on my machine). Causes maximum fan speeds to be capped at 60% (~3500 RPM).
- `0xC2`: Low:
- Limits CPU power draw to 10W while active (but not the dGPU power draw, funnily enough).
- Modifys some fan settings. This is still being studied, but appears to completely mess up
custom fan curves.

## `0xD3`
Controls the keyboard backlight. The brightness level can be set using
Expand Down
31 changes: 31 additions & 0 deletions YAMDCC.Config/KeySwapConf.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.Xml.Serialization;

namespace YAMDCC.Config
{
public class KeySwapConf
{
/// <summary>
/// The register that controls the Win/Fn key swap state.
/// </summary>
[XmlElement]
public byte Reg;

/// <summary>
/// Is the Win/Fn key swap feature enabled?
/// </summary>
[XmlElement]
public bool Enabled;

/// <summary>
/// The value to turn on Win/Fn key swapping.
/// </summary>
[XmlElement]
public byte OnVal;

/// <summary>
/// The value to turn off Win/Fn key swapping.
/// </summary>
[XmlElement]
public byte OffVal;
}
}
26 changes: 26 additions & 0 deletions YAMDCC.Config/PerfMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Xml.Serialization;

namespace YAMDCC.Config
{
public class PerfMode
{
/// <summary>
/// The name of the performance mode.
/// </summary>
[XmlElement]
public string Name;

/// <summary>
/// The description of the performance mode.
/// </summary>
[XmlElement]
public string Desc;

/// <summary>
/// The value to write to the EC register
/// when this performance mode is selected.
/// </summary>
[XmlElement]
public byte Value;
}
}
26 changes: 26 additions & 0 deletions YAMDCC.Config/PerfModeConf.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Xml.Serialization;

namespace YAMDCC.Config
{
public class PerfModeConf
{
/// <summary>
/// The register that controls the performance mode.
/// </summary>
[XmlElement]
public byte Reg;

/// <summary>
/// The currently selected performance mode, as
/// an index of the available performance modes.
/// </summary>
[XmlElement]
public int ModeSel;

/// <summary>
/// An array of possible performance modes for the laptop.
/// </summary>
[XmlArray]
public PerfMode[] PerfModes;
}
}
12 changes: 12 additions & 0 deletions YAMDCC.Config/YAMDCC_Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ public sealed class YAMDCC_Config
[XmlElement]
public ChargeLimitConf ChargeLimitConf;

/// <summary>
/// The laptop's performance mode config. May be <c>null</c>.
/// </summary>
[XmlElement]
public PerfModeConf PerfModeConf;

/// <summary>
/// The laptop's Win/Fn keyboard swap config. May be <c>null</c>.
/// </summary>
[XmlElement]
public KeySwapConf KeySwapConf;

/// <summary>
/// A list of registers to write when applying a fan config.
/// May be <c>null</c>, but if not <c>null</c>, must have
Expand Down
50 changes: 24 additions & 26 deletions YAMDCC.GUI/MainWindow.Designer.cs

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

Loading

0 comments on commit 3f21884

Please sign in to comment.