From 251d32e115d4172ff6f3e281fcc1d3853f00d0d4 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Sun, 3 Mar 2024 17:15:40 +0100 Subject: [PATCH 1/6] 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. --- app/Peripherals/Mouse/Models/StrixCarry.cs | 7 ++++++- app/Peripherals/Mouse/Models/StrixImpactII.cs | 19 +++++++++++++++++++ app/Peripherals/PeripheralsProvider.cs | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/Peripherals/Mouse/Models/StrixCarry.cs b/app/Peripherals/Mouse/Models/StrixCarry.cs index 5fcb906d..4e243fd1 100644 --- a/app/Peripherals/Mouse/Models/StrixCarry.cs +++ b/app/Peripherals/Mouse/Models/StrixCarry.cs @@ -37,7 +37,12 @@ } public override int DPIIncrements() { - return 100; + return 50; + } + + public override int MinDPI() + { + return 50; } public override bool HasDebounceSetting() diff --git a/app/Peripherals/Mouse/Models/StrixImpactII.cs b/app/Peripherals/Mouse/Models/StrixImpactII.cs index 6d16d3a5..62f8ec97 100644 --- a/app/Peripherals/Mouse/Models/StrixImpactII.cs +++ b/app/Peripherals/Mouse/Models/StrixImpactII.cs @@ -7,6 +7,10 @@ { } + public StrixImpactII(ushort pid) : base(0x0B05, pid, "mi_00", false) + { + } + public override int DPIProfileCount() { 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"; + } + } } diff --git a/app/Peripherals/PeripheralsProvider.cs b/app/Peripherals/PeripheralsProvider.cs index 9042c5b1..7d600bb0 100644 --- a/app/Peripherals/PeripheralsProvider.cs +++ b/app/Peripherals/PeripheralsProvider.cs @@ -209,6 +209,7 @@ namespace GHelper.Peripherals DetectMouse(new PugioII()); DetectMouse(new PugioIIWired()); DetectMouse(new StrixImpactII()); + DetectMouse(new StrixImpactIIElectroPunk()); DetectMouse(new Chakram()); DetectMouse(new ChakramWired()); DetectMouse(new ChakramCore()); From 8ab1f1fc819e0461c6879fb346572854c6cc0b74 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:08:46 +0100 Subject: [PATCH 2/6] Workaround for bugged BIOS on G14 2024 --- app/AppConfig.cs | 7 +++++- app/AsusACPI.cs | 11 ++++++++-- app/Mode/ModeControl.cs | 47 +++++++++++++++++++++++------------------ app/global.json | 2 +- 4 files changed, 42 insertions(+), 25 deletions(-) diff --git a/app/AppConfig.cs b/app/AppConfig.cs index eea9ea08..6a535827 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -522,9 +522,14 @@ public static class AppConfig } } + public static bool IsResetRequired() + { + return ContainsModel("GA403"); + } + 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 IsPowerRequired() diff --git a/app/AsusACPI.cs b/app/AsusACPI.cs index 0aca9fbd..d77dfd66 100644 --- a/app/AsusACPI.cs +++ b/app/AsusACPI.cs @@ -421,9 +421,16 @@ public class AsusACPI { 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) { int ecoFlag = DeviceGet(GPUEco); diff --git a/app/Mode/ModeControl.cs b/app/Mode/ModeControl.cs index 913a2685..2fdf2ba4 100644 --- a/app/Mode/ModeControl.cs +++ b/app/Mode/ModeControl.cs @@ -62,39 +62,44 @@ namespace GHelper.Mode if (!Modes.Exists(mode)) mode = 0; - customFans = false; - customPower = 0; - settings.ShowMode(mode); - SetModeLabel(); Modes.SetCurrent(mode); - int status = Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.IsManualModeRequired() ? AsusACPI.PerformanceManual : Modes.GetBase(mode), "Mode"); - // Vivobook fallback - if (status != 1) + Task.Run(async () => { - int vivoMode = Modes.GetBase(mode); - if (vivoMode == 1) vivoMode = 2; - else if (vivoMode == 2) vivoMode = 1; - Program.acpi.DeviceSet(AsusACPI.VivoBookMode, vivoMode, "VivoMode"); - } + bool reset = AppConfig.IsResetRequired() && (Modes.GetBase(oldMode) == Modes.GetBase(mode)) && customPower > 0; + + customFans = false; + 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)); + + AutoFans(); + await Task.Delay(TimeSpan.FromMilliseconds(1000)); + AutoPower(); + + + SetGPUClocks(); + }); + if (AppConfig.Is("xgm_fan") && Program.acpi.IsXGConnected()) XGM.Reset(); if (notify) Program.toast.RunToast(Modes.GetCurrentName(), SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online ? ToastIcon.Charger : ToastIcon.Battery); - SetGPUClocks(); - - Task.Run(async () => - { - await Task.Delay(TimeSpan.FromMilliseconds(100)); - AutoFans(); - await Task.Delay(TimeSpan.FromMilliseconds(1000)); - AutoPower(); - }); // Power plan from config or defaulting to balanced diff --git a/app/global.json b/app/global.json index fb34cf6b..cb00d84f 100644 --- a/app/global.json +++ b/app/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.400" + "version": "7.0.406" } } \ No newline at end of file From 64f457211330b00a4470d5ea115e05a2ccd9ad96 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:31:25 +0100 Subject: [PATCH 3/6] UI tweaks --- app/AppConfig.cs | 5 +++++ app/AsusACPI.cs | 8 ++++++++ app/Fans.cs | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/AppConfig.cs b/app/AppConfig.cs index 6a535827..38aa14af 100644 --- a/app/AppConfig.cs +++ b/app/AppConfig.cs @@ -532,6 +532,11 @@ public static class AppConfig 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() { return ContainsModel("FX507") || ContainsModel("FX517") || ContainsModel("FX707"); diff --git a/app/AsusACPI.cs b/app/AsusACPI.cs index d77dfd66..2a0c1eaa 100644 --- a/app/AsusACPI.cs +++ b/app/AsusACPI.cs @@ -308,6 +308,14 @@ public class AsusACPI { MaxGPUBoost = 15; } + + if (AppConfig.IsAMDLight()) + { + MaxTotal = 90; + } + + + } public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer) diff --git a/app/Fans.cs b/app/Fans.cs index 705f0aed..68487bf9 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -1008,7 +1008,7 @@ namespace GHelper try { 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) { From 53d73824177487a14a26806a192dbe07bea3d7ba Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 5 Mar 2024 01:17:40 +0100 Subject: [PATCH 4/6] Set GPU Clocks earlier --- app/Mode/ModeControl.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Mode/ModeControl.cs b/app/Mode/ModeControl.cs index 2fdf2ba4..cfb93777 100644 --- a/app/Mode/ModeControl.cs +++ b/app/Mode/ModeControl.cs @@ -86,12 +86,13 @@ namespace GHelper.Mode // Vivobook fallback if (status != 1) Program.acpi.SetVivoMode(Modes.GetBase(mode)); + SetGPUClocks(); + AutoFans(); await Task.Delay(TimeSpan.FromMilliseconds(1000)); AutoPower(); - SetGPUClocks(); }); From abc9acd3a823b0ab2a2d914705ad728afa650532 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 5 Mar 2024 12:27:06 +0100 Subject: [PATCH 5/6] UV Cleanup --- app/Ryzen/RyzenControl.cs | 2 +- app/Ryzen/SendCommand.cs | 929 +------------------------------------- 2 files changed, 11 insertions(+), 920 deletions(-) diff --git a/app/Ryzen/RyzenControl.cs b/app/Ryzen/RyzenControl.cs index 28c9b47d..3b9287e5 100644 --- a/app/Ryzen/RyzenControl.cs +++ b/app/Ryzen/RyzenControl.cs @@ -13,7 +13,7 @@ namespace Ryzen 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 MinIGPUUV = -20; diff --git a/app/Ryzen/SendCommand.cs b/app/Ryzen/SendCommand.cs index 99a58fe6..3a874c1e 100644 --- a/app/Ryzen/SendCommand.cs +++ b/app/Ryzen/SendCommand.cs @@ -20,6 +20,8 @@ namespace Ryzen //REMBRANDT - 8 //PHEONIX - 9 //RAPHAEL/DRAGON RANGE - 10 + //MENDOCINO - 11 + //HAWKPOINT - 12 public static Smu RyzenAccess = new Smu(false); public static int FAMID = RyzenControl.FAMID; @@ -46,6 +48,7 @@ namespace Ryzen case 8: case 9: case 11: + case 12: RyzenAccess.SendMp1(0x14, ref Args); result = RyzenAccess.SendPsmu(0x31, ref Args); break; @@ -74,6 +77,7 @@ namespace Ryzen case 8: case 9: case 11: + case 12: result = RyzenAccess.SendPsmu(0x31, ref Args); break; default: @@ -104,6 +108,7 @@ namespace Ryzen case 8: case 9: case 11: + case 12: result = RyzenAccess.SendMp1(0x15, ref Args); break; default: @@ -134,6 +139,7 @@ namespace Ryzen case 8: case 9: case 11: + case 12: result = RyzenAccess.SendMp1(0x16, ref Args); break; default: @@ -143,61 +149,6 @@ namespace Ryzen return result; } - //Slow time - public static void set_slow_time(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x1d, ref Args); - break; - case 3: - case 5: - case 7: - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x17, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //STAMP Time - public static void set_stapm_time(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x1e, ref Args); - break; - case 3: - case 5: - case 7: - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x18, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } //TCTL Temp Limit public static Smu.Status? set_tctl_temp(uint value) @@ -224,6 +175,7 @@ namespace Ryzen case 8: case 9: case 11: + case 12: result = RyzenAccess.SendMp1(0x19, ref Args); break; case 4: @@ -242,34 +194,6 @@ namespace Ryzen return result; } - //cHTC Temp Limit - public static void set_cHTC_temp(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendPsmu(0x56, ref Args); - break; - case 3: - case 5: - case 7: - case 8: - case 9: - case 11: - RyzenAccess.SendPsmu(0x37, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - //Skin Temp limit public static Smu.Status? set_apu_skin_temp_limit(uint value) { @@ -285,6 +209,7 @@ namespace Ryzen case 8: case 9: case 11: + case 12: result = RyzenAccess.SendMp1(0x33, ref Args); break; case 3: @@ -300,623 +225,6 @@ namespace Ryzen return result; } - //VRM Current - public static void set_vrm_current(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x20, ref Args); - break; - case 3: - case 5: - case 7: - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x1a, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //VRM SoC Current - public static void set_vrmsoc_current(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x21, ref Args); - break; - case 3: - case 5: - case 7: - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x1b, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //VRM GFX Current - public static void set_vrmgfx_current(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 5: - RyzenAccess.SendMp1(0x1c, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //VRM CVIP Current - public static void set_vrmcvip_current(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 5: - RyzenAccess.SendMp1(0x1d, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //VRM Max Current - public static void set_vrmmax_current(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x22, ref Args); - break; - case 5: - RyzenAccess.SendMp1(0x1e, ref Args); - break; - case 3: - case 7: - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x1c, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //VRM GFX Max Current - public static void set_vrmgfxmax_current(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 5: - RyzenAccess.SendMp1(0x1f, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //VRM SoC Max Current - public static void set_vrmsocmax_current(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x23, ref Args); - break; - case 3: - case 5: - case 7: - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x1d, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //GFX Clock Max - public static void set_max_gfxclk_freq(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x46, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //GFX Clock Min - public static void set_min_gfxclk_freq(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x47, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //SoC Clock Max - public static void set_max_socclk_freq(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x48, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //SoC Clock Min - public static void set_min_socclk_freq(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x49, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //FCLK Clock Max - public static void set_max_fclk_freq(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x4a, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //FCLK Clock Min - public static void set_min_fclk_freq(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x4b, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //VCN Clock Max - public static void set_max_vcn_freq(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x4c, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //VCN Clock Min - public static void set_min_vcn_freq(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x4d, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //LCLK Clock Max - public static void set_max_lclk(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x4e, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //LCLK Clock Min - public static void set_min_lclk(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x4f, ref Args); - break; - } - RyzenAccess.Deinitialize(); - } - - //Prochot Ramp - public static void set_prochot_deassertion_ramp(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x26, ref Args); - break; - case 5: - RyzenAccess.SendMp1(0x22, ref Args); - break; - case 3: - case 7: - RyzenAccess.SendMp1(0x20, ref Args); - break; - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x1f, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //GFX Clock - public static void set_gfx_clk(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 3: - case 8: - case 9: - case 11: - RyzenAccess.SendPsmu(0x89, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //dGPU Skin Temp - public static void set_dGPU_skin(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 3: - case 7: - RyzenAccess.SendMp1(0x37, ref Args); - break; - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x32, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //Power Saving - public static void set_power_saving(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x19, ref Args); - break; - case 3: - case 5: - case 7: - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x12, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //Max Performance - public static void set_max_performance(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 0: - case 1: - case 2: - RyzenAccess.SendMp1(0x18, ref Args); - break; - case 3: - case 5: - case 7: - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x11, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //Set All Core OC - public static void set_oc_clk(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case -1: - RyzenAccess.SendPsmu(0x6c, ref Args); - break; - case 0: - case 1: - case 2: - RyzenAccess.SendPsmu(0x7d, ref Args); - break; - case 3: - case 7: - RyzenAccess.SendMp1(0x31, ref Args); - RyzenAccess.SendPsmu(0x19, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendMp1(0x26, ref Args); - RyzenAccess.SendPsmu(0x5c, ref Args); - break; - case 8: - case 9: - case 11: - RyzenAccess.SendPsmu(0x19, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x5F, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //Set Per Core OC - public static void set_per_core_oc_clk(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case -1: - RyzenAccess.SendPsmu(0x6d, ref Args); - break; - case 0: - case 1: - case 2: - RyzenAccess.SendPsmu(0x7E, ref Args); - break; - case 3: - case 7: - RyzenAccess.SendMp1(0x32, ref Args); - RyzenAccess.SendPsmu(0x1a, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendMp1(0x27, ref Args); - RyzenAccess.SendPsmu(0x5d, ref Args); - break; - case 8: - case 9: - case 11: - RyzenAccess.SendPsmu(0x1a, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x60, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //Set VID - public static void set_oc_volt(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case -1: - RyzenAccess.SendPsmu(0x6e, ref Args); - break; - case 0: - case 1: - case 2: - RyzenAccess.SendPsmu(0x7f, ref Args); - break; - case 3: - case 7: - RyzenAccess.SendMp1(0x33, ref Args); - RyzenAccess.SendPsmu(0x1b, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendMp1(0x28, ref Args); - RyzenAccess.SendPsmu(0x61, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x61, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - //Set All Core Curve Optimiser public static Smu.Status? set_coall(int value) { @@ -945,6 +253,7 @@ namespace Ryzen case 8: case 9: case 11: + case 12: result = RyzenAccess.SendPsmu(0x5D, ref Args); break; case 10: @@ -959,37 +268,6 @@ namespace Ryzen } - //Set Per Core Curve Optimiser - public static void set_coper(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case 3: - case 7: - RyzenAccess.SendMp1(0x54, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendMp1(0x35, ref Args); - break; - case 5: - case 8: - case 9: - case 11: - RyzenAccess.SendMp1(0x4b, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x6, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } //Set iGPU Curve Optimiser public static Smu.Status? set_cogfx(int value) @@ -1014,6 +292,7 @@ namespace Ryzen case 8: case 9: case 11: + case 12: result = RyzenAccess.SendPsmu(0xb7, ref Args); break; default: @@ -1024,194 +303,6 @@ namespace Ryzen return result; } - //Disable OC - public static void set_disable_oc() - { - uint value = 0x0; - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - switch (FAMID) - { - case -1: - RyzenAccess.SendMp1(0x24, ref Args); - break; - case 0: - case 1: - case 2: - RyzenAccess.SendPsmu(0x6A, ref Args); - break; - case 3: - case 7: - RyzenAccess.SendMp1(0x30, ref Args); - RyzenAccess.SendPsmu(0x1d, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendMp1(0x25, ref Args); - RyzenAccess.SendPsmu(0x5b, ref Args); - break; - case 8: - case 9: - case 11: - RyzenAccess.SendPsmu(0x18, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x5E, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //Enable OC - public static void set_enable_oc() - { - uint value = 0x0; - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case -1: - RyzenAccess.SendMp1(0x23, ref Args); - break; - case 0: - case 1: - case 2: - RyzenAccess.SendPsmu(0x69, ref Args); - break; - case 3: - case 7: - RyzenAccess.SendMp1(0x2f, ref Args); - RyzenAccess.SendPsmu(0x1d, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendMp1(0x24, ref Args); - RyzenAccess.SendPsmu(0x5a, ref Args); - break; - case 8: - case 9: - case 11: - RyzenAccess.SendPsmu(0x17, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x5D, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //Set PBO Scaler - public static void set_scaler(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case -1: - RyzenAccess.SendPsmu(0x6a, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendPsmu(0x58, ref Args); - RyzenAccess.SendMp1(0x2F, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x5b, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - - //Set PPT - public static void set_ppt(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case -1: - RyzenAccess.SendPsmu(0x64, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendPsmu(0x53, ref Args); - RyzenAccess.SendMp1(0x3D, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x56, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - - //Set TDC - public static void set_tdc(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case -1: - RyzenAccess.SendPsmu(0x65, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendPsmu(0x54, ref Args); - RyzenAccess.SendMp1(0x3B, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x57, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } - - //Set EDC - public static void set_edc(uint value) - { - RyzenAccess.Initialize(); - uint[] Args = new uint[6]; - Args[0] = value; - - switch (FAMID) - { - case -1: - RyzenAccess.SendPsmu(0x66, ref Args); - break; - case 4: - case 6: - RyzenAccess.SendPsmu(0x55, ref Args); - RyzenAccess.SendMp1(0x3c, ref Args); - break; - case 10: - RyzenAccess.SendPsmu(0x58, ref Args); - break; - default: - break; - } - RyzenAccess.Deinitialize(); - } } } From 6dcfff704e1927ba8effed3bc9aec595470a7588 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:49:27 +0100 Subject: [PATCH 6/6] Sleep hotkey for TUF devices --- app/Input/InputDispatcher.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 65f5bd1c..f110eed8 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -676,7 +676,8 @@ namespace GHelper.Input return; case 51: // Fn+F6 on old TUFs case 53: // Fn+F6 on GA-502DU model - NativeMethods.TurnOffScreen(); + SleepEvent(); + //NativeMethods.TurnOffScreen(); return; } }