Compare commits

...

23 Commits

Author SHA1 Message Date
Serge
27cd55bd4c Merge branch 'main' into srgb 2024-03-05 15:31:12 +01:00
Serge
aeef62afa4 sRGB and Custom gammas support 2024-03-05 15:21:26 +01:00
Serge
6dcfff704e Sleep hotkey for TUF devices 2024-03-05 14:49:27 +01:00
Serge
abc9acd3a8 UV Cleanup 2024-03-05 12:27:06 +01:00
Serge
53d7382417 Set GPU Clocks earlier 2024-03-05 01:17:40 +01:00
Serge
64f4572113 UI tweaks 2024-03-05 00:31:25 +01:00
Serge
8ab1f1fc81 Workaround for bugged BIOS on G14 2024 2024-03-05 00:08:46 +01:00
IceStormNG
251d32e115 Mouse fixes (#2159)
* Support for Strix Carry (P508)

* Fixes polling rate, angle snapping and debounce for Gladius II Origin.

* The Gen2 version of the TuF M3 uses 0-100 for brightness.

* Adds support for ROG Strix Impact III (P518)

* Import/Export feature for mice.

* Suppor for Strix Impact (P303)

* Support for Strix Impact II Electro Punk

* Strix Carry has 50 DPI minimum and increments of 50.
2024-03-03 17:15:40 +01:00
Serge
947e32b97c GPU Power slider fix 2024-03-03 10:24:33 +01:00
Serge
091303d90f Swapped fan curves workaround https://github.com/seerge/g-helper/issues/2155 2024-03-03 10:19:00 +01:00
Serge
c8b929310a Zenbook fn-lock https://github.com/seerge/g-helper/issues/2154 2024-03-03 10:17:25 +01:00
Serge
c32fa46991 Added 100ms delay before setting fan curves 2024-03-02 13:41:57 +01:00
Serge
b94e20a3fc Power limits cleanup 2024-03-02 12:35:47 +01:00
Serge
2d0defd484 Power limits cleanup 2024-03-02 12:00:37 +01:00
Serge
6f49af19ed Cleanup 2024-03-02 11:25:11 +01:00
Serge
097d91b5a4 Cleanup 2024-03-02 11:23:22 +01:00
Serge
f36a55f086 Reapply brightness on display config change 2024-03-01 23:19:44 +01:00
Serge
c1a6019d57 Increased Fan calibration limit https://github.com/seerge/g-helper/issues/2145 2024-03-01 19:57:10 +01:00
Serge
63b357a71b GPU Power slider limits 2024-03-01 12:38:48 +01:00
Serge
c337103806 Merge branch 'main' of https://github.com/seerge/g-helper 2024-03-01 12:32:43 +01:00
Serge
268e55d47a UI Tweaks 2024-03-01 12:32:41 +01:00
Serge
3cc4955dd7 GPU Power limit slider for 2024 models (#2142)
* GPU TGP setting for supported models

* Version bump

* GPU Power tweaks

* GPU Power UI Tweaks

* Cleanup
2024-03-01 11:09:30 +01:00
Serge
db8e4b9c5e New translations strings.resx (German) (#2139) 2024-02-29 10:00:42 +01:00
24 changed files with 1929 additions and 1336 deletions

View File

@@ -365,9 +365,9 @@ public static class AppConfig
return ContainsModel("ProArt"); return ContainsModel("ProArt");
} }
public static bool IsVivobook() public static bool IsVivoZenbook()
{ {
return ContainsModel("Vivobook"); return ContainsModel("Vivobook") || ContainsModel("Zenbook");
} }
// Devices with bugged bios command to change brightness // Devices with bugged bios command to change brightness
@@ -514,7 +514,7 @@ public static class AppConfig
try try
{ {
var (bios, model) = GetBiosAndModel(); var (bios, model) = GetBiosAndModel();
return (Int32.Parse(bios) == 317); return (Int32.Parse(bios) == 317 || Int32.Parse(bios) == 316);
} }
catch catch
{ {
@@ -522,9 +522,19 @@ public static class AppConfig
} }
} }
public static bool IsResetRequired()
{
return ContainsModel("GA403");
}
public static bool IsFanRequired() public static bool IsFanRequired()
{ {
return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P"); return ContainsModel("GA402X") || ContainsModel("G513") || ContainsModel("G713R") || ContainsModel("G713P") || ContainsModel("GU605") || ContainsModel("GA403");
}
public static bool IsAMDLight()
{
return ContainsModel("GA402X") || ContainsModel("GU605") || ContainsModel("GA403") || ContainsModel("FA507N") || ContainsModel("FA507X") || ContainsModel("FA707N") || ContainsModel("FA707X");
} }
public static bool IsPowerRequired() public static bool IsPowerRequired()

View File

@@ -105,6 +105,9 @@ public class AsusACPI
public const uint CORES_CPU = 0x001200D2; // Intel E-core and P-core configuration in a format 0x0[E]0[P] public const uint CORES_CPU = 0x001200D2; // Intel E-core and P-core configuration in a format 0x0[E]0[P]
public const uint CORES_MAX = 0x001200D3; // Maximum Intel E-core and P-core availability public const uint CORES_MAX = 0x001200D3; // Maximum Intel E-core and P-core availability
public const uint GPU_BASE = 0x00120099; // Base part GPU TGP
public const uint GPU_POWER = 0x00120098; // Additonal part of GPU TGP
public const int APU_MEM = 0x000600C1; public const int APU_MEM = 0x000600C1;
public const int TUF_KB_BRIGHTNESS = 0x00050021; public const int TUF_KB_BRIGHTNESS = 0x00050021;
@@ -150,6 +153,9 @@ public class AsusACPI
public const int MinGPUBoost = 5; public const int MinGPUBoost = 5;
public static int MaxGPUBoost = 25; public static int MaxGPUBoost = 25;
public static int MinGPUPower = 0;
public static int MaxGPUPower = 50;
public const int MinGPUTemp = 75; public const int MinGPUTemp = 75;
public const int MaxGPUTemp = 87; public const int MaxGPUTemp = 87;
@@ -285,6 +291,12 @@ public class AsusACPI
if (AppConfig.IsIntelHX()) if (AppConfig.IsIntelHX())
{ {
MaxTotal = 175; MaxTotal = 175;
MaxGPUPower = 70;
}
if (AppConfig.IsSlash())
{
MaxGPUPower = 25;
} }
if (AppConfig.DynamicBoost5()) if (AppConfig.DynamicBoost5())
@@ -296,6 +308,14 @@ public class AsusACPI
{ {
MaxGPUBoost = 15; MaxGPUBoost = 15;
} }
if (AppConfig.IsAMDLight())
{
MaxTotal = 90;
}
} }
public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer) public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
@@ -409,9 +429,16 @@ public class AsusACPI
{ {
return null; return null;
} }
} }
public int SetVivoMode(int mode)
{
if (mode == 1) mode = 2;
else if (mode == 2) mode = 1;
return Program.acpi.DeviceSet(VivoBookMode, mode, "VivoMode");
}
public int SetGPUEco(int eco) public int SetGPUEco(int eco)
{ {
int ecoFlag = DeviceGet(GPUEco); int ecoFlag = DeviceGet(GPUEco);
@@ -542,7 +569,7 @@ public class AsusACPI
break; break;
} }
Logger.WriteLine($"GetFan {device} :" + BitConverter.ToString(result)); //Logger.WriteLine($"GetFan {device} :" + BitConverter.ToString(result));
return result; return result;

1202
app/Display/CCD.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,56 @@
using System.Runtime.InteropServices; using System.Diagnostics;
namespace GHelper.Display namespace GHelper.Display
{ {
enum VisualMode
{
Default,
Racing,
Scenery,
RPG,
FPS,
Cinema,
Eyecare,
Vivid
}
public class ScreenControl public class ScreenControl
{ {
public const int MAX_REFRESH = 1000; public const int MAX_REFRESH = 1000;
public static int activeProfile = 0;
public static DisplayGammaRamp? gammaRamp; public static DisplayGammaRamp? gammaRamp;
private GammaRamp GetGamma(VisualMode mode)
{
ushort[] GammaR, GammaG, GammaB;
switch (mode)
{
case VisualMode.Racing:
GammaR = new ushort[] { 0, 256, 512, 768, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3584, 3840, 4096, 4352, 4608, 4864, 5120, 5376, 5888, 6144, 6400, 6656, 6912, 7168, 7424, 7680, 8192, 8448, 8704, 8960, 9216, 9472, 9728, 9984, 10240, 10496, 10496, 10752, 11008, 11264, 11520, 11776, 12032, 12288, 12544, 12800, 13056, 13056, 13312, 13568, 13824, 14080, 14336, 14592, 14848, 15104, 15360, 15360, 15616, 15872, 16128, 16384, 16640, 16896, 17152, 17408, 17664, 17920, 18176, 18432, 18688, 18688, 18944, 19200, 19456, 19712, 19968, 20224, 20480, 20736, 20992, 21248, 21504, 21760, 22016, 22272, 22528, 22528, 22784, 23040, 23296, 23552, 23808, 24064, 24320, 24576, 24832, 25088, 25344, 25600, 25856, 26112, 26368, 26368, 26624, 26880, 27136, 27392, 27648, 27904, 28160, 28416, 28672, 28928, 29184, 29440, 29696, 29952, 30208, 30208, 30464, 30720, 30976, 31232, 31488, 31744, 32000, 32256, 32512, 32768, 33024, 33280, 33536, 33792, 34048, 34304, 34560, 34816, 35072, 35328, 35584, 35840, 36096, 36352, 36608, 36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39680, 39936, 40192, 40448, 40704, 40960, 41216, 41472, 41728, 41984, 42240, 42496, 42752, 43008, 43264, 43520, 43776, 44032, 44288, 44544, 44800, 45056, 45312, 45568, 45824, 46080, 46336, 46592, 46848, 47104, 47360, 47616, 47872, 48128, 48384, 48640, 48896, 49152, 49408, 49664, 49920, 50176, 50432, 50688, 50944, 51200, 51456, 51712, 51968, 52224, 52736, 52992, 53248, 53504, 53760, 54016, 54272, 54528, 54784, 55040, 55296, 55552, 55808, 56064, 56320, 56576, 56832, 57088, 57344, 57600, 57856, 58112, 58368, 58624, 59136, 59392, 59648, 59904, 60160, 60416, 60672, 60928, 61184, 61440, 61696, 61952, 62208, 62464, 62720, 62976, 63488, 63744, 64000, 64256, 64512, 64768, 65024, 65280};
GammaG = new ushort[] { 0, 256, 512, 768, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3584, 3840, 4096, 4352, 4608, 4864, 5120, 5376, 5888, 6144, 6400, 6656, 6912, 7168, 7424, 7680, 8192, 8448, 8704, 8960, 9216, 9472, 9728, 9984, 10240, 10496, 10496, 10752, 11008, 11264, 11520, 11776, 12032, 12288, 12544, 12800, 13056, 13056, 13312, 13568, 13824, 14080, 14336, 14592, 14848, 15104, 15360, 15360, 15616, 15872, 16128, 16384, 16640, 16896, 17152, 17408, 17664, 17920, 18176, 18432, 18688, 18688, 18944, 19200, 19456, 19712, 19968, 20224, 20480, 20736, 20992, 21248, 21504, 21760, 22016, 22272, 22528, 22528, 22784, 23040, 23296, 23552, 23808, 24064, 24320, 24576, 24832, 25088, 25344, 25600, 25600, 25856, 26112, 26368, 26624, 26880, 27136, 27392, 27648, 27904, 28160, 28160, 28416, 28672, 28928, 29184, 29440, 29696, 29952, 30208, 30464, 30464, 30720, 30976, 31232, 31488, 31744, 32000, 32256, 32512, 32768, 33024, 33280, 33536, 33792, 34048, 34304, 34560, 34816, 35072, 35328, 35584, 35840, 36096, 36352, 36608, 36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39680, 39936, 40192, 40448, 40704, 40960, 41216, 41472, 41728, 41984, 41984, 42240, 42496, 42752, 43008, 43264, 43520, 43776, 44032, 44288, 44544, 44800, 45056, 45312, 45568, 45824, 45824, 46080, 46336, 46592, 46848, 47104, 47360, 47616, 47872, 48128, 48384, 48640, 48896, 49152, 49408, 49920, 50176, 50432, 50688, 50944, 51200, 51456, 51712, 51968, 52224, 52480, 52736, 52992, 53248, 53504, 53760, 54272, 54528, 54784, 55040, 55296, 55552, 55808, 56064, 56320, 56576, 56832, 57088, 57344, 57600, 57856, 58112, 58368, 58624, 58880, 59136, 59392, 59648, 59904, 60160, 60416, 60672, 60928, 61184, 61440, 61696, 61952, 62208, 62464, 62720, 62976, 63232, 63488, 63744, 64000, 64256};
GammaB = new ushort[] { 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4352, 4608, 4864, 5120, 5376, 5632, 5888, 6144, 6400, 6656, 6912, 7168, 7424, 7680, 7936, 8192, 8448, 8704, 8960, 9216, 9216, 9472, 9728, 9984, 10240, 10496, 10496, 10752, 11008, 11264, 11520, 11776, 12032, 12032, 12288, 12544, 12800, 13056, 13312, 13312, 13568, 13824, 14080, 14336, 14592, 14592, 14848, 15104, 15360, 15616, 15872, 16128, 16384, 16640, 16640, 16896, 17152, 17408, 17664, 17920, 18176, 18432, 18688, 18944, 19200, 19200, 19456, 19712, 19968, 20224, 20480, 20736, 20992, 21248, 21504, 21504, 21760, 22016, 22272, 22528, 22784, 23040, 23296, 23552, 23808, 23808, 24064, 24320, 24576, 24832, 25088, 25344, 25600, 25600, 25856, 26112, 26368, 26624, 26880, 27136, 27392, 27392, 27648, 27904, 28160, 28416, 28672, 28928, 29184, 29184, 29440, 29696, 29952, 30208, 30464, 30720, 30976, 31232, 31232, 31488, 31744, 32000, 32256, 32512, 32768, 33024, 33280, 33536, 33792, 33792, 34048, 34304, 34560, 34816, 35072, 35328, 35584, 35840, 36096, 36096, 36352, 36608, 36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39424, 39680, 39936, 40192, 40448, 40704, 40960, 41216, 41472, 41728, 41984, 42240, 42496, 42752, 43008, 43264, 43264, 43520, 43776, 44032, 44288, 44544, 44800, 45056, 45312, 45568, 45824, 46080, 46336, 46592, 46848, 47104, 47104, 47360, 47616, 47872, 48128, 48384, 48640, 48896, 49152, 49408, 49664, 49920, 50176, 50432, 50688, 50944, 50944, 51200, 51456, 51712, 51968, 52224, 52480, 52736, 52992, 53248, 53504, 53760, 54016, 54272, 54528, 54784, 55040, 55296, 55552, 55808, 56064, 56320, 56576, 56576, 56832, 57088, 57344, 57600, 57856, 58112, 58368, 58624, 58880, 59136, 59392, 59648, 59904, 60160, 60416};
break;
case VisualMode.Scenery:
GammaR = new ushort[] { 7424, 7680, 8192, 8448, 8704, 8960, 9216, 9472, 9728, 9984, 10240, 10496, 10496, 10752, 11008, 11264, 11520, 11776, 12032, 12288, 12544, 12800, 13056, 13056, 13312, 13568, 13824, 14080, 14336, 14592, 14848, 15104, 15360, 15360, 15616, 15872, 16128, 16384, 16640, 16896, 17152, 17408, 17664, 17920, 18176, 18432, 18688, 18688, 18944, 19200, 19456, 19712, 19968, 20224, 20480, 20736, 20992, 21248, 21504, 21760, 22016, 22272, 22528, 22528, 22784, 23040, 23296, 23552, 23808, 24064, 24320, 24576, 24832, 25088, 25344, 25600, 25856, 26112, 26368, 26368, 26624, 26880, 27136, 27392, 27648, 27904, 28160, 28416, 28672, 28928, 29184, 29440, 29696, 29952, 30208, 30208, 30464, 30720, 30976, 31232, 31488, 31744, 32000, 32256, 32512, 32768, 33024, 33280, 33536, 33792, 34048, 34304, 34560, 34816, 35072, 35328, 35584, 35840, 36096, 36352, 36608, 36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39680, 39936, 40192, 40448, 40704, 40960, 41216, 41472, 41728, 41984, 42240, 42496, 42752, 43008, 43264, 43520, 43776, 44032, 44288, 44544, 44800, 45056, 45312, 45568, 45824, 46080, 46336, 46592, 46848, 47104, 47360, 47616, 47872, 48128, 48384, 48640, 48896, 49152, 49408, 49664, 49920, 50176, 50432, 50688, 50944, 51200, 51456, 51712, 51968, 52224, 52736, 52992, 53248, 53504, 53760, 54016, 54272, 54528, 54784, 55040, 55296, 55552, 55808, 56064, 56320, 56576, 56832, 57088, 57344, 57600, 57856, 58112, 58624, 59136, 59392, 59648, 59904, 60160, 60416, 60672, 60928, 61184, 61440, 61696, 61952, 62208, 62464, 62720, 62976, 63488, 63744, 64000, 64256, 64512, 64768, 65024, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280};
GammaG = new ushort[] { 7424, 7680, 8192, 8448, 8704, 8960, 9216, 9472, 9728, 9984, 10240, 10496, 10496, 10752, 11008, 11264, 11520, 11776, 12032, 12288, 12544, 12800, 13056, 13056, 13312, 13568, 13824, 14080, 14336, 14592, 14848, 15104, 15360, 15360, 15616, 15872, 16128, 16384, 16640, 16896, 17152, 17408, 17664, 17920, 18176, 18432, 18688, 18688, 18944, 19200, 19456, 19712, 19968, 20224, 20480, 20736, 20992, 21248, 21504, 21760, 22016, 22272, 22528, 22528, 22784, 23040, 23296, 23552, 23808, 24064, 24320, 24576, 24832, 25088, 25344, 25600, 25600, 25856, 26112, 26368, 26624, 26880, 27136, 27392, 27648, 27904, 28160, 28160, 28416, 28672, 28928, 29184, 29440, 29696, 29952, 30208, 30464, 30464, 30720, 30976, 31232, 31488, 31744, 32000, 32256, 32512, 32768, 33024, 33280, 33536, 33792, 34048, 34304, 34560, 34816, 35072, 35328, 35584, 35840, 36096, 36352, 36608, 36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39680, 39936, 40192, 40448, 40704, 40960, 41216, 41472, 41728, 41984, 42240, 42496, 42752, 43008, 43264, 43520, 43776, 44032, 44032, 44288, 44544, 44800, 45056, 45312, 45568, 45824, 46080, 46336, 46592, 46848, 47104, 47360, 47616, 47872, 48128, 48384, 48640, 48896, 49152, 49408, 49664, 49920, 50176, 50432, 50688, 50944, 51200, 51456, 51712, 52224, 52480, 52736, 52992, 53248, 53504, 53760, 54016, 54272, 54528, 54784, 55040, 55296, 55552, 55808, 56064, 56320, 56576, 56832, 57088, 57344, 57600, 58112, 58368, 58624, 58880, 59136, 59392, 59648, 59904, 60160, 60672, 60928, 61184, 61440, 61696, 61952, 62208, 62464, 62720, 62976, 63232, 63488, 63744, 64000, 64256, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512};
GammaB = new ushort[] { 6912, 7168, 7424, 7680, 7936, 8192, 8448, 8704, 8960, 9216, 9472, 9472, 9728, 9984, 10240, 10496, 10752, 11008, 11264, 11264, 11520, 11776, 12032, 12288, 12544, 12800, 13056, 13056, 13312, 13568, 13824, 14080, 14336, 14592, 14848, 14848, 15104, 15360, 15616, 15872, 16128, 16384, 16640, 16896, 16896, 17152, 17408, 17664, 17920, 18176, 18432, 18688, 18944, 19200, 19456, 19456, 19712, 19968, 20224, 20480, 20736, 20992, 21248, 21504, 21760, 21760, 22016, 22272, 22528, 22784, 23040, 23296, 23552, 23808, 24064, 24064, 24320, 24576, 24832, 25088, 25344, 25600, 25856, 25856, 26112, 26368, 26624, 26880, 27136, 27392, 27648, 27648, 27904, 28160, 28416, 28672, 28928, 29184, 29440, 29440, 29696, 29952, 30208, 30464, 30720, 30976, 31232, 31488, 31488, 31744, 32000, 32256, 32512, 32768, 33024, 33280, 33536, 33792, 34048, 34048, 34304, 34560, 34816, 35072, 35328, 35584, 35840, 36096, 36352, 36352, 36608, 36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39680, 39936, 40192, 40448, 40704, 40960, 41216, 41472, 41728, 41728, 41984, 42240, 42496, 42752, 43008, 43264, 43520, 43776, 44032, 44288, 44544, 44800, 45056, 45312, 45568, 45824, 46080, 46336, 46592, 46848, 47104, 47360, 47616, 47872, 48128, 48384, 48640, 48896, 49152, 49408, 49664, 49664, 49920, 50176, 50432, 50688, 50944, 51200, 51456, 51712, 51968, 52224, 52480, 52736, 52992, 53248, 53504, 53760, 54016, 54272, 54528, 54784, 55296, 55296, 55552, 55808, 56064, 56320, 56576, 56832, 57088, 57344, 57600, 57856, 58112, 58368, 58624, 58880, 59136, 59136, 59392, 59648, 59904, 60160, 60416, 60672, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928, 60928};
break;
default:
GammaR = new ushort[] { 0, 256, 512, 768, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3584, 3840, 4096, 4352, 4608, 4864, 5120, 5376, 5888, 6144, 6400, 6656, 6912, 7168, 7424, 7680, 8192, 8448, 8704, 8960, 9216, 9472, 9728, 9984, 10240, 10496, 10496, 10752, 11008, 11264, 11520, 11776, 12032, 12288, 12544, 12800, 13056, 13056, 13312, 13568, 13824, 14080, 14336, 14592, 14848, 15104, 15360, 15360, 15616, 15872, 16128, 16384, 16640, 16896, 17152, 17408, 17664, 17920, 18176, 18432, 18688, 18688, 18944, 19200, 19456, 19712, 19968, 20224, 20480, 20736, 20992, 21248, 21504, 21760, 22016, 22272, 22528, 22528, 22784, 23040, 23296, 23552, 23808, 24064, 24320, 24576, 24832, 25088, 25344, 25600, 25856, 26112, 26368, 26368, 26624, 26880, 27136, 27392, 27648, 27904, 28160, 28416, 28672, 28928, 29184, 29440, 29696, 29952, 30208, 30208, 30464, 30720, 30976, 31232, 31488, 31744, 32000, 32256, 32512, 32768, 33024, 33280, 33536, 33792, 34048, 34304, 34560, 34816, 35072, 35328, 35584, 35840, 36096, 36352, 36608, 36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39680, 39936, 40192, 40448, 40704, 40960, 41216, 41472, 41728, 41984, 42240, 42496, 42752, 43008, 43264, 43520, 43776, 44032, 44288, 44544, 44800, 45056, 45312, 45568, 45824, 46080, 46336, 46592, 46848, 47104, 47360, 47616, 47872, 48128, 48384, 48640, 48896, 49152, 49408, 49664, 49920, 50176, 50432, 50688, 50944, 51200, 51456, 51712, 51968, 52224, 52736, 52992, 53248, 53504, 53760, 54016, 54272, 54528, 54784, 55040, 55296, 55552, 55808, 56064, 56320, 56576, 56832, 57088, 57344, 57600, 57856, 58112, 58368, 58624, 59136, 59392, 59648, 59904, 60160, 60416, 60672, 60928, 61184, 61440, 61696, 61952, 62208, 62464, 62720, 62976, 63488, 63744, 64000, 64256, 64512, 64768, 65024, 65280 };
GammaG = new ushort[] { 0, 256, 512, 768, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3584, 3840, 4096, 4352, 4608, 4864, 5120, 5376, 5888, 6144, 6400, 6656, 6912, 7168, 7424, 7680, 8192, 8448, 8704, 8960, 9216, 9472, 9728, 9984, 10240, 10496, 10496, 10752, 11008, 11264, 11520, 11776, 12032, 12288, 12544, 12800, 13056, 13056, 13312, 13568, 13824, 14080, 14336, 14592, 14848, 15104, 15360, 15360, 15616, 15872, 16128, 16384, 16640, 16896, 17152, 17408, 17664, 17920, 18176, 18432, 18688, 18688, 18944, 19200, 19456, 19712, 19968, 20224, 20480, 20736, 20992, 21248, 21504, 21760, 22016, 22272, 22528, 22528, 22784, 23040, 23296, 23552, 23808, 24064, 24320, 24576, 24832, 25088, 25344, 25600, 25600, 25856, 26112, 26368, 26624, 26880, 27136, 27392, 27648, 27904, 28160, 28160, 28416, 28672, 28928, 29184, 29440, 29696, 29952, 30208, 30464, 30464, 30720, 30976, 31232, 31488, 31744, 32000, 32256, 32512, 32768, 33024, 33280, 33536, 33792, 34048, 34304, 34560, 34816, 35072, 35328, 35584, 35840, 36096, 36352, 36608, 36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39680, 39936, 40192, 40448, 40704, 40960, 41216, 41472, 41728, 41984, 41984, 42240, 42496, 42752, 43008, 43264, 43520, 43776, 44032, 44288, 44544, 44800, 45056, 45312, 45568, 45824, 45824, 46080, 46336, 46592, 46848, 47104, 47360, 47616, 47872, 48128, 48384, 48640, 48896, 49152, 49408, 49920, 50176, 50432, 50688, 50944, 51200, 51456, 51712, 51968, 52224, 52480, 52736, 52992, 53248, 53504, 53760, 54272, 54528, 54784, 55040, 55296, 55552, 55808, 56064, 56320, 56576, 56832, 57088, 57344, 57600, 57856, 58112, 58368, 58624, 58880, 59136, 59392, 59648, 59904, 60160, 60416, 60672, 60928, 61184, 61440, 61696, 61952, 62208, 62464, 62720, 62976, 63232, 63488, 63744, 64000, 64256 };
GammaB = new ushort[] { 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4352, 4608, 4864, 5120, 5376, 5632, 5888, 6144, 6400, 6656, 6912, 7168, 7424, 7680, 7936, 8192, 8448, 8704, 8960, 9216, 9216, 9472, 9728, 9984, 10240, 10496, 10496, 10752, 11008, 11264, 11520, 11776, 12032, 12032, 12288, 12544, 12800, 13056, 13312, 13312, 13568, 13824, 14080, 14336, 14592, 14592, 14848, 15104, 15360, 15616, 15872, 16128, 16384, 16640, 16640, 16896, 17152, 17408, 17664, 17920, 18176, 18432, 18688, 18944, 19200, 19200, 19456, 19712, 19968, 20224, 20480, 20736, 20992, 21248, 21504, 21504, 21760, 22016, 22272, 22528, 22784, 23040, 23296, 23552, 23808, 23808, 24064, 24320, 24576, 24832, 25088, 25344, 25600, 25600, 25856, 26112, 26368, 26624, 26880, 27136, 27392, 27392, 27648, 27904, 28160, 28416, 28672, 28928, 29184, 29184, 29440, 29696, 29952, 30208, 30464, 30720, 30976, 31232, 31232, 31488, 31744, 32000, 32256, 32512, 32768, 33024, 33280, 33536, 33792, 33792, 34048, 34304, 34560, 34816, 35072, 35328, 35584, 35840, 36096, 36096, 36352, 36608, 36864, 37120, 37376, 37632, 37888, 38144, 38400, 38656, 38912, 39168, 39424, 39424, 39680, 39936, 40192, 40448, 40704, 40960, 41216, 41472, 41728, 41984, 42240, 42496, 42752, 43008, 43264, 43264, 43520, 43776, 44032, 44288, 44544, 44800, 45056, 45312, 45568, 45824, 46080, 46336, 46592, 46848, 47104, 47104, 47360, 47616, 47872, 48128, 48384, 48640, 48896, 49152, 49408, 49664, 49920, 50176, 50432, 50688, 50944, 50944, 51200, 51456, 51712, 51968, 52224, 52480, 52736, 52992, 53248, 53504, 53760, 54016, 54272, 54528, 54784, 55040, 55296, 55552, 55808, 56064, 56320, 56576, 56576, 56832, 57088, 57344, 57600, 57856, 58112, 58368, 58624, 58880, 59136, 59392, 59648, 59904, 60160, 60416 };
break;
}
return new GammaRamp(GammaR, GammaG, GammaB);
}
public void AutoScreen(bool force = false) public void AutoScreen(bool force = false)
{ {
if (force || AppConfig.Is("screen_auto")) if (force || AppConfig.Is("screen_auto"))
@@ -24,29 +66,79 @@ namespace GHelper.Display
} }
} }
public void SaveGamma() public bool GetSRGB()
{
var screenName = ScreenNative.FindLaptopScreen();
if (screenName is null) return false;
bool userProfiles = CCD.GetUsePerUserDisplayProfiles(screenName);
var defaultProfile = CCD.GetDisplayDefaultColorProfile(screenName);
return defaultProfile is not null && defaultProfile.ToLower().Contains("srgb") && userProfiles;
}
public void ToggleSRGB()
{ {
var screenName = ScreenNative.FindLaptopScreen(); var screenName = ScreenNative.FindLaptopScreen();
if (screenName is null) return; if (screenName is null) return;
try bool userProfiles = CCD.GetUsePerUserDisplayProfiles(screenName);
if (!userProfiles) CCD.SetUsePerUserDisplayProfiles(screenName, true);
var profiles = CCD.GetDisplayColorProfiles(screenName);
var defaultProfile = CCD.GetDisplayDefaultColorProfile(screenName);
Debug.WriteLine($"Default Profile {screenName}: {defaultProfile}");
bool isSRGB = defaultProfile is not null && defaultProfile.ToLower().Contains("srgb") && userProfiles;
bool changed = false;
foreach (var profile in profiles)
{ {
var handle = ScreenNative.CreateDC(screenName, screenName, null, IntPtr.Zero); Debug.WriteLine(profile);
var gammaRamp = new GammaRamp();
if (ScreenNative.GetDeviceGammaRamp(handle, ref gammaRamp)) if (!changed && !isSRGB && profile.ToLower().Contains("srgb"))
{ {
var gamma = new DisplayGammaRamp(gammaRamp); CCD.SetDisplayDefaultColorProfile(screenName, profile);
Logger.WriteLine("Gamma R: " + string.Join("-", gamma.Red)); changed = true;
Logger.WriteLine("Gamma G: " + string.Join("-", gamma.Green)); }
Logger.WriteLine("Gamma B: " + string.Join("-", gamma.Blue));
if (!changed && isSRGB && !profile.ToLower().Contains("srgb"))
{
CCD.SetDisplayDefaultColorProfile(screenName, profile);
changed = true;
} }
} }
catch (Exception ex)
if (!changed)
{ {
Logger.WriteLine(ex.ToString()); if (isSRGB) CCD.SetUsePerUserDisplayProfiles(screenName, false);
else
{
var profile = Application.StartupPath + "ASUS_sRGB.icm";
CCD.AddDisplayColorProfile(screenName, profile, true, false);
}
} }
//var colorparams = CCD.GetColorParams(screenName);
//Debug.WriteLine($"{colorparams.MaxLuminance} = {colorparams.RedPointX},{colorparams.RedPointY} {colorparams.GreenPointX},{colorparams.GreenPointY} {colorparams.BluePointX},{colorparams.BluePointY}");
//CCD.SetMinMaxLuminance(0, 0.6, 0.6, screenName);
} }
public void SetBrightness(int brightness = -1)
{
if (!AppConfig.IsOLED()) return;
if (brightness >= 0) AppConfig.Set("brightness", brightness);
else brightness = AppConfig.Get("brightness");
if (brightness >= 0) SetGamma(brightness);
}
public void SetGamma(int brightness = 100) public void SetGamma(int brightness = 100)
{ {
var bright = Math.Round((float)brightness / 200 + 0.5, 2); var bright = Math.Round((float)brightness / 200 + 0.5, 2);
@@ -57,21 +149,23 @@ namespace GHelper.Display
try try
{ {
var handle = ScreenNative.CreateDC(screenName, screenName, null, IntPtr.Zero); var handle = ScreenNative.CreateDC(screenName, screenName, null, IntPtr.Zero);
if (gammaRamp is null) if (true || gammaRamp is null)
{ {
var gammaDump = new GammaRamp(); var gammaDump = new GammaRamp();
if (ScreenNative.GetDeviceGammaRamp(handle, ref gammaDump)) if (ScreenNative.GetDeviceGammaRamp(handle, ref gammaDump))
{ {
gammaRamp = new DisplayGammaRamp(gammaDump); gammaRamp = new DisplayGammaRamp(gammaDump);
Logger.WriteLine("Gamma R: " + string.Join("-", gammaRamp.Red)); Logger.WriteLine("GammaR = {" + string.Join(", ", gammaRamp.Red) + "};");
Logger.WriteLine("Gamma G: " + string.Join("-", gammaRamp.Green)); Logger.WriteLine("GammaG = {" + string.Join(", ", gammaRamp.Green) + "};");
Logger.WriteLine("Gamma B: " + string.Join("-", gammaRamp.Blue)); Logger.WriteLine("GammaB = {" + string.Join(", ", gammaRamp.Blue) + "};");
} }
} }
return;
if (gammaRamp is null || !gammaRamp.IsOriginal()) if (gammaRamp is null || !gammaRamp.IsOriginal())
{ {
Logger.WriteLine("Default Gamma"); Logger.WriteLine("Not default Gamma");
gammaRamp = new DisplayGammaRamp(); gammaRamp = new DisplayGammaRamp();
} }
@@ -80,7 +174,8 @@ namespace GHelper.Display
Logger.WriteLine("Brightness " + bright.ToString() + ": " + result); Logger.WriteLine("Brightness " + bright.ToString() + ": " + result);
} catch (Exception ex) }
catch (Exception ex)
{ {
Logger.WriteLine(ex.ToString()); Logger.WriteLine(ex.ToString());
} }

View File

@@ -42,6 +42,12 @@ namespace GHelper.Display
[DllImport("gdi32")] [DllImport("gdi32")]
internal static extern bool GetDeviceGammaRamp(IntPtr dcHandle, ref GammaRamp ramp); internal static extern bool GetDeviceGammaRamp(IntPtr dcHandle, ref GammaRamp ramp);
[DllImport("gdi32", CharSet = CharSet.Unicode)]
internal static extern bool SetICMProfileW(IntPtr dcHandle, string lpFileName);
[DllImport("gdi32", CharSet = CharSet.Unicode)]
internal static extern bool SetICMMode(IntPtr dcHandle, int mode);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct DEVMODE public struct DEVMODE
{ {

View File

@@ -398,17 +398,19 @@ namespace GHelper
InitServices(); InitServices();
InitHibernate(); InitHibernate();
//InitACPITesting(); InitACPITesting();
} }
private void InitACPITesting() private void InitACPITesting()
{ {
if (!AppConfig.Is("debug")) return;
pictureScan.Visible = true; pictureScan.Visible = true;
panelACPI.Visible = true; panelACPI.Visible = true;
textACPICommand.Text = "120075"; textACPICommand.Text = "120098";
textACPIParam.Text = "1"; textACPIParam.Text = "25";
buttonACPISend.Click += ButtonACPISend_Click; buttonACPISend.Click += ButtonACPISend_Click;
pictureScan.Click += PictureScan_Click; pictureScan.Click += PictureScan_Click;

View File

@@ -9,7 +9,7 @@ namespace GHelper.Fan
public const int XGM_FAN_MAX = 72; public const int XGM_FAN_MAX = 72;
public const int INADEQUATE_MAX = 92; public const int INADEQUATE_MAX = 104;
const int FAN_COUNT = 3; const int FAN_COUNT = 3;

73
app/Fans.Designer.cs generated
View File

@@ -119,6 +119,10 @@ namespace GHelper
picturePowerMode = new PictureBox(); picturePowerMode = new PictureBox();
labelPowerModeTitle = new Label(); labelPowerModeTitle = new Label();
panelGPU = new Panel(); panelGPU = new Panel();
panelGPUPower = new Panel();
labelGPUPower = new Label();
labelGPUPowerTitle = new Label();
trackGPUPower = new TrackBar();
panelGPUTemp = new Panel(); panelGPUTemp = new Panel();
labelGPUTemp = new Label(); labelGPUTemp = new Label();
labelGPUTempTitle = new Label(); labelGPUTempTitle = new Label();
@@ -190,6 +194,8 @@ namespace GHelper
panelPowerModeTItle.SuspendLayout(); panelPowerModeTItle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)picturePowerMode).BeginInit(); ((System.ComponentModel.ISupportInitialize)picturePowerMode).BeginInit();
panelGPU.SuspendLayout(); panelGPU.SuspendLayout();
panelGPUPower.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUPower).BeginInit();
panelGPUTemp.SuspendLayout(); panelGPUTemp.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUTemp).BeginInit(); ((System.ComponentModel.ISupportInitialize)trackGPUTemp).BeginInit();
panelGPUBoost.SuspendLayout(); panelGPUBoost.SuspendLayout();
@@ -533,7 +539,7 @@ namespace GHelper
panelAdvanced.Controls.Add(panelTitleTemp); panelAdvanced.Controls.Add(panelTitleTemp);
panelAdvanced.Controls.Add(panelDownload); panelAdvanced.Controls.Add(panelDownload);
panelAdvanced.Dock = DockStyle.Top; panelAdvanced.Dock = DockStyle.Top;
panelAdvanced.Location = new Point(10, 1644); panelAdvanced.Location = new Point(10, 1768);
panelAdvanced.Name = "panelAdvanced"; panelAdvanced.Name = "panelAdvanced";
panelAdvanced.Size = new Size(520, 992); panelAdvanced.Size = new Size(520, 992);
panelAdvanced.TabIndex = 14; panelAdvanced.TabIndex = 14;
@@ -864,7 +870,7 @@ namespace GHelper
panelPower.Controls.Add(panelPowerMode); panelPower.Controls.Add(panelPowerMode);
panelPower.Controls.Add(panelPowerModeTItle); panelPower.Controls.Add(panelPowerModeTItle);
panelPower.Dock = DockStyle.Top; panelPower.Dock = DockStyle.Top;
panelPower.Location = new Point(10, 764); panelPower.Location = new Point(10, 888);
panelPower.Margin = new Padding(4); panelPower.Margin = new Padding(4);
panelPower.Name = "panelPower"; panelPower.Name = "panelPower";
panelPower.Size = new Size(520, 880); panelPower.Size = new Size(520, 880);
@@ -1237,6 +1243,7 @@ namespace GHelper
panelGPU.AutoSize = true; panelGPU.AutoSize = true;
panelGPU.Controls.Add(panelGPUTemp); panelGPU.Controls.Add(panelGPUTemp);
panelGPU.Controls.Add(panelGPUBoost); panelGPU.Controls.Add(panelGPUBoost);
panelGPU.Controls.Add(panelGPUPower);
panelGPU.Controls.Add(panelGPUMemory); panelGPU.Controls.Add(panelGPUMemory);
panelGPU.Controls.Add(panelGPUCore); panelGPU.Controls.Add(panelGPUCore);
panelGPU.Controls.Add(panelGPUClockLimit); panelGPU.Controls.Add(panelGPUClockLimit);
@@ -1246,10 +1253,59 @@ namespace GHelper
panelGPU.Margin = new Padding(4); panelGPU.Margin = new Padding(4);
panelGPU.Name = "panelGPU"; panelGPU.Name = "panelGPU";
panelGPU.Padding = new Padding(0, 0, 0, 18); panelGPU.Padding = new Padding(0, 0, 0, 18);
panelGPU.Size = new Size(520, 698); panelGPU.Size = new Size(520, 822);
panelGPU.TabIndex = 44; panelGPU.TabIndex = 44;
panelGPU.Visible = false; panelGPU.Visible = false;
// //
// panelGPUPower
//
panelGPUPower.AutoSize = true;
panelGPUPower.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelGPUPower.Controls.Add(labelGPUPower);
panelGPUPower.Controls.Add(labelGPUPowerTitle);
panelGPUPower.Controls.Add(trackGPUPower);
panelGPUPower.Dock = DockStyle.Top;
panelGPUPower.Location = new Point(0, 432);
panelGPUPower.Margin = new Padding(4);
panelGPUPower.MaximumSize = new Size(0, 124);
panelGPUPower.Name = "panelGPUPower";
panelGPUPower.Size = new Size(520, 124);
panelGPUPower.TabIndex = 49;
//
// labelGPUPower
//
labelGPUPower.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUPower.Location = new Point(374, 14);
labelGPUPower.Margin = new Padding(4, 0, 4, 0);
labelGPUPower.Name = "labelGPUPower";
labelGPUPower.Size = new Size(124, 32);
labelGPUPower.TabIndex = 44;
labelGPUPower.Text = "105W";
labelGPUPower.TextAlign = ContentAlignment.TopRight;
//
// labelGPUPowerTitle
//
labelGPUPowerTitle.AutoSize = true;
labelGPUPowerTitle.Location = new Point(10, 14);
labelGPUPowerTitle.Margin = new Padding(4, 0, 4, 0);
labelGPUPowerTitle.Name = "labelGPUPowerTitle";
labelGPUPowerTitle.Size = new Size(130, 32);
labelGPUPowerTitle.TabIndex = 43;
labelGPUPowerTitle.Text = "GPU Power";
//
// trackGPUPower
//
trackGPUPower.Location = new Point(6, 48);
trackGPUPower.Margin = new Padding(4, 2, 4, 2);
trackGPUPower.Maximum = 25;
trackGPUPower.Minimum = 5;
trackGPUPower.Name = "trackGPUPower";
trackGPUPower.Size = new Size(496, 90);
trackGPUPower.TabIndex = 42;
trackGPUPower.TickFrequency = 5;
trackGPUPower.TickStyle = TickStyle.TopLeft;
trackGPUPower.Value = 25;
//
// panelGPUTemp // panelGPUTemp
// //
panelGPUTemp.AutoSize = true; panelGPUTemp.AutoSize = true;
@@ -1258,7 +1314,7 @@ namespace GHelper
panelGPUTemp.Controls.Add(labelGPUTempTitle); panelGPUTemp.Controls.Add(labelGPUTempTitle);
panelGPUTemp.Controls.Add(trackGPUTemp); panelGPUTemp.Controls.Add(trackGPUTemp);
panelGPUTemp.Dock = DockStyle.Top; panelGPUTemp.Dock = DockStyle.Top;
panelGPUTemp.Location = new Point(0, 556); panelGPUTemp.Location = new Point(0, 680);
panelGPUTemp.Margin = new Padding(4); panelGPUTemp.Margin = new Padding(4);
panelGPUTemp.MaximumSize = new Size(0, 124); panelGPUTemp.MaximumSize = new Size(0, 124);
panelGPUTemp.Name = "panelGPUTemp"; panelGPUTemp.Name = "panelGPUTemp";
@@ -1307,7 +1363,7 @@ namespace GHelper
panelGPUBoost.Controls.Add(labelGPUBoostTitle); panelGPUBoost.Controls.Add(labelGPUBoostTitle);
panelGPUBoost.Controls.Add(trackGPUBoost); panelGPUBoost.Controls.Add(trackGPUBoost);
panelGPUBoost.Dock = DockStyle.Top; panelGPUBoost.Dock = DockStyle.Top;
panelGPUBoost.Location = new Point(0, 432); panelGPUBoost.Location = new Point(0, 556);
panelGPUBoost.Margin = new Padding(4); panelGPUBoost.Margin = new Padding(4);
panelGPUBoost.MaximumSize = new Size(0, 124); panelGPUBoost.MaximumSize = new Size(0, 124);
panelGPUBoost.Name = "panelGPUBoost"; panelGPUBoost.Name = "panelGPUBoost";
@@ -1700,6 +1756,9 @@ namespace GHelper
((System.ComponentModel.ISupportInitialize)picturePowerMode).EndInit(); ((System.ComponentModel.ISupportInitialize)picturePowerMode).EndInit();
panelGPU.ResumeLayout(false); panelGPU.ResumeLayout(false);
panelGPU.PerformLayout(); panelGPU.PerformLayout();
panelGPUPower.ResumeLayout(false);
panelGPUPower.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackGPUPower).EndInit();
panelGPUTemp.ResumeLayout(false); panelGPUTemp.ResumeLayout(false);
panelGPUTemp.PerformLayout(); panelGPUTemp.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackGPUTemp).EndInit(); ((System.ComponentModel.ISupportInitialize)trackGPUTemp).EndInit();
@@ -1833,5 +1892,9 @@ namespace GHelper
private TrackBar trackSlow; private TrackBar trackSlow;
private Panel panelDownload; private Panel panelDownload;
private RButton buttonDownload; private RButton buttonDownload;
private Panel panelGPUPower;
private Label labelGPUPower;
private Label labelGPUPowerTitle;
private TrackBar trackGPUPower;
} }
} }

View File

@@ -31,6 +31,8 @@ namespace GHelper
FanSensorControl fanSensorControl; FanSensorControl fanSensorControl;
static int gpuPowerBase = 0;
public Fans() public Fans()
{ {
@@ -144,17 +146,22 @@ namespace GHelper
trackGPUTemp.Minimum = AsusACPI.MinGPUTemp; trackGPUTemp.Minimum = AsusACPI.MinGPUTemp;
trackGPUTemp.Maximum = AsusACPI.MaxGPUTemp; trackGPUTemp.Maximum = AsusACPI.MaxGPUTemp;
trackGPUPower.Minimum = AsusACPI.MinGPUPower;
trackGPUPower.Maximum = AsusACPI.MaxGPUPower;
trackGPUClockLimit.Scroll += trackGPUClockLimit_Scroll; trackGPUClockLimit.Scroll += trackGPUClockLimit_Scroll;
trackGPUCore.Scroll += trackGPU_Scroll; trackGPUCore.Scroll += trackGPU_Scroll;
trackGPUMemory.Scroll += trackGPU_Scroll; trackGPUMemory.Scroll += trackGPU_Scroll;
trackGPUBoost.Scroll += trackGPUPower_Scroll; trackGPUBoost.Scroll += trackGPUPower_Scroll;
trackGPUTemp.Scroll += trackGPUPower_Scroll; trackGPUTemp.Scroll += trackGPUPower_Scroll;
trackGPUPower.Scroll += trackGPUPower_Scroll;
trackGPUCore.MouseUp += TrackGPU_MouseUp; trackGPUCore.MouseUp += TrackGPU_MouseUp;
trackGPUMemory.MouseUp += TrackGPU_MouseUp; trackGPUMemory.MouseUp += TrackGPU_MouseUp;
trackGPUBoost.MouseUp += TrackGPU_MouseUp; trackGPUBoost.MouseUp += TrackGPU_MouseUp;
trackGPUTemp.MouseUp += TrackGPU_MouseUp; trackGPUTemp.MouseUp += TrackGPU_MouseUp;
trackGPUPower.MouseUp += TrackGPU_MouseUp;
trackGPUClockLimit.MouseUp += TrackGPU_MouseUp; trackGPUClockLimit.MouseUp += TrackGPU_MouseUp;
@@ -541,8 +548,12 @@ namespace GHelper
{ {
gpuVisible = buttonGPU.Visible = true; gpuVisible = buttonGPU.Visible = true;
gpuPowerBase = Program.acpi.DeviceGet(AsusACPI.GPU_BASE);
int gpuPowerVar = Program.acpi.DeviceGet(AsusACPI.GPU_POWER);
int gpu_boost = AppConfig.GetMode("gpu_boost"); int gpu_boost = AppConfig.GetMode("gpu_boost");
int gpu_temp = AppConfig.GetMode("gpu_temp"); int gpu_temp = AppConfig.GetMode("gpu_temp");
int gpu_power = AppConfig.GetMode("gpu_power");
int core = AppConfig.GetMode("gpu_core"); int core = AppConfig.GetMode("gpu_core");
int memory = AppConfig.GetMode("gpu_memory"); int memory = AppConfig.GetMode("gpu_memory");
@@ -550,32 +561,35 @@ namespace GHelper
if (gpu_boost < 0) gpu_boost = AsusACPI.MaxGPUBoost; if (gpu_boost < 0) gpu_boost = AsusACPI.MaxGPUBoost;
if (gpu_temp < 0) gpu_temp = AsusACPI.MaxGPUTemp; if (gpu_temp < 0) gpu_temp = AsusACPI.MaxGPUTemp;
if (gpu_power < 0) gpu_power = (gpuPowerVar >= 0) ? gpuPowerVar : AsusACPI.MaxGPUPower;
if (core == -1) core = 0; if (core == -1) core = 0;
if (memory == -1) memory = 0; if (memory == -1) memory = 0;
if (clock_limit == -1) clock_limit = NvidiaGpuControl.MaxClockLimit; if (clock_limit == -1) clock_limit = NvidiaGpuControl.MaxClockLimit;
if (nvControl.GetClocks(out int current_core, out int current_memory)) if (nvControl is not null)
{ {
core = current_core; if (nvControl.GetClocks(out int current_core, out int current_memory))
memory = current_memory; {
core = current_core;
memory = current_memory;
}
int _clockLimit = nvControl.GetMaxGPUCLock();
if (_clockLimit == 0) clock_limit = NvidiaGpuControl.MaxClockLimit;
else if (_clockLimit > 0) clock_limit = _clockLimit;
try
{
labelGPU.Text = nvControl.FullName;
}
catch
{
}
} }
int _clockLimit = nvControl.GetMaxGPUCLock();
if (_clockLimit == 0) clock_limit = NvidiaGpuControl.MaxClockLimit;
else if (_clockLimit > 0) clock_limit = _clockLimit;
try
{
labelGPU.Text = nvControl.FullName;
}
catch
{
}
//}
trackGPUClockLimit.Value = Math.Max(Math.Min(clock_limit, NvidiaGpuControl.MaxClockLimit), NvidiaGpuControl.MinClockLimit); trackGPUClockLimit.Value = Math.Max(Math.Min(clock_limit, NvidiaGpuControl.MaxClockLimit), NvidiaGpuControl.MinClockLimit);
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset); trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
@@ -584,9 +598,13 @@ namespace GHelper
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, AsusACPI.MaxGPUBoost), AsusACPI.MinGPUBoost); trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, AsusACPI.MaxGPUBoost), AsusACPI.MinGPUBoost);
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, AsusACPI.MaxGPUTemp), AsusACPI.MinGPUTemp); trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, AsusACPI.MaxGPUTemp), AsusACPI.MinGPUTemp);
trackGPUPower.Value = Math.Max(Math.Min(gpu_power, AsusACPI.MaxGPUPower), AsusACPI.MinGPUPower);
panelGPUBoost.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0); panelGPUBoost.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0);
panelGPUTemp.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0); panelGPUTemp.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0);
panelGPUPower.Visible = gpuPowerBase > 0 && gpuPowerVar >= 0;
VisualiseGPUSettings(); VisualiseGPUSettings();
} }
@@ -610,6 +628,9 @@ namespace GHelper
labelGPUClockLimit.Text = "Default"; labelGPUClockLimit.Text = "Default";
else else
labelGPUClockLimit.Text = $"{trackGPUClockLimit.Value} MHz"; labelGPUClockLimit.Text = $"{trackGPUClockLimit.Value} MHz";
labelGPUPower.Text = (gpuPowerBase + trackGPUPower.Value) + "W";
} }
private void trackGPUClockLimit_Scroll(object? sender, EventArgs e) private void trackGPUClockLimit_Scroll(object? sender, EventArgs e)
@@ -640,6 +661,7 @@ namespace GHelper
{ {
AppConfig.SetMode("gpu_boost", trackGPUBoost.Value); AppConfig.SetMode("gpu_boost", trackGPUBoost.Value);
AppConfig.SetMode("gpu_temp", trackGPUTemp.Value); AppConfig.SetMode("gpu_temp", trackGPUTemp.Value);
AppConfig.SetMode("gpu_power", trackGPUPower.Value);
VisualiseGPUSettings(); VisualiseGPUSettings();
} }
@@ -740,7 +762,10 @@ namespace GHelper
private void TrackPower_MouseUp(object? sender, MouseEventArgs e) private void TrackPower_MouseUp(object? sender, MouseEventArgs e)
{ {
modeControl.AutoPower(); Task.Run(() =>
{
modeControl.AutoPower(true);
});
} }
@@ -983,7 +1008,7 @@ namespace GHelper
try try
{ {
if (chartCount > 2) if (chartCount > 2)
Size = MinimumSize = new Size(Size.Width, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100))); Size = MinimumSize = new Size(Size.Width, Math.Max(MinimumSize.Height, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100))));
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -1089,19 +1114,25 @@ namespace GHelper
if (gpuVisible) if (gpuVisible)
{ {
int gpuPowerVar = Program.acpi.DeviceGet(AsusACPI.GPU_POWER);
Logger.WriteLine("Default GPU Power: " + gpuPowerVar);
trackGPUClockLimit.Value = NvidiaGpuControl.MaxClockLimit; trackGPUClockLimit.Value = NvidiaGpuControl.MaxClockLimit;
trackGPUCore.Value = 0; trackGPUCore.Value = 0;
trackGPUMemory.Value = 0; trackGPUMemory.Value = 0;
trackGPUBoost.Value = AsusACPI.MaxGPUBoost; trackGPUBoost.Value = AsusACPI.MaxGPUBoost;
trackGPUTemp.Value = AsusACPI.MaxGPUTemp; trackGPUTemp.Value = AsusACPI.MaxGPUTemp;
trackGPUPower.Value = Math.Max(Math.Min((gpuPowerVar >= 0) ? gpuPowerVar : AsusACPI.MaxGPUPower, AsusACPI.MaxGPUPower), AsusACPI.MinGPUPower);
AppConfig.SetMode("gpu_clock_limit", trackGPUClockLimit.Value);
AppConfig.SetMode("gpu_boost", trackGPUBoost.Value); AppConfig.SetMode("gpu_boost", trackGPUBoost.Value);
AppConfig.SetMode("gpu_temp", trackGPUTemp.Value); AppConfig.SetMode("gpu_temp", trackGPUTemp.Value);
AppConfig.SetMode("gpu_core", trackGPUCore.Value); AppConfig.RemoveMode("gpu_power");
AppConfig.SetMode("gpu_memory", trackGPUMemory.Value);
AppConfig.RemoveMode("gpu_clock_limit");
AppConfig.RemoveMode("gpu_core");
AppConfig.RemoveMode("gpu_memory");
VisualiseGPUSettings(); VisualiseGPUSettings();
modeControl.SetGPUClocks(true); modeControl.SetGPUClocks(true);

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.155</AssemblyVersion> <AssemblyVersion>0.156</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -101,6 +101,8 @@ namespace GHelper.Helpers
if (Program.settingsForm.Visible) if (Program.settingsForm.Visible)
Program.screenControl.InitScreen(); Program.screenControl.InitScreen();
Program.screenControl.SetBrightness();
} }
private static int CheckAndSaveLidAction() private static int CheckAndSaveLidAction()

View File

@@ -85,7 +85,7 @@ namespace GHelper.Input
InitBacklightTimer(); InitBacklightTimer();
if (AppConfig.ContainsModel("VivoBook")) Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ? 1 : 0, "FnLock"); if (AppConfig.IsVivoZenbook()) Program.acpi.DeviceSet(AsusACPI.FnLock, AppConfig.Is("fn_lock") ? 1 : 0, "FnLock");
} }
@@ -151,7 +151,7 @@ namespace GHelper.Input
// FN-Lock group // FN-Lock group
if (AppConfig.Is("fn_lock") && !AppConfig.ContainsModel("VivoBook")) if (AppConfig.Is("fn_lock") && !AppConfig.IsVivoZenbook())
for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i); for (Keys i = Keys.F1; i <= Keys.F11; i++) hook.RegisterHotKey(ModifierKeys.None, i);
// Arrow-lock group // Arrow-lock group
@@ -500,7 +500,7 @@ namespace GHelper.Input
case "micmute": case "micmute":
bool muteStatus = Audio.ToggleMute(); bool muteStatus = Audio.ToggleMute();
Program.toast.RunToast(muteStatus ? "Muted" : "Unmuted", muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone); Program.toast.RunToast(muteStatus ? "Muted" : "Unmuted", muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
if (AppConfig.IsVivobook()) Program.acpi.DeviceSet(AsusACPI.MicMuteLed, muteStatus ? 1 : 0, "MicmuteLed"); if (AppConfig.IsVivoZenbook()) Program.acpi.DeviceSet(AsusACPI.MicMuteLed, muteStatus ? 1 : 0, "MicmuteLed");
break; break;
case "brightness_up": case "brightness_up":
SetBrightness(+10); SetBrightness(+10);
@@ -568,7 +568,7 @@ namespace GHelper.Input
int fnLock = AppConfig.Is("fn_lock") ? 0 : 1; int fnLock = AppConfig.Is("fn_lock") ? 0 : 1;
AppConfig.Set("fn_lock", fnLock); AppConfig.Set("fn_lock", fnLock);
if (AppConfig.ContainsModel("VivoBook")) if (AppConfig.IsVivoZenbook())
Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock == 1 ? 1 : 0, "FnLock"); Program.acpi.DeviceSet(AsusACPI.FnLock, fnLock == 1 ? 1 : 0, "FnLock");
else else
Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys); Program.settingsForm.BeginInvoke(Program.inputDispatcher.RegisterKeys);
@@ -676,7 +676,8 @@ namespace GHelper.Input
return; return;
case 51: // Fn+F6 on old TUFs case 51: // Fn+F6 on old TUFs
case 53: // Fn+F6 on GA-502DU model case 53: // Fn+F6 on GA-502DU model
NativeMethods.TurnOffScreen(); SleepEvent();
//NativeMethods.TurnOffScreen();
return; return;
} }
} }

View File

@@ -62,33 +62,46 @@ namespace GHelper.Mode
if (!Modes.Exists(mode)) mode = 0; if (!Modes.Exists(mode)) mode = 0;
customFans = false;
customPower = 0;
settings.ShowMode(mode); settings.ShowMode(mode);
SetModeLabel();
Modes.SetCurrent(mode); Modes.SetCurrent(mode);
int status = Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode");
// Vivobook fallback Task.Run(async () =>
if (status != 1)
{ {
int vivoMode = Modes.GetBase(mode); bool reset = AppConfig.IsResetRequired() && (Modes.GetBase(oldMode) == Modes.GetBase(mode)) && customPower > 0;
if (vivoMode == 1) vivoMode = 2;
else if (vivoMode == 2) vivoMode = 1; customFans = false;
Program.acpi.DeviceSet(AsusACPI.VivoBookMode, vivoMode, "VivoMode"); customPower = 0;
} SetModeLabel();
// Workaround for not properly resetting limits on G14 2024
if (reset)
{
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, (Modes.GetBase(oldMode) != 1) ? AsusACPI.PerformanceTurbo : AsusACPI.PerformanceBalanced, "Reset");
await Task.Delay(TimeSpan.FromMilliseconds(1500));
}
int status = Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode");
// Vivobook fallback
if (status != 1) Program.acpi.SetVivoMode(Modes.GetBase(mode));
SetGPUClocks();
AutoFans();
await Task.Delay(TimeSpan.FromMilliseconds(1000));
AutoPower();
});
if (AppConfig.Is("xgm_fan") && Program.acpi.IsXGConnected()) XGM.Reset(); if (AppConfig.Is("xgm_fan") && Program.acpi.IsXGConnected()) XGM.Reset();
if (notify) if (notify)
Program.toast.RunToast(Modes.GetCurrentName(), SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online ? ToastIcon.Charger : ToastIcon.Battery); Program.toast.RunToast(Modes.GetCurrentName(), SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online ? ToastIcon.Charger : ToastIcon.Battery);
SetGPUClocks();
AutoFans();
AutoPower(1000);
// Power plan from config or defaulting to balanced // Power plan from config or defaulting to balanced
if (AppConfig.GetModeString("scheme") is not null) if (AppConfig.GetModeString("scheme") is not null)
@@ -145,18 +158,17 @@ namespace GHelper.Mode
Program.acpi.SetFanCurve(AsusFan.Mid, AppConfig.GetFanConfig(AsusFan.Mid)); Program.acpi.SetFanCurve(AsusFan.Mid, AppConfig.GetFanConfig(AsusFan.Mid));
// something went wrong, resetting to default profile // Alternative way to set fan curve
if (cpuResult != 1 || gpuResult != 1) if (cpuResult != 1 || gpuResult != 1)
{ {
cpuResult = Program.acpi.SetFanRange(AsusFan.CPU, AppConfig.GetFanConfig(AsusFan.CPU)); cpuResult = Program.acpi.SetFanRange(AsusFan.CPU, AppConfig.GetFanConfig(AsusFan.CPU));
gpuResult = Program.acpi.SetFanRange(AsusFan.GPU, AppConfig.GetFanConfig(AsusFan.GPU)); gpuResult = Program.acpi.SetFanRange(AsusFan.GPU, AppConfig.GetFanConfig(AsusFan.GPU));
// Something went wrong, resetting to default profile
if (cpuResult != 1 || gpuResult != 1) if (cpuResult != 1 || gpuResult != 1)
{ {
int mode = Modes.GetCurrentBase(); Program.acpi.DeviceSet(AsusACPI.PerformanceMode, Modes.GetCurrentBase(), "Reset Mode");
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode); settings.LabelFansResult("Model doesn't support custom fan curves");
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, mode, "Reset Mode");
settings.LabelFansResult("ASUS BIOS rejected fan curve");
} }
} }
else else
@@ -182,52 +194,25 @@ namespace GHelper.Mode
} }
public void AutoPower(int delay = 0) public void AutoPower(bool launchAsAdmin = false)
{ {
customPower = 0; customPower = 0;
bool applyPower = AppConfig.IsMode("auto_apply_power"); bool applyPower = AppConfig.IsMode("auto_apply_power");
bool applyFans = AppConfig.IsMode("auto_apply"); bool applyFans = AppConfig.IsMode("auto_apply");
//bool applyGPU = true;
if (applyPower && !applyFans) if (applyPower && !applyFans && (AppConfig.IsFanRequired() || AppConfig.IsManualModeRequired()))
{ {
// force fan curve for misbehaving bios PPTs on some models AutoFans(true);
if (AppConfig.IsFanRequired()) Thread.Sleep(500);
{
delay = 500;
AutoFans(true);
}
// Fix for models that don't support PPT settings in all modes, setting a "manual" mode for them
if (AppConfig.IsManualModeRequired())
{
AutoFans(true);
}
} }
if (delay > 0) if (applyPower) SetPower(launchAsAdmin);
{
var timer = new System.Timers.Timer(delay);
timer.Elapsed += delegate
{
timer.Stop();
timer.Dispose();
if (applyPower) SetPower(); Thread.Sleep(500);
Thread.Sleep(500); SetGPUPower();
SetGPUPower(); AutoRyzen();
AutoRyzen();
};
timer.Start();
}
else
{
if (applyPower) SetPower(true);
SetGPUPower();
AutoRyzen();
}
} }
@@ -346,18 +331,20 @@ namespace GHelper.Mode
int gpu_boost = AppConfig.GetMode("gpu_boost"); int gpu_boost = AppConfig.GetMode("gpu_boost");
int gpu_temp = AppConfig.GetMode("gpu_temp"); int gpu_temp = AppConfig.GetMode("gpu_temp");
int gpu_power = AppConfig.GetMode("gpu_power");
int boostResult = -1; int boostResult = -1;
if (gpu_boost < AsusACPI.MinGPUBoost || gpu_boost > AsusACPI.MaxGPUBoost) return; if (gpu_power >= AsusACPI.MinGPUPower && gpu_power <= AsusACPI.MaxGPUPower && Program.acpi.DeviceGet(AsusACPI.GPU_POWER) >= 0)
if (gpu_temp < AsusACPI.MinGPUTemp || gpu_temp > AsusACPI.MaxGPUTemp) return; Program.acpi.DeviceSet(AsusACPI.GPU_POWER, gpu_power, "PowerLimit TGP (GPU VAR)");
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0) if (gpu_boost >= AsusACPI.MinGPUBoost && gpu_boost <= AsusACPI.MaxGPUBoost && Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0)
boostResult = Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0"); boostResult = Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0 (GPU BOOST)");
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0) if (gpu_temp >= AsusACPI.MinGPUTemp && gpu_temp <= AsusACPI.MaxGPUTemp && Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0)
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC2, gpu_temp, "PowerLimit C2"); Program.acpi.DeviceSet(AsusACPI.PPT_GPUC2, gpu_temp, "PowerLimit C2 (GPU TEMP)");
// Fallback
if (boostResult == 0) if (boostResult == 0)
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0"); Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0");

View File

@@ -37,7 +37,12 @@
} }
public override int DPIIncrements() public override int DPIIncrements()
{ {
return 100; return 50;
}
public override int MinDPI()
{
return 50;
} }
public override bool HasDebounceSetting() public override bool HasDebounceSetting()

View File

@@ -7,6 +7,10 @@
{ {
} }
public StrixImpactII(ushort pid) : base(0x0B05, pid, "mi_00", false)
{
}
public override int DPIProfileCount() public override int DPIProfileCount()
{ {
return 4; return 4;
@@ -174,4 +178,19 @@
} }
} }
} }
public class StrixImpactIIElectroPunk : StrixImpactII
{
public StrixImpactIIElectroPunk() : base(0x1956)
{
}
public override string GetDisplayName()
{
return "ROG Strix Impact II Electro Punk";
}
}
} }

View File

@@ -209,6 +209,7 @@ namespace GHelper.Peripherals
DetectMouse(new PugioII()); DetectMouse(new PugioII());
DetectMouse(new PugioIIWired()); DetectMouse(new PugioIIWired());
DetectMouse(new StrixImpactII()); DetectMouse(new StrixImpactII());
DetectMouse(new StrixImpactIIElectroPunk());
DetectMouse(new Chakram()); DetectMouse(new Chakram());
DetectMouse(new ChakramWired()); DetectMouse(new ChakramWired());
DetectMouse(new ChakramCore()); DetectMouse(new ChakramCore());

View File

@@ -124,10 +124,10 @@
<value>Verbindung zu ASUS ACPI fehlgeschlagen. G-Helper kann nicht ausgeführt werden. Bitte installiere ASUS System Control Interface.</value> <value>Verbindung zu ASUS ACPI fehlgeschlagen. G-Helper kann nicht ausgeführt werden. Bitte installiere ASUS System Control Interface.</value>
</data> </data>
<data name="AlertAPUMemoryRestart" xml:space="preserve"> <data name="AlertAPUMemoryRestart" xml:space="preserve">
<value>Restart your device to apply changes</value> <value>Gerät neu starten, um Änderungen anzuwenden</value>
</data> </data>
<data name="AlertAPUMemoryRestartTitle" xml:space="preserve"> <data name="AlertAPUMemoryRestartTitle" xml:space="preserve">
<value>Restart now?</value> <value>Jetzt neu starten?</value>
</data> </data>
<data name="AlertDGPU" xml:space="preserve"> <data name="AlertDGPU" xml:space="preserve">
<value>Die GPU wird gerade verwendet. Trotzdem deaktivieren?</value> <value>Die GPU wird gerade verwendet. Trotzdem deaktivieren?</value>
@@ -250,7 +250,7 @@
<value>Im Betrieb</value> <value>Im Betrieb</value>
</data> </data>
<data name="BacklightTimeout" xml:space="preserve"> <data name="BacklightTimeout" xml:space="preserve">
<value>Timeout angeschlossen / bei Akku (0 - AN)</value> <value>Timeout angeschlossen / bei Akku (0 = An)</value>
</data> </data>
<data name="BacklightTimeoutBattery" xml:space="preserve"> <data name="BacklightTimeoutBattery" xml:space="preserve">
<value>Backlight Timeout when on battery</value> <value>Backlight Timeout when on battery</value>
@@ -289,7 +289,7 @@
<value>Hochfahren</value> <value>Hochfahren</value>
</data> </data>
<data name="BootSound" xml:space="preserve"> <data name="BootSound" xml:space="preserve">
<value>Boot Sound</value> <value>Boot-Sound</value>
</data> </data>
<data name="Brightness" xml:space="preserve"> <data name="Brightness" xml:space="preserve">
<value>Helligkeit</value> <value>Helligkeit</value>
@@ -310,7 +310,7 @@
<value>Farbe</value> <value>Farbe</value>
</data> </data>
<data name="Contrast" xml:space="preserve"> <data name="Contrast" xml:space="preserve">
<value>Contrast</value> <value>Kontrast</value>
</data> </data>
<data name="Controller" xml:space="preserve"> <data name="Controller" xml:space="preserve">
<value>Controller</value> <value>Controller</value>
@@ -328,7 +328,7 @@
<value>Standard</value> <value>Standard</value>
</data> </data>
<data name="DisableController" xml:space="preserve"> <data name="DisableController" xml:space="preserve">
<value>Disable Controller</value> <value>Controller deaktivieren</value>
</data> </data>
<data name="DisableOnLidClose" xml:space="preserve"> <data name="DisableOnLidClose" xml:space="preserve">
<value>Disable on lid close</value> <value>Disable on lid close</value>
@@ -352,7 +352,7 @@
<value>Eco</value> <value>Eco</value>
</data> </data>
<data name="EnableGPUOnShutdown" xml:space="preserve"> <data name="EnableGPUOnShutdown" xml:space="preserve">
<value>Enable GPU on shutdown (prevents issue with Eco mode)</value> <value>Aktiviere GPU beim Herunterfahren (verhindert Problem im Eco-Modus)</value>
</data> </data>
<data name="EnableOptimusText" xml:space="preserve"> <data name="EnableOptimusText" xml:space="preserve">
<value>Die dGPU zu deaktivieren, indem Sie in den Eco-Modus wechseln während der Anzeigemodus nicht auf Optimus eingestellt ist, kann zu Problemen mit der Helligkeitseinstellung führen. <value>Die dGPU zu deaktivieren, indem Sie in den Eco-Modus wechseln während der Anzeigemodus nicht auf Optimus eingestellt ist, kann zu Problemen mit der Helligkeitseinstellung führen.
@@ -366,7 +366,7 @@ Trotzdem fortfahren?</value>
<value>Energieeinstellungen</value> <value>Energieeinstellungen</value>
</data> </data>
<data name="Export" xml:space="preserve"> <data name="Export" xml:space="preserve">
<value>Export Profile</value> <value>Profil exportieren</value>
</data> </data>
<data name="Extra" xml:space="preserve"> <data name="Extra" xml:space="preserve">
<value>Extra</value> <value>Extra</value>
@@ -441,10 +441,10 @@ Trotzdem fortfahren?</value>
<value>Hoch</value> <value>Hoch</value>
</data> </data>
<data name="ImageRotation" xml:space="preserve"> <data name="ImageRotation" xml:space="preserve">
<value>Image Rotation</value> <value>Bilddrehung</value>
</data> </data>
<data name="Import" xml:space="preserve"> <data name="Import" xml:space="preserve">
<value>Import Profile</value> <value>Profil importieren</value>
</data> </data>
<data name="KeyBindings" xml:space="preserve"> <data name="KeyBindings" xml:space="preserve">
<value>Tastenbelegung</value> <value>Tastenbelegung</value>
@@ -534,7 +534,7 @@ Trotzdem fortfahren?</value>
<value>Tastenreaktionsgeschwindigkeit</value> <value>Tastenreaktionsgeschwindigkeit</value>
</data> </data>
<data name="MouseImportFailed" xml:space="preserve"> <data name="MouseImportFailed" xml:space="preserve">
<value>Import failed. Selected file is not a valid mouse profile or corrutpted.</value> <value>Import fehlgeschlagen. Die ausgewählte Datei ist kein gültiges Mausprofil oder beschädigt.</value>
</data> </data>
<data name="MouseLiftOffDistance" xml:space="preserve"> <data name="MouseLiftOffDistance" xml:space="preserve">
<value>Lift Off Distance</value> <value>Lift Off Distance</value>
@@ -621,7 +621,7 @@ Trotzdem fortfahren?</value>
<value>Schließen</value> <value>Schließen</value>
</data> </data>
<data name="Reset" xml:space="preserve"> <data name="Reset" xml:space="preserve">
<value>Reset</value> <value>Zurücksetzen</value>
</data> </data>
<data name="RestartGPU" xml:space="preserve"> <data name="RestartGPU" xml:space="preserve">
<value>Ein Prozess verhindert den Wechsel in den Eco-Modus. dGPU neu starten? Fortfahren auf eigene Gefahr.</value> <value>Ein Prozess verhindert den Wechsel in den Eco-Modus. dGPU neu starten? Fortfahren auf eigene Gefahr.</value>
@@ -639,7 +639,7 @@ Trotzdem fortfahren?</value>
<value>Beim Start ausführen</value> <value>Beim Start ausführen</value>
</data> </data>
<data name="ScalingQuality" xml:space="preserve"> <data name="ScalingQuality" xml:space="preserve">
<value>Scaling Quality</value> <value>Skalierungsqualität</value>
</data> </data>
<data name="ScreenPadDown" xml:space="preserve"> <data name="ScreenPadDown" xml:space="preserve">
<value>Screenpad Helligkeit verringern</value> <value>Screenpad Helligkeit verringern</value>
@@ -720,7 +720,7 @@ Trotzdem fortfahren?</value>
<value>Version</value> <value>Version</value>
</data> </data>
<data name="VibrationStrength" xml:space="preserve"> <data name="VibrationStrength" xml:space="preserve">
<value>Vibration Strength</value> <value>Vibrationsstärke</value>
</data> </data>
<data name="VolumeDown" xml:space="preserve"> <data name="VolumeDown" xml:space="preserve">
<value>Lautstärke verringern</value> <value>Lautstärke verringern</value>

View File

@@ -13,7 +13,7 @@ namespace Ryzen
internal class RyzenControl internal class RyzenControl
{ {
public static int MinCPUUV => AppConfig.Get("min_uv", -30); public static int MinCPUUV => AppConfig.Get("min_uv", -40);
public const int MaxCPUUV = 0; public const int MaxCPUUV = 0;
public const int MinIGPUUV = -20; public const int MinIGPUUV = -20;

File diff suppressed because it is too large Load Diff

525
app/Settings.Designer.cs generated

File diff suppressed because it is too large Load Diff

View File

@@ -254,16 +254,37 @@ namespace GHelper
VisualiseFnLock(); VisualiseFnLock();
buttonFnLock.Click += ButtonFnLock_Click; buttonFnLock.Click += ButtonFnLock_Click;
panelGamma.Visible = AppConfig.IsOLED();
sliderGamma.ValueChanged += SliderGamma_ValueChanged;
labelGamma.Text = "100%";
panelPerformance.Focus(); panelPerformance.Focus();
InitBrightness();
checkSRGB.Checked = screenControl.GetSRGB();
checkSRGB.CheckedChanged += CheckSRGB_CheckedChanged;
} }
private void CheckSRGB_CheckedChanged(object? sender, EventArgs e)
{
screenControl.ToggleSRGB();
}
public void InitBrightness()
{
if (!AppConfig.IsOLED()) return;
panelGamma.Visible = true;
int brightness = AppConfig.Get("brightness");
if (brightness >= 0) sliderGamma.Value = brightness;
sliderGamma.ValueChanged += SliderGamma_ValueChanged;
labelGamma.Text = sliderGamma.Value + "%";
}
private void SliderGamma_ValueChanged(object? sender, EventArgs e) private void SliderGamma_ValueChanged(object? sender, EventArgs e)
{ {
screenControl.SetGamma(sliderGamma.Value); screenControl.SetBrightness(sliderGamma.Value);
labelGamma.Text = sliderGamma.Value + "%"; labelGamma.Text = sliderGamma.Value + "%";
} }

View File

@@ -79,7 +79,7 @@ namespace GHelper.USB
public static Color Color1 = Color.White; public static Color Color1 = Color.White;
public static Color Color2 = Color.Black; public static Color Color2 = Color.Black;
static bool isACPI = AppConfig.IsTUF() || AppConfig.IsVivobook() || AppConfig.IsProArt(); static bool isACPI = AppConfig.IsTUF() || AppConfig.IsVivoZenbook() || AppConfig.IsProArt();
static bool isStrix = AppConfig.IsStrix() && !AppConfig.IsNoDirectRGB(); static bool isStrix = AppConfig.IsStrix() && !AppConfig.IsNoDirectRGB();
static bool isStrix4Zone = AppConfig.IsStrixLimitedRGB(); static bool isStrix4Zone = AppConfig.IsStrixLimitedRGB();

View File

@@ -83,13 +83,12 @@ namespace GHelper
InitializeComponent(); InitializeComponent();
InitTheme(true); InitTheme(true);
LoadUpdates(true);
//buttonRefresh.Visible = false; //buttonRefresh.Visible = false;
buttonRefresh.Click += ButtonRefresh_Click; buttonRefresh.Click += ButtonRefresh_Click;
Shown += Updates_Shown; Shown += Updates_Shown;
} }
private void ButtonRefresh_Click(object? sender, EventArgs e) private void ButtonRefresh_Click(object? sender, EventArgs e)
{ {
LoadUpdates(); LoadUpdates();
@@ -100,7 +99,9 @@ namespace GHelper
Height = Program.settingsForm.Height; Height = Program.settingsForm.Height;
Top = Program.settingsForm.Top; Top = Program.settingsForm.Top;
Left = Program.settingsForm.Left - Width - 5; Left = Program.settingsForm.Left - Width - 5;
LoadUpdates(true);
} }
private Dictionary<string, string> GetDeviceVersions() private Dictionary<string, string> GetDeviceVersions()
{ {
using (ManagementObjectSearcher objSearcher = new ManagementObjectSearcher("Select * from Win32_PnPSignedDriver")) using (ManagementObjectSearcher objSearcher = new ManagementObjectSearcher("Select * from Win32_PnPSignedDriver"))
@@ -160,24 +161,36 @@ namespace GHelper
}); });
} }
public void VisualiseNewDriver(int position, int newer, TableLayoutPanel table) private void _VisualiseNewDriver(int position, int newer, TableLayoutPanel table)
{ {
var label = table.GetControlFromPosition(3, position) as LinkLabel; var label = table.GetControlFromPosition(3, position) as LinkLabel;
if (label != null) if (label != null)
{
if (newer == DRIVER_NEWER)
{
label.AccessibleName = label.AccessibleName + Properties.Strings.NewUpdates;
label.Font = new Font(label.Font, FontStyle.Underline | FontStyle.Bold);
label.LinkColor = colorTurbo;
}
if (newer == DRIVER_NOT_FOUND) label.LinkColor = Color.Gray;
}
}
public void VisualiseNewDriver(int position, int newer, TableLayoutPanel table)
{
if (InvokeRequired)
{ {
Invoke(delegate Invoke(delegate
{ {
if (newer == DRIVER_NEWER) _VisualiseNewDriver(position, newer, table);
{
label.AccessibleName = label.AccessibleName + Properties.Strings.NewUpdates;
label.Font = new Font(label.Font, FontStyle.Underline | FontStyle.Bold);
label.LinkColor = colorTurbo;
}
if (newer == DRIVER_NOT_FOUND) label.LinkColor = Color.Gray;
}); });
} else
{
_VisualiseNewDriver(position, newer, table);
} }
} }
public void VisualiseNewCount(int updatesCount, TableLayoutPanel table) public void VisualiseNewCount(int updatesCount, TableLayoutPanel table)
@@ -193,7 +206,7 @@ namespace GHelper
}); });
} }
public async void DriversAsync(string url, int type, TableLayoutPanel table) public async void DriversAsync(string url, int type, TableLayoutPanel table)
{ {
try try
@@ -266,7 +279,7 @@ namespace GHelper
foreach (var localVersion in localVersions) foreach (var localVersion in localVersions)
{ {
newer = Math.Min(newer, new Version(driver.version).CompareTo(new Version(localVersion))); newer = Math.Min(newer, new Version(driver.version).CompareTo(new Version(localVersion)));
Logger.WriteLine(driver.title + " " + deviceID + " "+ driver.version + " vs " + localVersion + " = " + newer); Logger.WriteLine(driver.title + " " + deviceID + " " + driver.version + " vs " + localVersion + " = " + newer);
} }
} }

View File

@@ -1,5 +1,5 @@
{ {
"sdk": { "sdk": {
"version": "7.0.400" "version": "7.0.406"
} }
} }