Beispiel #1
0
        public RMT()
        {
            InitializeComponent();
            upDownTctlTemp.Enabled        = false;
            upDownStapmLimit.Enabled      = false;
            upDownSlowTime.Enabled        = false;
            upDownStapmTime.Enabled       = false;
            upDownCurrentLimit.Enabled    = false;
            upDownSlowLimit.Enabled       = false;
            upDownFastLimit.Enabled       = false;
            upDownMaxCurrentLimit.Enabled = false;

            labelRenoirMobileTuning.Text = "RMT v0.3.0-A";

            if (true)
            {
                Args        = new uint[6];
                RyzenAccess = new Smu();
                RyzenAccess.Initialize();
                labelRenoirMobileTuning.Text += " - " + RyzenAccess.GetCpuName();

                if (RyzenAccess.SendPsmu(0x66, ref Args) == Smu.Status.OK)
                {
                    Address = Args[0];
                    Args[0] = 0;
                    if (RyzenAccess.SendPsmu(0x65, ref Args) == Smu.Status.OK)
                    {
                        upDownStapmLimit.Value = (decimal)(Smu.ReadFloat(Address, 0x0));
                        upDownFastLimit.Value  = (decimal)(Smu.ReadFloat(Address, 0x2));
                        upDownSlowLimit.Value  = (decimal)(Smu.ReadFloat(Address, 0x4));

                        upDownSlowTime.Value  = (decimal)(Smu.ReadFloat(Address, 0x221));
                        upDownStapmTime.Value = (decimal)(Smu.ReadFloat(Address, 0x220));

                        upDownTctlTemp.Value        = (decimal)(Smu.ReadFloat(Address, 0x10));
                        upDownCurrentLimit.Value    = (decimal)(Smu.ReadFloat(Address, 0x8));
                        upDownMaxCurrentLimit.Value = (decimal)(Smu.ReadFloat(Address, 0xC));

                        //upDownSocCurrentLimit.Value = (decimal)(Smu.ReadFloat(Address, 0xA));
                        //upDownSocMaxCurrentLimit.Value = (decimal)(Smu.ReadFloat(Address, 0xE));
                    }
                }
            }
        }
Beispiel #2
0
        public SystemMonitor()
        {
            RyzenAccess = new Smu();

            Args = new uint[6];
            RyzenAccess.SendPsmu(0x66, ref Args);
            Address = Args[0];



            UpdateTimer.Tick    += new EventHandler(UptateTimer_Tick);
            UpdateTimer.Interval = 2000;
            UpdateTimer.Enabled  = true;

            InitializeComponent();
            CpuData.DataSource = Sensors;

            FillInTable();
        }
Beispiel #3
0
        public RMT()
        {
            EnableDebug = false;
            LoadValues  = true;
            InitializeComponent();
            upDownTctlTemp.Enabled        = false;
            upDownStapmLimit.Enabled      = false;
            upDownSlowTime.Enabled        = false;
            upDownStapmTime.Enabled       = false;
            upDownCurrentLimit.Enabled    = false;
            upDownSlowLimit.Enabled       = false;
            upDownFastLimit.Enabled       = false;
            upDownMaxCurrentLimit.Enabled = false;


            labelRenoirMobileTuning.Text = "RMT v1.0.4";



            if (LoadValues)
            {
                Args        = new uint[6];
                RyzenAccess = new Smu(EnableDebug);
                RyzenAccess.Initialize();
                labelRenoirMobileTuning.Text += " - " + RyzenAccess.GetCpuName();

                if (RyzenAccess.SendPsmu(0x66, ref Args) == Smu.Status.OK)
                {
                    Address = Args[0];
                    Args[0] = 0;
                    RyzenAccess.SendPsmu(0x65, ref Args);
                    float TestValue = ReadFloat(Address, (uint)768);
                    if (TestValue == 0.0)
                    {
                        PMTableVersion = 0x00370005;
                        if (RyzenAccess.SendPsmu(0x65, ref Args) == Smu.Status.OK)
                        {
                            if (EnableDebug)
                            {
                                MessageBox.Show($"Address: 0x{Address:X8} -> {TestValue:F}", "Version 0x00370005");
                            }
                            upDownStapmLimit.Value = (decimal)(Smu.ReadFloat(Address, 0x0));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded STAPM Limit", "1/8");
                            }

                            upDownFastLimit.Value = (decimal)(Smu.ReadFloat(Address, 0x2));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Fast Limit", "2/8");
                            }

                            upDownSlowLimit.Value = (decimal)(Smu.ReadFloat(Address, 0x4));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Slow Limit", "3/8");
                            }

                            upDownSlowTime.Value = (decimal)(Smu.ReadFloat(Address, 0x228));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Slow PPT Time", "4/8");
                            }

                            upDownStapmTime.Value = (decimal)(Smu.ReadFloat(Address, 0x227));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded STAPM Time", "5/8");
                            }


                            upDownTctlTemp.Value = (decimal)(Smu.ReadFloat(Address, 0x10));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Tctl Temp", "6/8");
                            }

                            upDownCurrentLimit.Value = (decimal)(Smu.ReadFloat(Address, 0x8));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Current Limit", "7/8");
                            }

                            upDownMaxCurrentLimit.Value = (decimal)(Smu.ReadFloat(Address, 0xC));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Max Current Limit Time", "8/8");
                            }
                        }
                        else
                        {
                            MessageBox.Show("Failed to communicate with SMU");
                        }
                    }
                    else
                    {
                        PMTableVersion = 0x00370004;
                        if (RyzenAccess.SendPsmu(0x65, ref Args) == Smu.Status.OK)
                        {
                            if (EnableDebug)
                            {
                                MessageBox.Show($"Address: 0x{Address:X8} -> {TestValue:F}", "Version 0x00370005");
                            }
                            upDownStapmLimit.Value = (decimal)(Smu.ReadFloat(Address, 0x0));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded STAPM Limit", "1/8");
                            }

                            upDownFastLimit.Value = (decimal)(Smu.ReadFloat(Address, 0x2));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Fast Limit", "2/8");
                            }

                            upDownSlowLimit.Value = (decimal)(Smu.ReadFloat(Address, 0x4));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Slow Limit", "3/8");
                            }

                            upDownSlowTime.Value = (decimal)(Smu.ReadFloat(Address, 0x221));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Slow PPT Time", "4/8");
                            }

                            upDownStapmTime.Value = (decimal)(Smu.ReadFloat(Address, 0x220));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded STAPM Time", "5/8");
                            }


                            upDownTctlTemp.Value = (decimal)(Smu.ReadFloat(Address, 0x10));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Tctl Temp", "6/8");
                            }

                            upDownCurrentLimit.Value = (decimal)(Smu.ReadFloat(Address, 0x8));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Current Limit", "7/8");
                            }

                            upDownMaxCurrentLimit.Value = (decimal)(Smu.ReadFloat(Address, 0xC));
                            if (EnableDebug)
                            {
                                MessageBox.Show("Loaded Max Current Limit Time", "8/8");
                            }
                        }
                        else
                        {
                            MessageBox.Show("Failed to communicate with SMU");
                        }
                    }
                    //upDownSocCurrentLimit.Value = (decimal)(Smu.ReadFloat(Address, 0xA));
                    //upDownSocMaxCurrentLimit.Value = (decimal)(Smu.ReadFloat(Address, 0xE));
                }
            }
        }
Beispiel #4
0
        private void ApplySettings_Click(object sender, EventArgs e)
        {
            RyzenAccess = new Smu(false);

            RyzenAccess.Initialize();

            //String exe = Directory.GetCurrentDirectory() + "\\smu-tool\\smu-tool.exe";

            int i = 0;

            Smu.Status[] Statuses = new Smu.Status[8];
            Args = new uint[6];

            if (checkStapmLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x14;
                Args[0] = (uint)Convert.ToInt32(upDownStapmLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x14 --arg0={0:0}000", upDownStapmLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkFastLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x15;
                Args[0] = (uint)Convert.ToInt32(upDownFastLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x15 --arg0={0:0}000", upDownFastLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkSlowLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x16;
                Args[0] = (uint)Convert.ToInt32(upDownSlowLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x16 --arg0={0:0}000", upDownSlowLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkSlowTime.Checked)
            {
                //Set Msg and Args
                Msg     = 0x17;
                Args[0] = (uint)Convert.ToInt32(upDownSlowTime.Value);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x17 --arg0={0:0}", upDownSlowTime.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkStapmTime.Checked)
            {
                //Set Msg and Args
                Msg     = 0x18;
                Args[0] = (uint)Convert.ToInt32(upDownStapmTime.Value);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x18 --arg0={0:0}", upDownStapmTime.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkTctlTemp.Checked)
            {
                //Set Msg and Args
                Msg     = 0x19;
                Args[0] = (uint)Convert.ToInt32(upDownTctlTemp.Value);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x19 --arg0={0:0}", upDownTctlTemp.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            if (checkCurrentLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x1A;
                Args[0] = (uint)Convert.ToInt32(upDownCurrentLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x1A --arg0={0:0}000", upDownCurrentLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }
            if (checkMaxCurrentLimit.Checked)
            {
                //Set Msg and Args
                Msg     = 0x1C;
                Args[0] = (uint)Convert.ToInt32(upDownMaxCurrentLimit.Value * 1000);

                //Send msg
                Statuses[i++] = RyzenAccess.SendMp1(Msg, ref Args);

                //args = String.Format("--message=0x1C --arg0={0:0}000", upDownMaxCurrentLimit.Value);
                //var proc = System.Diagnostics.Process.Start(exe, args);
            }

            /*
             * IF "%Stapm%" NEQ "" smu-tool.exe -m --message=0x14 --arg0=%Stapm%000
             * IF "%Fast%" NEQ "" smu-tool.exe -m --message=0x15 --arg0=%Fast%000
             * IF "%Slow%" NEQ "" smu-tool.exe -m --message=0x16 --arg0=%Slow%000
             * IF "%SlowTime%" NEQ "" smu-tool.exe -m --message=0x17 --arg0=%SlowTime%
             * IF "%StapmTime%" NEQ "" smu-tool.exe -m --message=0x18 --arg0=%StapmTime%
             * IF "%Tctl%" NEQ "" smu-tool.exe -m --message=0x19 --arg0=%Tctl%
             * IF "%Current%" NEQ "" smu-tool.exe -m --message=0x1A --arg0=%Current%000
             * IF "%MaxCurrent%" NEQ "" smu-tool.exe -m --message=0x1C --arg0=%MaxCurrent%000
             */

            for (int j = 0; j < i; j++)
            {/*
              * if (Statuses[j] != Smu.Status.OK)
              * {
              *     throw new ApplicationException($"{j:D}-Status: " + Statuses[j].ToString());
              * }*/
            }

            RyzenAccess.Deinitialize();
        }