Example #1
0
        public static BlastUnit GenerateUnit(string _domain, long _address)
        {
            long safeAddress;

            // Randomly seleclong safeAddress ts a memory operation according to the selected algorithm
            if (vectorAligned)
            {
                safeAddress = (_address - ((_address % 4)) + vectorOffset);
            }
            else
            {
                safeAddress = (_address + vectorOffset);
            }


            MemoryInterface mi = WGH_Core.currentMemoryInterface;

            //MemoryDomainProxy md = RTC_MemoryDomains.getProxyFromString(_domain);

            if (mi == null)
            {
                return(null);
            }

            //Don't peek out of range
            if (safeAddress + 4 > mi.lastMemorySize)
            {
                return(null);
            }

            try
            {
                BlastVector bv = null;

                lastValues = read32bits(mi, safeAddress);
                lastDomain = _domain;


                if (isConstant(lastValues, limiterList))
                {
                    bv = new BlastVector(_domain, _address, getRandomConstant(valueList), true);
                }

                return(bv);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Something went wrong in the RTC Vector 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);
            }
        }
Example #2
0
        public static BlastUnit GenerateUnit(string _domain, long _address)
        {
            // Randomly selects a memory operation according to the selected algorithm

            //long safeAddress = _address - (_address % 8); //64-bit trunk
            long safeAddress = _address - (_address % 4); //32-bit trunk

            MemoryDomainProxy mdp = RTC_MemoryDomains.getProxy(_domain, safeAddress);

            if (mdp == null)
            {
                return(null);
            }


            try
            {
                BlastVector bv = null;

                lastValues = read32bits(mdp, safeAddress);
                lastDomain = _domain;



                if (isConstant(lastValues, limiterList))
                {
                    bv = new BlastVector(_domain, _address, getRandomConstant(valueList), true);
                }

                return(bv);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Something went wrong in the RTC Vector 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);
            }
        }