diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index 25fde931d5..5373e04070 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -383,6 +383,12 @@ LuaWriterColorConfig.cs + + Form + + + TraceLogger.cs + Component @@ -723,6 +729,9 @@ Cheats.cs Designer + + TraceLogger.cs + VirtualPad.cs Designer diff --git a/BizHawk.MultiClient/MainForm.Designer.cs b/BizHawk.MultiClient/MainForm.Designer.cs index 337bb8121a..278aaefd7d 100644 --- a/BizHawk.MultiClient/MainForm.Designer.cs +++ b/BizHawk.MultiClient/MainForm.Designer.cs @@ -255,6 +255,7 @@ this.EmuStatus = new System.Windows.Forms.ToolStripStatusLabel(); this.PlayRecordStatus = new System.Windows.Forms.ToolStripDropDownButton(); this.PauseStrip = new System.Windows.Forms.ToolStripDropDownButton(); + this.RebootStatusBarIcon = new System.Windows.Forms.ToolStripStatusLabel(); this.AVIStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.StatusSlot1 = new System.Windows.Forms.ToolStripStatusLabel(); @@ -268,7 +269,6 @@ this.StatusSlot9 = new System.Windows.Forms.ToolStripStatusLabel(); this.StatusSlot10 = new System.Windows.Forms.ToolStripStatusLabel(); this.CheatStatus = new System.Windows.Forms.ToolStripStatusLabel(); - this.RebootStatusBarIcon = new System.Windows.Forms.ToolStripStatusLabel(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.cmiOpenRom = new System.Windows.Forms.ToolStripMenuItem(); this.cmiLoadLastRom = new System.Windows.Forms.ToolStripMenuItem(); @@ -289,6 +289,7 @@ this.cmiScreenshotClipboard = new System.Windows.Forms.ToolStripMenuItem(); this.cmiCloseRom = new System.Windows.Forms.ToolStripMenuItem(); this.cmiShowMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.traceLoggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.StatusSlot0.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); @@ -1654,6 +1655,7 @@ this.rAMSearchToolStripMenuItem, this.rAMPokeToolStripMenuItem, this.hexEditorToolStripMenuItem, + this.traceLoggerToolStripMenuItem, this.tAStudioToolStripMenuItem, this.toolStripSeparator11, this.luaConsoleToolStripMenuItem, @@ -1667,20 +1669,20 @@ // this.toolBoxToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.ToolBox; this.toolBoxToolStripMenuItem.Name = "toolBoxToolStripMenuItem"; - this.toolBoxToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.toolBoxToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.toolBoxToolStripMenuItem.Text = "&Tool Box"; this.toolBoxToolStripMenuItem.Click += new System.EventHandler(this.toolBoxToolStripMenuItem_Click); // // toolStripSeparator12 // this.toolStripSeparator12.Name = "toolStripSeparator12"; - this.toolStripSeparator12.Size = new System.Drawing.Size(136, 6); + this.toolStripSeparator12.Size = new System.Drawing.Size(149, 6); // // rAMWatchToolStripMenuItem // this.rAMWatchToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.FindHS; this.rAMWatchToolStripMenuItem.Name = "rAMWatchToolStripMenuItem"; - this.rAMWatchToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.rAMWatchToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.rAMWatchToolStripMenuItem.Text = "RAM &Watch"; this.rAMWatchToolStripMenuItem.Click += new System.EventHandler(this.RAMWatchToolStripMenuItem_Click); // @@ -1688,7 +1690,7 @@ // this.rAMSearchToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.search; this.rAMSearchToolStripMenuItem.Name = "rAMSearchToolStripMenuItem"; - this.rAMSearchToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.rAMSearchToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.rAMSearchToolStripMenuItem.Text = "RAM &Search"; this.rAMSearchToolStripMenuItem.Click += new System.EventHandler(this.rAMSearchToolStripMenuItem_Click); // @@ -1696,7 +1698,7 @@ // this.rAMPokeToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.poke; this.rAMPokeToolStripMenuItem.Name = "rAMPokeToolStripMenuItem"; - this.rAMPokeToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.rAMPokeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.rAMPokeToolStripMenuItem.Text = "RAM &Poke"; this.rAMPokeToolStripMenuItem.Click += new System.EventHandler(this.RAMPokeToolStripMenuItem_Click); // @@ -1704,7 +1706,7 @@ // this.hexEditorToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.poke; this.hexEditorToolStripMenuItem.Name = "hexEditorToolStripMenuItem"; - this.hexEditorToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.hexEditorToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.hexEditorToolStripMenuItem.Text = "&Hex Editor"; this.hexEditorToolStripMenuItem.Click += new System.EventHandler(this.hexEditorToolStripMenuItem_Click); // @@ -1712,20 +1714,20 @@ // this.tAStudioToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.TAStudio; this.tAStudioToolStripMenuItem.Name = "tAStudioToolStripMenuItem"; - this.tAStudioToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.tAStudioToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.tAStudioToolStripMenuItem.Text = "&TAStudio"; this.tAStudioToolStripMenuItem.Click += new System.EventHandler(this.tAStudioToolStripMenuItem_Click); // // toolStripSeparator11 // this.toolStripSeparator11.Name = "toolStripSeparator11"; - this.toolStripSeparator11.Size = new System.Drawing.Size(136, 6); + this.toolStripSeparator11.Size = new System.Drawing.Size(149, 6); // // luaConsoleToolStripMenuItem // this.luaConsoleToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Lua; this.luaConsoleToolStripMenuItem.Name = "luaConsoleToolStripMenuItem"; - this.luaConsoleToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.luaConsoleToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.luaConsoleToolStripMenuItem.Text = "Lua Console"; this.luaConsoleToolStripMenuItem.Click += new System.EventHandler(this.luaConsoleToolStripMenuItem_Click); // @@ -1733,7 +1735,7 @@ // this.cheatsToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Freeze; this.cheatsToolStripMenuItem.Name = "cheatsToolStripMenuItem"; - this.cheatsToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.cheatsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.cheatsToolStripMenuItem.Text = "Cheats"; this.cheatsToolStripMenuItem.Click += new System.EventHandler(this.cheatsToolStripMenuItem_Click); // @@ -2226,6 +2228,17 @@ this.PauseStrip.ToolTipText = "Emulator is paused"; this.PauseStrip.Click += new System.EventHandler(this.PauseStrip_Click); // + // RebootStatusBarIcon + // + this.RebootStatusBarIcon.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.RebootStatusBarIcon.Image = global::BizHawk.MultiClient.Properties.Resources.reboot; + this.RebootStatusBarIcon.Name = "RebootStatusBarIcon"; + this.RebootStatusBarIcon.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.RebootStatusBarIcon.Size = new System.Drawing.Size(16, 17); + this.RebootStatusBarIcon.Text = "Reboot"; + this.RebootStatusBarIcon.ToolTipText = "A reboot of the core is needed for a setting change to take affect"; + this.RebootStatusBarIcon.Click += new System.EventHandler(this.toolStripStatusLabel2_Click); + // // AVIStatusLabel // this.AVIStatusLabel.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; @@ -2317,17 +2330,6 @@ this.CheatStatus.Size = new System.Drawing.Size(0, 17); this.CheatStatus.Click += new System.EventHandler(this.FreezeStatus_Click); // - // RebootStatusBarIcon - // - this.RebootStatusBarIcon.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.RebootStatusBarIcon.Image = global::BizHawk.MultiClient.Properties.Resources.reboot; - this.RebootStatusBarIcon.Name = "RebootStatusBarIcon"; - this.RebootStatusBarIcon.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.RebootStatusBarIcon.Size = new System.Drawing.Size(16, 17); - this.RebootStatusBarIcon.Text = "Reboot"; - this.RebootStatusBarIcon.ToolTipText = "A reboot of the core is needed for a setting change to take affect"; - this.RebootStatusBarIcon.Click += new System.EventHandler(this.toolStripStatusLabel2_Click); - // // contextMenuStrip1 // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -2492,6 +2494,13 @@ this.cmiShowMenu.Text = "Show Menu"; this.cmiShowMenu.Click += new System.EventHandler(this.showMenuToolStripMenuItem_Click); // + // traceLoggerToolStripMenuItem + // + this.traceLoggerToolStripMenuItem.Name = "traceLoggerToolStripMenuItem"; + this.traceLoggerToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.traceLoggerToolStripMenuItem.Text = "Trace &Logger"; + this.traceLoggerToolStripMenuItem.Click += new System.EventHandler(this.traceLoggerToolStripMenuItem_Click); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); @@ -2792,6 +2801,7 @@ private System.Windows.Forms.ToolStripMenuItem loadGBInSGBToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem backupSaveramToolStripMenuItem; private System.Windows.Forms.ToolStripStatusLabel RebootStatusBarIcon; + private System.Windows.Forms.ToolStripMenuItem traceLoggerToolStripMenuItem; } } diff --git a/BizHawk.MultiClient/MainForm.MenuItems.cs b/BizHawk.MultiClient/MainForm.MenuItems.cs index c29079845b..9e81e58cf1 100644 --- a/BizHawk.MultiClient/MainForm.MenuItems.cs +++ b/BizHawk.MultiClient/MainForm.MenuItems.cs @@ -621,6 +621,15 @@ namespace BizHawk.MultiClient luaConsoleToolStripMenuItem.ShortcutKeyDisplayString = Global.Config.LuaConsole; cheatsToolStripMenuItem.ShortcutKeyDisplayString = Global.Config.Cheats; tAStudioToolStripMenuItem.ShortcutKeyDisplayString = Global.Config.TASTudio; + + if (INTERIM) + { + traceLoggerToolStripMenuItem.Visible = true; + } + else + { + traceLoggerToolStripMenuItem.Visible = false; + } } private void saveSlotToolStripMenuItem_DropDownOpened(object sender, EventArgs e) diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 486aee6677..c724d0d241 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -70,6 +70,7 @@ namespace BizHawk.MultiClient public RamWatch RamWatch1 = new RamWatch(); public RamSearch RamSearch1 = new RamSearch(); public HexEditor HexEditor1 = new HexEditor(); + public TraceLogger TraceLogger1 = new TraceLogger(); public SNESGraphicsDebugger SNESGraphicsDebugger1 = new SNESGraphicsDebugger(); public NESNameTableViewer NESNameTableViewer1 = new NESNameTableViewer(); public NESPPU NESPPU1 = new NESPPU(); @@ -2304,6 +2305,7 @@ namespace BizHawk.MultiClient LuaConsole1.LuaImp.FrameRegisterAfter(); TAStudio1.UpdateValues(); SNESGraphicsDebugger1.UpdateToolsAfter(); + TraceLogger1.UpdateValues(); } private unsafe Image MakeScreenshotImage() @@ -2571,6 +2573,17 @@ namespace BizHawk.MultiClient HexEditor1.Focus(); } + public void LoadTraceLogger() + { + if (!TraceLogger1.IsHandleCreated || TraceLogger1.IsDisposed) + { + TraceLogger1 = new TraceLogger(); + TraceLogger1.Show(); + } + else + TraceLogger1.Focus(); + } + public void LoadToolBox() { if (!ToolBox1.IsHandleCreated || ToolBox1.IsDisposed) @@ -2888,6 +2901,7 @@ namespace BizHawk.MultiClient CloseForm(Cheats1); CloseForm(TI83KeyPad1); CloseForm(TAStudio1); + CloseForm(TraceLogger1); #if WINDOWS CloseForm(LuaConsole1); #endif @@ -3759,5 +3773,10 @@ namespace BizHawk.MultiClient SetRebootIconStatus(); Global.OSD.AddMessage("Core reboot needed for this setting"); } + + private void traceLoggerToolStripMenuItem_Click(object sender, EventArgs e) + { + LoadTraceLogger(); + } } } diff --git a/BizHawk.MultiClient/tools/TraceLogger.Designer.cs b/BizHawk.MultiClient/tools/TraceLogger.Designer.cs new file mode 100644 index 0000000000..a7d061f823 --- /dev/null +++ b/BizHawk.MultiClient/tools/TraceLogger.Designer.cs @@ -0,0 +1,204 @@ +namespace BizHawk.MultiClient +{ + partial class TraceLogger + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.TraceView = new BizHawk.VirtualListView(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.ClearButton = new System.Windows.Forms.Button(); + this.LoggingEnabled = new System.Windows.Forms.CheckBox(); + this.groupBox1.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // TraceView + // + this.TraceView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.TraceView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1}); + this.TraceView.FullRowSelect = true; + this.TraceView.GridLines = true; + this.TraceView.HideSelection = false; + this.TraceView.ItemCount = 0; + this.TraceView.Location = new System.Drawing.Point(9, 16); + this.TraceView.Name = "TraceView"; + this.TraceView.selectedItem = -1; + this.TraceView.Size = new System.Drawing.Size(320, 386); + this.TraceView.TabIndex = 0; + this.TraceView.UseCompatibleStateImageBehavior = false; + this.TraceView.View = System.Windows.Forms.View.Details; + this.TraceView.VirtualMode = true; + // + // columnHeader1 + // + this.columnHeader1.Text = "Instructions"; + this.columnHeader1.Width = 316; + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.TraceView); + this.groupBox1.Location = new System.Drawing.Point(12, 27); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(337, 411); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Trace log"; + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItem1, + this.fileToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(555, 24); + this.menuStrip1.TabIndex = 2; + this.menuStrip1.Text = "menuStrip1"; + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(12, 20); + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.saveLogToolStripMenuItem, + this.toolStripSeparator1, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "&File"; + // + // saveLogToolStripMenuItem + // + this.saveLogToolStripMenuItem.Enabled = false; + this.saveLogToolStripMenuItem.Name = "saveLogToolStripMenuItem"; + this.saveLogToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.saveLogToolStripMenuItem.Text = "&Save Log"; + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(131, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.ShortcutKeyDisplayString = "Alt+F4"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.exitToolStripMenuItem.Text = "E&xit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.ClearButton); + this.groupBox2.Controls.Add(this.LoggingEnabled); + this.groupBox2.Location = new System.Drawing.Point(356, 27); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(187, 411); + this.groupBox2.TabIndex = 3; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Control"; + // + // ClearButton + // + this.ClearButton.Location = new System.Drawing.Point(15, 73); + this.ClearButton.Name = "ClearButton"; + this.ClearButton.Size = new System.Drawing.Size(75, 23); + this.ClearButton.TabIndex = 1; + this.ClearButton.Text = "&Clear"; + this.ClearButton.UseVisualStyleBackColor = true; + this.ClearButton.Click += new System.EventHandler(this.ClearButton_Click); + // + // LoggingEnabled + // + this.LoggingEnabled.Appearance = System.Windows.Forms.Appearance.Button; + this.LoggingEnabled.AutoSize = true; + this.LoggingEnabled.Location = new System.Drawing.Point(15, 31); + this.LoggingEnabled.Name = "LoggingEnabled"; + this.LoggingEnabled.Size = new System.Drawing.Size(97, 23); + this.LoggingEnabled.TabIndex = 0; + this.LoggingEnabled.Text = "&Logging Enabled"; + this.LoggingEnabled.UseVisualStyleBackColor = true; + this.LoggingEnabled.CheckedChanged += new System.EventHandler(this.LoggingEnabled_CheckedChanged); + // + // TraceLogger + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(555, 450); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; + this.Name = "TraceLogger"; + this.Text = "TraceLogger"; + this.Load += new System.EventHandler(this.TraceLogger_Load); + this.groupBox1.ResumeLayout(false); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private VirtualListView TraceView; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveLogToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.CheckBox LoggingEnabled; + private System.Windows.Forms.Button ClearButton; + private System.Windows.Forms.ColumnHeader columnHeader1; + } +} \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/TraceLogger.cs b/BizHawk.MultiClient/tools/TraceLogger.cs new file mode 100644 index 0000000000..d80c15416e --- /dev/null +++ b/BizHawk.MultiClient/tools/TraceLogger.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace BizHawk.MultiClient +{ + public partial class TraceLogger : Form + { + List Instructions = new List(); + + public TraceLogger() + { + InitializeComponent(); + TraceView.QueryItemText += new QueryItemTextHandler(TraceView_QueryItemText); + TraceView.QueryItemBkColor += new QueryItemBkColorHandler(TraceView_QueryItemBkColor); + TraceView.VirtualMode = true; + Closing += (o, e) => SaveConfigSettings(); + } + + public void SaveConfigSettings() + { + //TODO + } + + private void TraceView_QueryItemBkColor(int index, int column, ref Color color) + { + //TODO + } + + void TraceView_QueryItemText(int index, int column, out string text) + { + text = Instructions[index]; + } + + private void TraceLogger_Load(object sender, EventArgs e) + { + ClearList(); + LoggingEnabled.Checked = true; + //Global.CoreInputComm.CpuTraceEnable = true; + } + + public void UpdateValues() + { + DoInstructions(); + TraceView.Refresh(); + } + + public void Restart() + { + if (!this.IsHandleCreated || this.IsDisposed) + { + return; + } + else + { + ClearList(); + } + } + + private void ClearList() + { + Instructions.Clear(); + TraceView.Clear(); + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + private void LoggingEnabled_CheckedChanged(object sender, EventArgs e) + { + Global.CoreInputComm.CpuTraceEnable = LoggingEnabled.Checked; + } + + private void ClearButton_Click(object sender, EventArgs e) + { + ClearList(); + } + + private void DoInstructions() + { + //using (Global.CoreInputComm.CpuTraceStream) + //{ + Instructions.Add("FART 0x15"); + TraceView.ItemCount = Instructions.Count; + //} + } + } +} diff --git a/BizHawk.MultiClient/tools/TraceLogger.resx b/BizHawk.MultiClient/tools/TraceLogger.resx new file mode 100644 index 0000000000..0f6d8eb42b --- /dev/null +++ b/BizHawk.MultiClient/tools/TraceLogger.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file