示例#1
0
 /// <summary>
 /// Exposes the current watch state based on index
 /// </summary>
 public Watch this[int index] =>
 Watch.GenerateWatch(
     _settings.Domain,
     _watchList[index].Address,
     _settings.Size,
     _settings.Type,
     _settings.BigEndian,
     "",
     0,
     _watchList[index].Previous,
     _settings.IsDetailed() ? ((IMiniWatchDetails)_watchList[index]).ChangeCount : 0);
        public static Cheat ToCheat(this IDecodeResult result, MemoryDomain domain, string description)
        {
            var watch = Watch.GenerateWatch(
                domain,
                result.Address,
                result.Size,
                DisplayType.Hex,
                domain.EndianType == MemoryDomain.Endian.Big,
                description);

            return(result.Compare.HasValue
                                ? new Cheat(watch, result.Value, result.Compare.Value, true, Cheat.CompareType.Equal)
                                : new Cheat(watch, result.Value));
        }
示例#3
0
        public static void FreezeAddress(long address, string freezename = "")
        {
            if (address >= 0)
            {
                var watch = Watch.GenerateWatch(
                    getProxy(MainDomain, address).md,
                    address,
                    WatchSize,
                    BizHawk.Client.Common.DisplayType.Hex,
                    BigEndian,
                    //RTC_HIJACK : change string.empty to freezename
                    freezename);

                Global.CheatList.Add(new Cheat(
                                         watch,
                                         watch.Value));
            }
        }
示例#4
0
        public override void Apply()
        {
            try
            {
                if (!IsEnabled)
                {
                    return;
                }

                MemoryDomain md = RTC_MemoryZones.getDomain(Domain);

                if (md == null)
                {
                    return;
                }

                string cheatName = "RTC Cheat|" + Domain + "|" + address.ToString() + "|" + displayType.ToString() + "|" + bigEndian.ToString() + "|" + value.ToString() + "|" + IsEnabled.ToString() + "|" + IsFreeze.ToString();

                if (!IsFreeze)
                {
                    Watch somewatch = Watch.GenerateWatch(md, address, size, displayType, bigEndian, cheatName, value, 0, 0);
                    Cheat ch        = new Cheat(somewatch, value, null, true);
                    Global.CheatList.Add(ch);

                    RTC_HellgenieEngine.RemoveExcessCheats();
                }
                else
                {
                    RTC_Core.hexeditor.FreezeAddress(address, cheatName);

                    RTC_FreezeEngine.RemoveExcessCheats();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("The BlastCheat apply() function threw up. \n" +
                                "This is not a BizHawk error so you should probably send a screenshot of this to the devs\n\n" +
                                ex.ToString());
                return;
            }
        }