Example #1
0
        public static BlastUnit GenerateUnit(string _domain, long _address)
        {
            // Randomly selects a memory operation according to the selected algorithm

            try
            {
                BlastByteType Type  = BlastByteType.SET;
                int           Value = 1;
                BlastByte     bb    = new BlastByte(_domain, _address, Type, Value, true);
                return(bb.GetBackup());
            }
            catch (Exception ex)
            {
                MessageBox.Show("Something went wrong in the RTC Distortion Engine. \n" +
                                "This is not a BizHawk error so you should probably send a screenshot of this to the devs\n\n" +
                                ex.ToString());
                return(null);
            }
        }
        public static BlastUnit GenerateUnit(string _domain, long _address)
        {
            // Randomly selects a memory operation according to the selected algorithm

            try
            {
                MemoryDomainProxy mdp  = RTC_MemoryDomains.getProxy(_domain, _address);
                BlastByteType     Type = BlastByteType.SET;

                byte[] _value;;
                if (RTC_Core.CustomPrecision == -1)
                {
                    _value = new byte[mdp.WordSize];
                }
                else
                {
                    _value = new byte[RTC_Core.CustomPrecision];
                }

                for (int i = 0; i < _value.Length; i++)
                {
                    _value[i] = 1;
                }

                long safeAddress = _address - (_address % _value.Length);

                BlastByte bb = new BlastByte(_domain, safeAddress, Type, _value, true);
                return(bb.GetBackup());
            }
            catch (Exception ex)
            {
                MessageBox.Show("Something went wrong in the RTC Distortion Engine. \n" +
                                "This is not a BizHawk error so you should probably send a screenshot of this to the devs\n\n" +
                                ex.ToString());
                return(null);
            }
        }