mirror of
https://github.com/libretro/Mesen.git
synced 2024-12-13 11:57:09 +00:00
Debugger: Added option to display info popups about opcodes
This commit is contained in:
parent
35d727e0bc
commit
e8858a1a2f
@ -118,6 +118,7 @@ namespace Mesen.GUI.Config
|
||||
public int PpuDisplayScanline = 241;
|
||||
|
||||
public bool ShowCodePreview = true;
|
||||
public bool ShowOpCodeTooltips = false;
|
||||
|
||||
public bool ShowCpuMemoryMapping = true;
|
||||
public bool ShowPpuMemoryMapping = true;
|
||||
|
@ -38,7 +38,7 @@ namespace Mesen.GUI.Debugger
|
||||
|
||||
private UInt32? _currentActiveAddress { get; set; } = null;
|
||||
|
||||
private frmCodeTooltip _codeTooltip = null;
|
||||
private Form _codeTooltip = null;
|
||||
|
||||
public ctrlDebuggerCode()
|
||||
{
|
||||
@ -359,14 +359,18 @@ namespace Mesen.GUI.Debugger
|
||||
_codeTooltip = null;
|
||||
}
|
||||
|
||||
bool isPrgRom = false;
|
||||
if(address >= 0 && ConfigManager.Config.DebugInfo.ShowCodePreview) {
|
||||
AddressTypeInfo addressInfo = new AddressTypeInfo();
|
||||
InteropEmu.DebugGetAbsoluteAddressAndType((UInt32)address, ref addressInfo);
|
||||
isPrgRom = addressInfo.Type == AddressType.PrgRom;
|
||||
}
|
||||
if(ConfigManager.Config.DebugInfo.ShowOpCodeTooltips && frmOpCodeTooltip.IsOpCode(word)) {
|
||||
_codeTooltip = new frmOpCodeTooltip(word);
|
||||
} else {
|
||||
bool isPrgRom = false;
|
||||
if(address >= 0 && ConfigManager.Config.DebugInfo.ShowCodePreview) {
|
||||
AddressTypeInfo addressInfo = new AddressTypeInfo();
|
||||
InteropEmu.DebugGetAbsoluteAddressAndType((UInt32)address, ref addressInfo);
|
||||
isPrgRom = addressInfo.Type == AddressType.PrgRom;
|
||||
}
|
||||
|
||||
_codeTooltip = new frmCodeTooltip(values, isPrgRom ? address : -1, isPrgRom ? _code : null);
|
||||
_codeTooltip = new frmCodeTooltip(values, isPrgRom ? address : -1, isPrgRom ? _code : null);
|
||||
}
|
||||
_codeTooltip.Left = Cursor.Position.X + 10;
|
||||
_codeTooltip.Top = Cursor.Position.Y + 10;
|
||||
_codeTooltip.Show(this);
|
||||
@ -428,6 +432,8 @@ namespace Mesen.GUI.Debugger
|
||||
|
||||
if(label != null) {
|
||||
DisplayLabelTooltip(word, label);
|
||||
} else if(ConfigManager.Config.DebugInfo.ShowOpCodeTooltips && frmOpCodeTooltip.IsOpCode(word)) {
|
||||
ShowTooltip(word, null, -1);
|
||||
}
|
||||
}
|
||||
_previousLocation = e.Location;
|
||||
|
72
GUI.NET/Debugger/Controls/ctrlFlagStatus.Designer.cs
generated
Normal file
72
GUI.NET/Debugger/Controls/ctrlFlagStatus.Designer.cs
generated
Normal file
@ -0,0 +1,72 @@
|
||||
namespace Mesen.GUI.Debugger.Controls
|
||||
{
|
||||
partial class ctrlFlagStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.lblLetter = new System.Windows.Forms.Label();
|
||||
this.panel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BackColor = System.Drawing.Color.LightGray;
|
||||
this.panel2.Controls.Add(this.lblLetter);
|
||||
this.panel2.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(20, 20);
|
||||
this.panel2.TabIndex = 2;
|
||||
//
|
||||
// lblLetter
|
||||
//
|
||||
this.lblLetter.BackColor = System.Drawing.Color.White;
|
||||
this.lblLetter.Location = new System.Drawing.Point(2, 2);
|
||||
this.lblLetter.Name = "lblLetter";
|
||||
this.lblLetter.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
|
||||
this.lblLetter.Size = new System.Drawing.Size(16, 16);
|
||||
this.lblLetter.TabIndex = 2;
|
||||
this.lblLetter.Text = "C";
|
||||
this.lblLetter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// ctrlFlagStatus
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Name = "ctrlFlagStatus";
|
||||
this.Size = new System.Drawing.Size(20, 20);
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Label lblLetter;
|
||||
}
|
||||
}
|
37
GUI.NET/Debugger/Controls/ctrlFlagStatus.cs
Normal file
37
GUI.NET/Debugger/Controls/ctrlFlagStatus.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Mesen.GUI.Debugger.Controls
|
||||
{
|
||||
public partial class ctrlFlagStatus : UserControl
|
||||
{
|
||||
public ctrlFlagStatus()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public bool Active
|
||||
{
|
||||
set
|
||||
{
|
||||
panel2.BackColor = value ? Color.Red : Color.LightGray;
|
||||
lblLetter.BackColor = value ? Color.White : Color.DarkGray;
|
||||
}
|
||||
}
|
||||
|
||||
public string Letter
|
||||
{
|
||||
set
|
||||
{
|
||||
lblLetter.Text = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
GUI.NET/Debugger/Controls/ctrlFlagStatus.resx
Normal file
120
GUI.NET/Debugger/Controls/ctrlFlagStatus.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
43
GUI.NET/Debugger/frmDebugger.Designer.cs
generated
43
GUI.NET/Debugger/frmDebugger.Designer.cs
generated
@ -125,7 +125,9 @@ namespace Mesen.GUI.Debugger
|
||||
this.mnuShowPpuMemoryMapping = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuShowFunctionLabelLists = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuShowBottomPanel = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem18 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.mnuShowCodePreview = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuShowOpCodeTooltips = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.mnuPpuPartialDraw = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuRefreshWatchWhileRunning = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@ -228,7 +230,7 @@ namespace Mesen.GUI.Debugger
|
||||
this.ctrlSplitContainerTop.Panel2.Controls.Add(this.tlpFunctionLabelLists);
|
||||
this.ctrlSplitContainerTop.Panel2MinSize = 150;
|
||||
this.ctrlSplitContainerTop.Size = new System.Drawing.Size(1172, 400);
|
||||
this.ctrlSplitContainerTop.SplitterDistance = 848;
|
||||
this.ctrlSplitContainerTop.SplitterDistance = 842;
|
||||
this.ctrlSplitContainerTop.SplitterWidth = 7;
|
||||
this.ctrlSplitContainerTop.TabIndex = 3;
|
||||
this.ctrlSplitContainerTop.PanelCollapsed += new System.EventHandler(this.ctrlSplitContainerTop_PanelCollapsed);
|
||||
@ -249,7 +251,7 @@ namespace Mesen.GUI.Debugger
|
||||
this.tlpTop.Name = "tlpTop";
|
||||
this.tlpTop.RowCount = 1;
|
||||
this.tlpTop.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tlpTop.Size = new System.Drawing.Size(848, 400);
|
||||
this.tlpTop.Size = new System.Drawing.Size(842, 400);
|
||||
this.tlpTop.TabIndex = 2;
|
||||
//
|
||||
// ctrlDebuggerCode
|
||||
@ -258,17 +260,17 @@ namespace Mesen.GUI.Debugger
|
||||
this.ctrlDebuggerCode.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlDebuggerCode.Location = new System.Drawing.Point(3, 3);
|
||||
this.ctrlDebuggerCode.Name = "ctrlDebuggerCode";
|
||||
this.ctrlDebuggerCode.Size = new System.Drawing.Size(384, 394);
|
||||
this.ctrlDebuggerCode.Size = new System.Drawing.Size(378, 394);
|
||||
this.ctrlDebuggerCode.TabIndex = 2;
|
||||
this.ctrlDebuggerCode.OnEditCode += new Mesen.GUI.Debugger.ctrlDebuggerCode.AssemblerEventHandler(this.ctrlDebuggerCode_OnEditCode);
|
||||
this.ctrlDebuggerCode.OnScrollToAddress += new Mesen.GUI.Debugger.ctrlDebuggerCode.AddressEventHandler(this.ctrlDebuggerCode_OnScrollToAddress);
|
||||
this.ctrlDebuggerCode.OnSetNextStatement += new Mesen.GUI.Debugger.ctrlDebuggerCode.AddressEventHandler(this.ctrlDebuggerCode_OnSetNextStatement);
|
||||
this.ctrlDebuggerCode.OnScrollToAddress += new Mesen.GUI.Debugger.ctrlDebuggerCode.AddressEventHandler(this.ctrlDebuggerCode_OnScrollToAddress);
|
||||
this.ctrlDebuggerCode.Enter += new System.EventHandler(this.ctrlDebuggerCode_Enter);
|
||||
//
|
||||
// ctrlConsoleStatus
|
||||
//
|
||||
this.ctrlConsoleStatus.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlConsoleStatus.Location = new System.Drawing.Point(390, 0);
|
||||
this.ctrlConsoleStatus.Location = new System.Drawing.Point(384, 0);
|
||||
this.ctrlConsoleStatus.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.ctrlConsoleStatus.Name = "ctrlConsoleStatus";
|
||||
this.ctrlConsoleStatus.Size = new System.Drawing.Size(458, 400);
|
||||
@ -279,14 +281,14 @@ namespace Mesen.GUI.Debugger
|
||||
//
|
||||
this.ctrlDebuggerCodeSplit.Code = null;
|
||||
this.ctrlDebuggerCodeSplit.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlDebuggerCodeSplit.Location = new System.Drawing.Point(393, 3);
|
||||
this.ctrlDebuggerCodeSplit.Location = new System.Drawing.Point(387, 3);
|
||||
this.ctrlDebuggerCodeSplit.Name = "ctrlDebuggerCodeSplit";
|
||||
this.ctrlDebuggerCodeSplit.Size = new System.Drawing.Size(1, 394);
|
||||
this.ctrlDebuggerCodeSplit.TabIndex = 4;
|
||||
this.ctrlDebuggerCodeSplit.Visible = false;
|
||||
this.ctrlDebuggerCodeSplit.OnEditCode += new Mesen.GUI.Debugger.ctrlDebuggerCode.AssemblerEventHandler(this.ctrlDebuggerCode_OnEditCode);
|
||||
this.ctrlDebuggerCodeSplit.OnScrollToAddress += new Mesen.GUI.Debugger.ctrlDebuggerCode.AddressEventHandler(this.ctrlDebuggerCode_OnScrollToAddress);
|
||||
this.ctrlDebuggerCodeSplit.OnSetNextStatement += new Mesen.GUI.Debugger.ctrlDebuggerCode.AddressEventHandler(this.ctrlDebuggerCode_OnSetNextStatement);
|
||||
this.ctrlDebuggerCodeSplit.OnScrollToAddress += new Mesen.GUI.Debugger.ctrlDebuggerCode.AddressEventHandler(this.ctrlDebuggerCode_OnScrollToAddress);
|
||||
this.ctrlDebuggerCodeSplit.Enter += new System.EventHandler(this.ctrlDebuggerCodeSplit_Enter);
|
||||
//
|
||||
// tlpFunctionLabelLists
|
||||
@ -302,7 +304,7 @@ namespace Mesen.GUI.Debugger
|
||||
this.tlpFunctionLabelLists.RowCount = 2;
|
||||
this.tlpFunctionLabelLists.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tlpFunctionLabelLists.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tlpFunctionLabelLists.Size = new System.Drawing.Size(317, 400);
|
||||
this.tlpFunctionLabelLists.Size = new System.Drawing.Size(323, 400);
|
||||
this.tlpFunctionLabelLists.TabIndex = 5;
|
||||
//
|
||||
// grpLabels
|
||||
@ -311,7 +313,7 @@ namespace Mesen.GUI.Debugger
|
||||
this.grpLabels.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.grpLabels.Location = new System.Drawing.Point(3, 203);
|
||||
this.grpLabels.Name = "grpLabels";
|
||||
this.grpLabels.Size = new System.Drawing.Size(311, 194);
|
||||
this.grpLabels.Size = new System.Drawing.Size(317, 194);
|
||||
this.grpLabels.TabIndex = 6;
|
||||
this.grpLabels.TabStop = false;
|
||||
this.grpLabels.Text = "Labels";
|
||||
@ -321,7 +323,7 @@ namespace Mesen.GUI.Debugger
|
||||
this.ctrlLabelList.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlLabelList.Location = new System.Drawing.Point(3, 16);
|
||||
this.ctrlLabelList.Name = "ctrlLabelList";
|
||||
this.ctrlLabelList.Size = new System.Drawing.Size(305, 175);
|
||||
this.ctrlLabelList.Size = new System.Drawing.Size(311, 175);
|
||||
this.ctrlLabelList.TabIndex = 0;
|
||||
this.ctrlLabelList.OnFindOccurrence += new System.EventHandler(this.ctrlLabelList_OnFindOccurrence);
|
||||
this.ctrlLabelList.OnLabelSelected += new System.EventHandler(this.ctrlLabelList_OnLabelSelected);
|
||||
@ -332,7 +334,7 @@ namespace Mesen.GUI.Debugger
|
||||
this.grpFunctions.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.grpFunctions.Location = new System.Drawing.Point(3, 3);
|
||||
this.grpFunctions.Name = "grpFunctions";
|
||||
this.grpFunctions.Size = new System.Drawing.Size(311, 194);
|
||||
this.grpFunctions.Size = new System.Drawing.Size(317, 194);
|
||||
this.grpFunctions.TabIndex = 5;
|
||||
this.grpFunctions.TabStop = false;
|
||||
this.grpFunctions.Text = "Functions";
|
||||
@ -342,7 +344,7 @@ namespace Mesen.GUI.Debugger
|
||||
this.ctrlFunctionList.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlFunctionList.Location = new System.Drawing.Point(3, 16);
|
||||
this.ctrlFunctionList.Name = "ctrlFunctionList";
|
||||
this.ctrlFunctionList.Size = new System.Drawing.Size(305, 175);
|
||||
this.ctrlFunctionList.Size = new System.Drawing.Size(311, 175);
|
||||
this.ctrlFunctionList.TabIndex = 0;
|
||||
this.ctrlFunctionList.OnFindOccurrence += new System.EventHandler(this.ctrlFunctionList_OnFindOccurrence);
|
||||
this.ctrlFunctionList.OnFunctionSelected += new System.EventHandler(this.ctrlFunctionList_OnFunctionSelected);
|
||||
@ -846,7 +848,9 @@ namespace Mesen.GUI.Debugger
|
||||
this.mnuShowPpuMemoryMapping,
|
||||
this.mnuShowFunctionLabelLists,
|
||||
this.mnuShowBottomPanel,
|
||||
this.toolStripMenuItem18,
|
||||
this.mnuShowCodePreview,
|
||||
this.mnuShowOpCodeTooltips,
|
||||
this.toolStripMenuItem6,
|
||||
this.mnuPpuPartialDraw,
|
||||
this.mnuRefreshWatchWhileRunning});
|
||||
@ -1082,6 +1086,11 @@ namespace Mesen.GUI.Debugger
|
||||
this.mnuShowBottomPanel.Text = "Show Watch/Breakpoints/Callstack";
|
||||
this.mnuShowBottomPanel.Click += new System.EventHandler(this.mnuShowBottomPanel_Click);
|
||||
//
|
||||
// toolStripMenuItem18
|
||||
//
|
||||
this.toolStripMenuItem18.Name = "toolStripMenuItem18";
|
||||
this.toolStripMenuItem18.Size = new System.Drawing.Size(256, 6);
|
||||
//
|
||||
// mnuShowCodePreview
|
||||
//
|
||||
this.mnuShowCodePreview.CheckOnClick = true;
|
||||
@ -1090,6 +1099,14 @@ namespace Mesen.GUI.Debugger
|
||||
this.mnuShowCodePreview.Text = "Show Code Preview in Tooltips";
|
||||
this.mnuShowCodePreview.CheckedChanged += new System.EventHandler(this.mnuShowCodePreview_CheckedChanged);
|
||||
//
|
||||
// mnuShowOpCodeTooltips
|
||||
//
|
||||
this.mnuShowOpCodeTooltips.CheckOnClick = true;
|
||||
this.mnuShowOpCodeTooltips.Name = "mnuShowOpCodeTooltips";
|
||||
this.mnuShowOpCodeTooltips.Size = new System.Drawing.Size(259, 22);
|
||||
this.mnuShowOpCodeTooltips.Text = "Show OP Code Info Tooltips";
|
||||
this.mnuShowOpCodeTooltips.CheckedChanged += new System.EventHandler(this.mnuShowOpCodeTooltips_CheckedChanged);
|
||||
//
|
||||
// toolStripMenuItem6
|
||||
//
|
||||
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
|
||||
@ -1534,5 +1551,7 @@ namespace Mesen.GUI.Debugger
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem5;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuApuViewer;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuShowCodePreview;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem18;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuShowOpCodeTooltips;
|
||||
}
|
||||
}
|
@ -707,6 +707,12 @@ namespace Mesen.GUI.Debugger
|
||||
ConfigManager.ApplyChanges();
|
||||
}
|
||||
|
||||
private void mnuShowOpCodeTooltips_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ConfigManager.Config.DebugInfo.ShowOpCodeTooltips = mnuShowOpCodeTooltips.Checked;
|
||||
ConfigManager.ApplyChanges();
|
||||
}
|
||||
|
||||
private void mnuHighlightUnexecutedCode_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConfigManager.Config.DebugInfo.HighlightUnexecutedCode = mnuHighlightUnexecutedCode.Checked;
|
||||
|
221
GUI.NET/Debugger/frmOpCodeTooltip.Designer.cs
generated
Normal file
221
GUI.NET/Debugger/frmOpCodeTooltip.Designer.cs
generated
Normal file
@ -0,0 +1,221 @@
|
||||
namespace Mesen.GUI.Debugger
|
||||
{
|
||||
partial class frmOpCodeTooltip
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.ctrlFlagNegative = new Mesen.GUI.Debugger.Controls.ctrlFlagStatus();
|
||||
this.ctrlFlagOverflow = new Mesen.GUI.Debugger.Controls.ctrlFlagStatus();
|
||||
this.ctrlFlagDecimal = new Mesen.GUI.Debugger.Controls.ctrlFlagStatus();
|
||||
this.ctrlFlagInterrupt = new Mesen.GUI.Debugger.Controls.ctrlFlagStatus();
|
||||
this.ctrlFlagZero = new Mesen.GUI.Debugger.Controls.ctrlFlagStatus();
|
||||
this.ctrlFlagCarry = new Mesen.GUI.Debugger.Controls.ctrlFlagStatus();
|
||||
this.lblName = new System.Windows.Forms.Label();
|
||||
this.lblOpCodeDescription = new System.Windows.Forms.Label();
|
||||
this.lblAffectedStatusFlags = new System.Windows.Forms.Label();
|
||||
this.panel1.SuspendLayout();
|
||||
this.tlpMain.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.AutoSize = true;
|
||||
this.panel1.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel1.Controls.Add(this.tlpMain);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(305, 96);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// tlpMain
|
||||
//
|
||||
this.tlpMain.AutoSize = true;
|
||||
this.tlpMain.ColumnCount = 8;
|
||||
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 35F));
|
||||
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 35F));
|
||||
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 35F));
|
||||
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 35F));
|
||||
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 35F));
|
||||
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 35F));
|
||||
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tlpMain.Controls.Add(this.lblAffectedStatusFlags, 0, 2);
|
||||
this.tlpMain.Controls.Add(this.ctrlFlagNegative, 6, 3);
|
||||
this.tlpMain.Controls.Add(this.ctrlFlagOverflow, 5, 3);
|
||||
this.tlpMain.Controls.Add(this.ctrlFlagDecimal, 4, 3);
|
||||
this.tlpMain.Controls.Add(this.ctrlFlagInterrupt, 3, 3);
|
||||
this.tlpMain.Controls.Add(this.ctrlFlagZero, 2, 3);
|
||||
this.tlpMain.Controls.Add(this.ctrlFlagCarry, 1, 3);
|
||||
this.tlpMain.Controls.Add(this.lblName, 0, 0);
|
||||
this.tlpMain.Controls.Add(this.lblOpCodeDescription, 0, 1);
|
||||
this.tlpMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.tlpMain.MaximumSize = new System.Drawing.Size(295, 0);
|
||||
this.tlpMain.MinimumSize = new System.Drawing.Size(295, 0);
|
||||
this.tlpMain.Name = "tlpMain";
|
||||
this.tlpMain.RowCount = 5;
|
||||
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
|
||||
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tlpMain.Size = new System.Drawing.Size(295, 92);
|
||||
this.tlpMain.TabIndex = 0;
|
||||
//
|
||||
// ctrlFlagNegative
|
||||
//
|
||||
this.ctrlFlagNegative.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.ctrlFlagNegative.Location = new System.Drawing.Point(224, 69);
|
||||
this.ctrlFlagNegative.Name = "ctrlFlagNegative";
|
||||
this.ctrlFlagNegative.Size = new System.Drawing.Size(20, 20);
|
||||
this.ctrlFlagNegative.TabIndex = 6;
|
||||
//
|
||||
// ctrlFlagOverflow
|
||||
//
|
||||
this.ctrlFlagOverflow.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.ctrlFlagOverflow.Location = new System.Drawing.Point(189, 69);
|
||||
this.ctrlFlagOverflow.Name = "ctrlFlagOverflow";
|
||||
this.ctrlFlagOverflow.Size = new System.Drawing.Size(20, 20);
|
||||
this.ctrlFlagOverflow.TabIndex = 5;
|
||||
//
|
||||
// ctrlFlagDecimal
|
||||
//
|
||||
this.ctrlFlagDecimal.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.ctrlFlagDecimal.Location = new System.Drawing.Point(154, 69);
|
||||
this.ctrlFlagDecimal.Name = "ctrlFlagDecimal";
|
||||
this.ctrlFlagDecimal.Size = new System.Drawing.Size(20, 20);
|
||||
this.ctrlFlagDecimal.TabIndex = 4;
|
||||
//
|
||||
// ctrlFlagInterrupt
|
||||
//
|
||||
this.ctrlFlagInterrupt.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.ctrlFlagInterrupt.Location = new System.Drawing.Point(119, 69);
|
||||
this.ctrlFlagInterrupt.Name = "ctrlFlagInterrupt";
|
||||
this.ctrlFlagInterrupt.Size = new System.Drawing.Size(20, 20);
|
||||
this.ctrlFlagInterrupt.TabIndex = 3;
|
||||
//
|
||||
// ctrlFlagZero
|
||||
//
|
||||
this.ctrlFlagZero.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.ctrlFlagZero.Location = new System.Drawing.Point(84, 69);
|
||||
this.ctrlFlagZero.Name = "ctrlFlagZero";
|
||||
this.ctrlFlagZero.Size = new System.Drawing.Size(20, 20);
|
||||
this.ctrlFlagZero.TabIndex = 2;
|
||||
//
|
||||
// ctrlFlagCarry
|
||||
//
|
||||
this.ctrlFlagCarry.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.ctrlFlagCarry.Location = new System.Drawing.Point(49, 69);
|
||||
this.ctrlFlagCarry.Name = "ctrlFlagCarry";
|
||||
this.ctrlFlagCarry.Size = new System.Drawing.Size(20, 20);
|
||||
this.ctrlFlagCarry.TabIndex = 1;
|
||||
//
|
||||
// lblName
|
||||
//
|
||||
this.lblName.AutoSize = true;
|
||||
this.tlpMain.SetColumnSpan(this.lblName, 8);
|
||||
this.lblName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblName.Location = new System.Drawing.Point(3, 3);
|
||||
this.lblName.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
|
||||
this.lblName.MaximumSize = new System.Drawing.Size(295, 0);
|
||||
this.lblName.Name = "lblName";
|
||||
this.lblName.Size = new System.Drawing.Size(43, 20);
|
||||
this.lblName.TabIndex = 7;
|
||||
this.lblName.Text = "TSX";
|
||||
//
|
||||
// lblOpCodeDescription
|
||||
//
|
||||
this.lblOpCodeDescription.AutoSize = true;
|
||||
this.tlpMain.SetColumnSpan(this.lblOpCodeDescription, 8);
|
||||
this.lblOpCodeDescription.Location = new System.Drawing.Point(3, 28);
|
||||
this.lblOpCodeDescription.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
|
||||
this.lblOpCodeDescription.MaximumSize = new System.Drawing.Size(280, 0);
|
||||
this.lblOpCodeDescription.Name = "lblOpCodeDescription";
|
||||
this.lblOpCodeDescription.Size = new System.Drawing.Size(32, 13);
|
||||
this.lblOpCodeDescription.TabIndex = 0;
|
||||
this.lblOpCodeDescription.Text = "Desc";
|
||||
//
|
||||
// lblAffectedStatusFlags
|
||||
//
|
||||
this.lblAffectedStatusFlags.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.lblAffectedStatusFlags.AutoSize = true;
|
||||
this.tlpMain.SetColumnSpan(this.lblAffectedStatusFlags, 8);
|
||||
this.lblAffectedStatusFlags.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.lblAffectedStatusFlags.Location = new System.Drawing.Point(0, 53);
|
||||
this.lblAffectedStatusFlags.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.lblAffectedStatusFlags.Name = "lblAffectedStatusFlags";
|
||||
this.lblAffectedStatusFlags.Size = new System.Drawing.Size(108, 13);
|
||||
this.lblAffectedStatusFlags.TabIndex = 24;
|
||||
this.lblAffectedStatusFlags.Text = "Affected Status Flags";
|
||||
//
|
||||
// frmOpCodeTooltip
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.ClientSize = new System.Drawing.Size(305, 96);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.panel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmOpCodeTooltip";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "frmCodeTooltip";
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.tlpMain.ResumeLayout(false);
|
||||
this.tlpMain.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.TableLayoutPanel tlpMain;
|
||||
private System.Windows.Forms.Label lblOpCodeDescription;
|
||||
private Controls.ctrlFlagStatus ctrlFlagNegative;
|
||||
private Controls.ctrlFlagStatus ctrlFlagOverflow;
|
||||
private Controls.ctrlFlagStatus ctrlFlagDecimal;
|
||||
private Controls.ctrlFlagStatus ctrlFlagInterrupt;
|
||||
private Controls.ctrlFlagStatus ctrlFlagZero;
|
||||
private Controls.ctrlFlagStatus ctrlFlagCarry;
|
||||
private System.Windows.Forms.Label lblName;
|
||||
private System.Windows.Forms.Label lblAffectedStatusFlags;
|
||||
}
|
||||
}
|
156
GUI.NET/Debugger/frmOpCodeTooltip.cs
Normal file
156
GUI.NET/Debugger/frmOpCodeTooltip.cs
Normal file
@ -0,0 +1,156 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Mesen.GUI.Controls;
|
||||
using Mesen.GUI.Config;
|
||||
|
||||
namespace Mesen.GUI.Debugger
|
||||
{
|
||||
public partial class frmOpCodeTooltip : Form
|
||||
{
|
||||
static private Dictionary<string, OpCodeDesc> _descriptions;
|
||||
|
||||
protected override bool ShowWithoutActivation
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
static frmOpCodeTooltip()
|
||||
{
|
||||
//Descriptions taken from http://www.obelisk.me.uk/6502/reference.html
|
||||
|
||||
_descriptions = new Dictionary<string, OpCodeDesc>();
|
||||
|
||||
_descriptions.Add("adc", new OpCodeDesc("ADC - Add with Carry", "Add the value at the specified memory address to the accumulator + the carry bit. On overflow, the carry bit is set.", CpuFlag.Carry | CpuFlag.Zero | CpuFlag.Overflow | CpuFlag.Negative));
|
||||
_descriptions.Add("and", new OpCodeDesc("AND - Bitwise AND", "Perform an AND operation between the accumulator and the value at the specified memory address.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("asl", new OpCodeDesc("ASL - Arithmetic Shift Left", "Shifts all the bits of the accumulator (or the byte at the specified memory address) by 1 bit to the left. Bit 0 will be set to 0 and the carry flag will take the value of bit 7 (before the shift).", CpuFlag.Carry | CpuFlag.Zero | CpuFlag.Negative));
|
||||
|
||||
_descriptions.Add("bcc", new OpCodeDesc("BCC - Branch if Carry Clear", "If the carry flag is clear, jump to location specified."));
|
||||
_descriptions.Add("bcs", new OpCodeDesc("BCS - Branch if Carry Set", "If the carry flag is set, jump to the location specified."));
|
||||
_descriptions.Add("beq", new OpCodeDesc("BEQ - Branch if Equal", "If the zero flag is set, jump to the location specified."));
|
||||
_descriptions.Add("bit", new OpCodeDesc("BIT - Bit Test", "Bits 6 and 7 of the byte at the specified memory address are copied to the N and V flags. If the accumulator's value ANDed with that byte is 0, the zero flag is set (otherwise it is cleared).", CpuFlag.Zero | CpuFlag.Overflow | CpuFlag.Negative));
|
||||
_descriptions.Add("bmi", new OpCodeDesc("BMI - Branch if Minus", "If the negative flag is set, jump to the location specified."));
|
||||
_descriptions.Add("bne", new OpCodeDesc("BNE - Branch if Not Equal", "If the zero flag is clear, jump to the location specified."));
|
||||
_descriptions.Add("bpl", new OpCodeDesc("BPL - Branch if Positive", "If the negative flag is clear, jump to the location specified."));
|
||||
_descriptions.Add("brk", new OpCodeDesc("BRK - Break", "The BRK instruction causes the CPU to jump to its IRQ vector, as if an interrupt had occurred. The PC and status flags are pushed on the stack."));
|
||||
_descriptions.Add("bvc", new OpCodeDesc("BVC - Branch if Overflow Clear", "If the overflow flag is clear, jump to the location specified."));
|
||||
_descriptions.Add("bvs", new OpCodeDesc("BVS - Branch if Overflow Set", "If the overflow flag is set then, jump to the location specified."));
|
||||
|
||||
_descriptions.Add("clc", new OpCodeDesc("CLC - Clear Carry Flag", "Clears the carry flag.", CpuFlag.Carry));
|
||||
_descriptions.Add("cld", new OpCodeDesc("CLD - Clear Decimal Mode", "Clears the decimal mode flag.", CpuFlag.Decimal));
|
||||
_descriptions.Add("cli", new OpCodeDesc("CLI - Clear Interrupt Disable", "Clears the interrupt disable flag.", CpuFlag.Interrupt));
|
||||
_descriptions.Add("clv", new OpCodeDesc("CLV - Clear Overflow Flag", "Clears the overflow flag.", CpuFlag.Overflow));
|
||||
_descriptions.Add("cmp", new OpCodeDesc("CMP - Compare", "Compares the accumulator with the byte at the specified memory address..", CpuFlag.Zero | CpuFlag.Carry | CpuFlag.Negative));
|
||||
_descriptions.Add("cpx", new OpCodeDesc("CPX - Compare X Register", "Compares the X register with the byte at the specified memory address.", CpuFlag.Zero | CpuFlag.Carry | CpuFlag.Negative));
|
||||
_descriptions.Add("cpy", new OpCodeDesc("CPY - Compare Y Register", "Compares the Y register with the byte at the specified memory address.", CpuFlag.Zero | CpuFlag.Carry | CpuFlag.Negative));
|
||||
|
||||
_descriptions.Add("dec", new OpCodeDesc("DEC - Decrement Memory", "Subtracts one from the byte at the specified memory address.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("dex", new OpCodeDesc("DEX - Decrement X Register", "Subtracts one from the X register.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("dey", new OpCodeDesc("DEY - Decrement Y Register", "Subtracts one from the Y register.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("eor", new OpCodeDesc("EOR - Exclusive OR", "Performs an exclusive OR operation between the accumulator and the byte at the specified memory address.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
|
||||
_descriptions.Add("inc", new OpCodeDesc("INC - Increment Memory", "Adds one to the the byte at the specified memory address.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("inx", new OpCodeDesc("INX - Increment X Register", "Adds one to the X register.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("iny", new OpCodeDesc("INY - Increment Y Register", "Adds one to the Y register.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
|
||||
_descriptions.Add("jmp", new OpCodeDesc("JMP - Jump", "Jumps to the specified location (alters the program counter)"));
|
||||
_descriptions.Add("jsr", new OpCodeDesc("JSR - Jump to Subroutine", "Pushes the address (minus one) of the next instruction to the stack and then jumps to the target address."));
|
||||
|
||||
_descriptions.Add("lda", new OpCodeDesc("LDA - Load Accumulator", "Loads a byte from the specified memory address into the accumulator.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("ldx", new OpCodeDesc("LDX - Load X Register", "Loads a byte from the specified memory address into the X register.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("ldy", new OpCodeDesc("LDY - Load Y Register", "Loads a byte from the specified memory address into the Y register.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("lsr", new OpCodeDesc("LSR - Logical Shift Right", "Shifts all the bits of the accumulator (or the byte at the specified memory address) by 1 bit to the right. Bit 7 will be set to 0 and the carry flag will take the value of bit 0 (before the shift).", CpuFlag.Carry | CpuFlag.Zero | CpuFlag.Negative));
|
||||
|
||||
_descriptions.Add("nop", new OpCodeDesc("NOP - No Operation", "Performs no operation other than delaying execution of the next instruction by 2 cycles."));
|
||||
|
||||
_descriptions.Add("ora", new OpCodeDesc("ORA - Inclusive OR", "Performs an inclusive OR operation between the accumulator and the byte at the specified memory address.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
|
||||
_descriptions.Add("pha", new OpCodeDesc("PHA - Push Accumulator", "Pushes the value of the accumulator to the stack."));
|
||||
_descriptions.Add("php", new OpCodeDesc("PHP - Push Processor Status", "Pushes the value of the status flags to the stack."));
|
||||
_descriptions.Add("pla", new OpCodeDesc("PLA - Pull Accumulator", "Pulls a byte from the stack and stores it into the accumulator.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("plp", new OpCodeDesc("PLP - Pull Processor Status", "Pulls a byte from the stack and stores it into the processor flags. The flags will be modified based on the value pulled.", CpuFlag.Carry | CpuFlag.Decimal | CpuFlag.Interrupt | CpuFlag.Negative | CpuFlag.Overflow | CpuFlag.Zero));
|
||||
|
||||
_descriptions.Add("rol", new OpCodeDesc("ROL - Rotate Left", "Shifts all bits 1 position to the left. The right-most bit takes the current value of the carry flag. The left-most bit is stored into the carry flag.", CpuFlag.Carry | CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("ror", new OpCodeDesc("ROR - Rotate Right", "Shifts all bits 1 position to the right. The left-most bit takes the current value of the carry flag. The right-most bit is stored into the carry flag.", CpuFlag.Carry | CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("rti", new OpCodeDesc("RTI - Return from Interrupt", "The RTI instruction is used at the end of the interrupt handler to return execution to its original location. It pulls the status flags and program counter from the stack."));
|
||||
_descriptions.Add("rts", new OpCodeDesc("RTS - Return from Subroutine", "The RTS instruction is used at the end of a subroutine to return execution to the calling function. It pulls the status flags and program counter (minus 1) from the stack."));
|
||||
|
||||
_descriptions.Add("sbc", new OpCodeDesc("SBC - Subtract with Carry", "Substracts the byte at the specified memory address from the value of the accumulator (affected by the carry flag).", CpuFlag.Carry | CpuFlag.Zero | CpuFlag.Overflow | CpuFlag.Negative));
|
||||
_descriptions.Add("sec", new OpCodeDesc("SEC - Set Carry Flag", "Sets the carry flag.", CpuFlag.Carry));
|
||||
_descriptions.Add("sed", new OpCodeDesc("SED - Set Decimal Flag", "Sets the decimal flag.", CpuFlag.Decimal));
|
||||
_descriptions.Add("sei", new OpCodeDesc("SEI - Set Interrupt Disable", "Sets the interrupt disable flag.", CpuFlag.Interrupt));
|
||||
_descriptions.Add("sta", new OpCodeDesc("STA - Store Accumulator", "Stores the value of the accumulator into memory."));
|
||||
_descriptions.Add("stx", new OpCodeDesc("STX - Store X Register", "Stores the value of the X register into memory."));
|
||||
_descriptions.Add("sty", new OpCodeDesc("STY - Store Y Register", "Stores the value of the Y register into memory."));
|
||||
_descriptions.Add("tax", new OpCodeDesc("TAX - Transfer A to X", "Copies the accumulator into the X register.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("tay", new OpCodeDesc("TAY - Transfer A to Y", "Copies the accumulator into the Y register.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("tsx", new OpCodeDesc("TSX - Transfer SP to X", "Copies the stack pointer into the X register.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("txa", new OpCodeDesc("TXA - Transfer X to A", "Copies the X register into the accumulator.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
_descriptions.Add("txs", new OpCodeDesc("TXS - Transfer X to SP", "Copies the X register into the stack pointer."));
|
||||
_descriptions.Add("tya", new OpCodeDesc("TYA - Transfer Y to A", "Copies the Y register into the accumulator.", CpuFlag.Zero | CpuFlag.Negative));
|
||||
}
|
||||
|
||||
public static bool IsOpCode(string text)
|
||||
{
|
||||
OpCodeDesc desc;
|
||||
return _descriptions.TryGetValue(text.ToLowerInvariant(), out desc);
|
||||
}
|
||||
|
||||
public frmOpCodeTooltip(string opcode)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
OpCodeDesc desc = _descriptions[opcode.ToLowerInvariant()];
|
||||
|
||||
ctrlFlagCarry.Letter = "C";
|
||||
ctrlFlagDecimal.Letter = "D";
|
||||
ctrlFlagInterrupt.Letter = "I";
|
||||
ctrlFlagNegative.Letter = "N";
|
||||
ctrlFlagOverflow.Letter = "O";
|
||||
ctrlFlagZero.Letter = "Z";
|
||||
|
||||
lblName.Text = desc.Name;
|
||||
lblOpCodeDescription.Text = desc.Description;
|
||||
|
||||
ctrlFlagCarry.Active = desc.Flags.HasFlag(CpuFlag.Carry);
|
||||
ctrlFlagDecimal.Active = desc.Flags.HasFlag(CpuFlag.Decimal);
|
||||
ctrlFlagInterrupt.Active = desc.Flags.HasFlag(CpuFlag.Interrupt);
|
||||
ctrlFlagNegative.Active = desc.Flags.HasFlag(CpuFlag.Negative);
|
||||
ctrlFlagOverflow.Active = desc.Flags.HasFlag(CpuFlag.Overflow);
|
||||
ctrlFlagZero.Active = desc.Flags.HasFlag(CpuFlag.Zero);
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
|
||||
this.Width = this.tlpMain.Width;
|
||||
this.Height = this.tlpMain.Height;
|
||||
}
|
||||
|
||||
[Flags]
|
||||
enum CpuFlag { None = 0, Carry = 1, Decimal = 2, Interrupt = 4, Negative = 8, Overflow = 16, Zero = 32}
|
||||
|
||||
class OpCodeDesc
|
||||
{
|
||||
internal string Name { get; set; }
|
||||
internal string Description { get; set; }
|
||||
internal CpuFlag Flags { get; set; }
|
||||
|
||||
internal OpCodeDesc(string name, string desc, CpuFlag flags = CpuFlag.None)
|
||||
{
|
||||
Name = name;
|
||||
Description = desc;
|
||||
Flags = flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
120
GUI.NET/Debugger/frmOpCodeTooltip.resx
Normal file
120
GUI.NET/Debugger/frmOpCodeTooltip.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -346,6 +346,12 @@
|
||||
<Compile Include="Debugger\Controls\ctrlAddressList.Designer.cs">
|
||||
<DependentUpon>ctrlAddressList.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Debugger\Controls\ctrlFlagStatus.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Debugger\Controls\ctrlFlagStatus.Designer.cs">
|
||||
<DependentUpon>ctrlFlagStatus.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Debugger\Controls\ctrlLabelList.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@ -534,6 +540,12 @@
|
||||
<Compile Include="Debugger\frmAssembler.Designer.cs">
|
||||
<DependentUpon>frmAssembler.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Debugger\frmOpCodeTooltip.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Debugger\frmOpCodeTooltip.Designer.cs">
|
||||
<DependentUpon>frmOpCodeTooltip.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Debugger\frmMemoryViewerColors.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -1063,6 +1075,9 @@
|
||||
<EmbeddedResource Include="Debugger\Controls\ApuViewer\ctrlSquareInfo.resx">
|
||||
<DependentUpon>ctrlSquareInfo.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Debugger\Controls\ctrlFlagStatus.resx">
|
||||
<DependentUpon>ctrlFlagStatus.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Debugger\Example.lua" />
|
||||
<None Include="Resources\PipetteSmall.png" />
|
||||
<None Include="Resources\Enum.png" />
|
||||
@ -1179,6 +1194,9 @@
|
||||
<EmbeddedResource Include="Debugger\frmAssembler.resx">
|
||||
<DependentUpon>frmAssembler.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Debugger\frmOpCodeTooltip.resx">
|
||||
<DependentUpon>frmOpCodeTooltip.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Debugger\frmMemoryViewerColors.resx">
|
||||
<DependentUpon>frmMemoryViewerColors.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
Loading…
Reference in New Issue
Block a user