public Config() { _saveFile = ConfigurationManager.AppSettings["save"] ?? "save.json"; InitializeComponent(); WatchManager.Init(); Settings = AppSettings.Load(_saveFile); locations.DataSource = Settings.Locations; locations.DisplayMember = "FriendlyName"; LogList.DataSource = WatchManager.Logs; variables.DataSource = Settings.Variables; variables.DisplayMember = "Name"; friendlyName.DataBindings.Add("Text", locations.DataSource, "FriendlyName", true, DataSourceUpdateMode.OnPropertyChanged); watchFolder.DataBindings.Add("Text", locations.DataSource, "WatchFolder", true, DataSourceUpdateMode.OnPropertyChanged); watchSubdirectories.DataBindings.Add("Checked", locations.DataSource, "WatchSubdirectories", true, DataSourceUpdateMode.OnPropertyChanged); copyToFolder.DataBindings.Add("Text", locations.DataSource, "CopyToFolder", true, DataSourceUpdateMode.OnPropertyChanged); pattern.DataBindings.Add("Text", locations.DataSource, "Pattern", true, DataSourceUpdateMode.OnPropertyChanged); selfGeneratedId.DataBindings.Add("Text", locations.DataSource, "Id", true, DataSourceUpdateMode.OnPropertyChanged); variableName.DataBindings.Add("Text", variables.DataSource, "Name", true, DataSourceUpdateMode.OnPropertyChanged); variableValue.DataBindings.Add("Text", variables.DataSource, "Value", true, DataSourceUpdateMode.OnPropertyChanged); Resize += Config_Resize; notifyIcon.MouseClick += notifyIcon_MouseClick; }
public static DebugWorkspace GetWorkspace() { string romName = EmuApi.GetRomInfo().GetRomName(); if (_workspace == null || _romName != romName) { if (_workspace != null) { SaveWorkspace(); } _romName = romName; _workspace = DebugWorkspace.GetWorkspace(); //Load watch entries WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries = _workspace.WatchValues; WatchManager.GetWatchManager(CpuType.Spc).WatchEntries = _workspace.SpcWatchValues; WatchManager.GetWatchManager(CpuType.Sa1).WatchEntries = _workspace.Sa1WatchValues; WatchManager.GetWatchManager(CpuType.Gsu).WatchEntries = _workspace.GsuWatchValues; LabelManager.ResetLabels(); LabelManager.SetLabels(_workspace.CpuLabels); LabelManager.SetLabels(_workspace.SpcLabels); LabelManager.SetDefaultLabels(); ImportDbgFile(); LabelManager.RefreshLabels(); //Load breakpoints BreakpointManager.SetBreakpoints(_workspace.Breakpoints); } return(_workspace); }
private void mnuAddToWatch_Click(object sender, EventArgs e) { if (lstLabels.SelectedIndices.Count > 0) { WatchManager.GetWatchManager(_cpuType).AddWatch("[" + GetSelectedLabel().Label + "]"); } }
public static void ResetWorkspace() { if (_workspace != null) { _workspace.Breakpoints = new List <Breakpoint>(); _workspace.WatchValues = new List <string>(); _workspace.SpcWatchValues = new List <string>(); _workspace.Sa1WatchValues = new List <string>(); _workspace.GsuWatchValues = new List <string>(); _workspace.NecDspWatchValues = new List <string>(); _workspace.GbWatchValues = new List <string>(); _workspace.CpuLabels = new List <CodeLabel>(); _workspace.SpcLabels = new List <CodeLabel>(); _workspace.NecDspLabels = new List <CodeLabel>(); _workspace.GbLabels = new List <CodeLabel>(); WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries = _workspace.WatchValues; WatchManager.GetWatchManager(CpuType.Spc).WatchEntries = _workspace.SpcWatchValues; WatchManager.GetWatchManager(CpuType.Sa1).WatchEntries = _workspace.Sa1WatchValues; WatchManager.GetWatchManager(CpuType.Gsu).WatchEntries = _workspace.GsuWatchValues; WatchManager.GetWatchManager(CpuType.NecDsp).WatchEntries = _workspace.NecDspWatchValues; WatchManager.GetWatchManager(CpuType.Gameboy).WatchEntries = _workspace.GbWatchValues; BreakpointManager.SetBreakpoints(_workspace.Breakpoints); LabelManager.SetDefaultLabels(); LabelManager.RefreshLabels(); _workspace.Save(); Clear(); } }
private static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; try { var culture = new CultureInfo(ConfigurationManager.AppSettings["Culture"]); CultureInfo.DefaultThreadCurrentCulture = culture; CultureInfo.DefaultThreadCurrentUICulture = culture; } catch { // Ignored } var config = WatchManagerConfig.GetConfiguration(); var logger = new ConsoleLogger(); IWatchManager watchManager = new WatchManager(config, logger); watchManager.EnableWatching(); while (true) { Console.ReadKey(); } }
private void mnuAddToWatch_Click(object sender, EventArgs e) { if (_memoryType.SupportsWatch()) { string[] toAdd = Enumerable.Range(SelectionStartAddress, SelectionEndAddress - SelectionStartAddress + 1).Select((num) => $"[${num.ToString("X6")}]").ToArray(); WatchManager.GetWatchManager(_memoryType.ToCpuType()).AddWatch(toAdd); } }
private void mnuAddToWatch_Click(object sender, EventArgs e) { if (lstLabels.SelectedIndices.Count > 0) { CodeLabel label = (CodeLabel)GetSelectedItem().SubItems[1].Tag; WatchManager.AddWatch("[" + label.Label + "]"); } }
public static void SaveWorkspace() { if (_workspace != null) { _workspace.WatchValues = new List <string>(WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries); _workspace.SpcWatchValues = new List <string>(WatchManager.GetWatchManager(CpuType.Spc).WatchEntries); _workspace.Breakpoints = new List <Breakpoint>(BreakpointManager.Breakpoints); _workspace.Save(); } }
public static void SaveWorkspace() { if (_workspace != null) { _workspace.WatchValues = new List <string>(WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries); _workspace.SpcWatchValues = new List <string>(WatchManager.GetWatchManager(CpuType.Spc).WatchEntries); _workspace.Sa1WatchValues = new List <string>(WatchManager.GetWatchManager(CpuType.Sa1).WatchEntries); _workspace.GsuWatchValues = new List <string>(WatchManager.GetWatchManager(CpuType.Gsu).WatchEntries); _workspace.Breakpoints = new List <Breakpoint>(BreakpointManager.Breakpoints); _workspace.CpuLabels = new List <CodeLabel>(LabelManager.GetLabels(CpuType.Cpu)); _workspace.SpcLabels = new List <CodeLabel>(LabelManager.GetLabels(CpuType.Spc)); _workspace.Save(); } }
public static void ResetWorkspace() { if (_workspace != null) { _workspace.Breakpoints = new List <Breakpoint>(); _workspace.WatchValues = new List <string>(); _workspace.SpcWatchValues = new List <string>(); WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries = _workspace.WatchValues; WatchManager.GetWatchManager(CpuType.Spc).WatchEntries = _workspace.SpcWatchValues; BreakpointManager.SetBreakpoints(_workspace.Breakpoints); _workspace.Save(); Clear(); } }
private void metroToggle1_CheckedChanged(object sender, System.EventArgs e) { var checkedState = (sender as MetroToggle).CheckState; if (checkedState == CheckState.Checked) { watchStatus.Text = "(Running)"; WatchManager.Start(Settings.Locations, Settings.Variables); } else { watchStatus.Text = "(Not Running)"; WatchManager.Stop(); } }
/// <summary> /// Initializes important variables /// </summary> private void InitBasics() { String dataPath = Path.Combine(PathHelper.DataDir, "FlashDebugger"); if (!Directory.Exists(dataPath)) { Directory.CreateDirectory(dataPath); } this.settingFilename = Path.Combine(dataPath, "Settings.fdb"); this.pluginImage = PluginBase.MainForm.FindImage("54|23|5|4"); breakPointManager = new BreakPointManager(); watchManager = new WatchManager(); debugManager = new DebuggerManager(); liveDataTip = new LiveDataTip(); }
public WatchUI(WatchManager watchManager) { this.AutoKeyHandling = true; this.treeControl = new DataTreeControl(true); this.treeControl.Tree.BorderStyle = BorderStyle.None; this.treeControl.Resize += new EventHandler(this.TreeControlResize); this.treeControl.Tree.Font = PluginBase.Settings.DefaultFont; this.treeControl.Dock = DockStyle.Fill; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.treeControl); this.watchManager = watchManager; this.watchManager.ExpressionAdded += WatchManager_ExpressionAdded; this.watchManager.ExpressionRemoved += WatchManager_ExpressionRemoved; this.watchManager.ExpressionReplaced += WatchManager_ExpressionReplaced; this.watchManager.ExpressionsCleared += WatchManager_ExpressionsCleared; this.watchManager.ExpressionsLoaded += WatchManager_ExpressionsLoaded; }
private void mnuAddToWatch_Click(object sender, EventArgs e) { LocationInfo location = GetActionTarget(); if (location.Symbol != null) { WatchManager.GetWatchManager(_manager.CpuType).AddWatch("[" + location.Symbol.Name + "]"); } else if (location.Label != null) { string label = location.Label.Label; if (location.ArrayIndex.HasValue) { label += "+" + location.ArrayIndex.Value.ToString(); } WatchManager.GetWatchManager(_manager.CpuType).AddWatch("[" + label + "]"); } else if (location.Address >= 0) { WatchManager.GetWatchManager(_manager.CpuType).AddWatch("[$" + location.Address.ToString("X" + _manager.AddressSize.ToString()) + "]"); } }
public static DebugWorkspace GetWorkspace() { string romName = EmuApi.GetRomInfo().GetRomName(); if (_workspace == null || _romName != romName) { if (_workspace != null) { SaveWorkspace(); } _romName = romName; _workspace = DebugWorkspace.GetWorkspace(); //Load watch entries WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries = _workspace.WatchValues; WatchManager.GetWatchManager(CpuType.Spc).WatchEntries = _workspace.SpcWatchValues; //Load breakpoints BreakpointManager.SetBreakpoints(_workspace.Breakpoints); } return(_workspace); }
public static DebugWorkspace GetWorkspace() { string romName = EmuApi.GetRomInfo().GetRomName(); if (_workspace != null) { SaveWorkspace(); } if (_workspace == null || _romName != romName) { _romName = romName; _workspace = DebugWorkspace.GetWorkspace(); //Load watch entries WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries = _workspace.WatchValues; WatchManager.GetWatchManager(CpuType.Spc).WatchEntries = _workspace.SpcWatchValues; WatchManager.GetWatchManager(CpuType.Sa1).WatchEntries = _workspace.Sa1WatchValues; WatchManager.GetWatchManager(CpuType.Gsu).WatchEntries = _workspace.GsuWatchValues; WatchManager.GetWatchManager(CpuType.NecDsp).WatchEntries = _workspace.NecDspWatchValues; WatchManager.GetWatchManager(CpuType.Gameboy).WatchEntries = _workspace.GbWatchValues; LabelManager.ResetLabels(); LabelManager.SetLabels(_workspace.CpuLabels); LabelManager.SetLabels(_workspace.SpcLabels); LabelManager.SetLabels(_workspace.NecDspLabels); LabelManager.SetLabels(_workspace.GbLabels); LabelManager.SetDefaultLabels(); AutoImportSymbols(); } //Send breakpoints & labels to emulation core (even if the same game is running) LabelManager.RefreshLabels(); BreakpointManager.SetBreakpoints(_workspace.Breakpoints); return(_workspace); }
private void AddWatch() { WatchManager.AddWatch(_newWatchValue); }
private void mnuAddToWatch_Click(object sender, EventArgs e) { string[] toAdd = Enumerable.Range(SelectionStartAddress, SelectionEndAddress - SelectionStartAddress + 1).Select((num) => $"[${num.ToString("X4")}]").ToArray(); WatchManager.AddWatch(toAdd); }