Debugger: Added palette viewer

This commit is contained in:
Sour 2019-03-16 16:38:28 -04:00
parent bb0c8b1f10
commit 0d0f5e6e58
10 changed files with 410 additions and 41 deletions

View file

@ -74,8 +74,6 @@ namespace Mesen.GUI.Config
public XmlKeys OpenEventViewer = Keys.Control | Keys.E;
[ShortcutName("Open Memory Tools")]
public XmlKeys OpenMemoryTools = Keys.Control | Keys.M;
[ShortcutName("Open PPU Viewer")]
public XmlKeys OpenPpuViewer = Keys.Control | Keys.P;
[ShortcutName("Open Performance Profiler")]
public XmlKeys OpenProfiler = Keys.Control | Keys.Y;
[ShortcutName("Open Script Window")]
@ -87,13 +85,13 @@ namespace Mesen.GUI.Config
[ShortcutName("Open Watch Window")]
public XmlKeys OpenWatchWindow = Keys.Control | Keys.W;
[ShortcutName("Open Nametabler Viewer (Compact)")]
public XmlKeys OpenNametableViewer = Keys.Control | Keys.D1;
[ShortcutName("Open CHR Viewer (Compact)")]
public XmlKeys OpenChrViewer = Keys.Control | Keys.D2;
[ShortcutName("Open Sprite Viewer (Compact)")]
[ShortcutName("Open Tilemap Viewer")]
public XmlKeys OpenTilemapViewer = Keys.Control | Keys.D1;
[ShortcutName("Open Tile Viewer")]
public XmlKeys OpenTileViewer = Keys.Control | Keys.D2;
[ShortcutName("Open Sprite Viewer")]
public XmlKeys OpenSpriteViewer = Keys.Control | Keys.D3;
[ShortcutName("Open Palette Viewer (Compact)")]
[ShortcutName("Open Palette Viewer")]
public XmlKeys OpenPaletteViewer = Keys.Control | Keys.D4;
//Debugger window

View file

@ -35,6 +35,7 @@ namespace Mesen.GUI.Debugger
case DebugWindow.TraceLogger: frm = new frmTraceLogger(); frm.Icon = Properties.Resources.LogWindow; break;
case DebugWindow.MemoryTools: frm = new frmMemoryTools(); frm.Icon = Properties.Resources.CheatCode; break;
case DebugWindow.TilemapViewer: frm = new frmTilemapViewer(); frm.Icon = Properties.Resources.VideoOptions; break;
case DebugWindow.PaletteViewer: frm = new frmPaletteViewer(); frm.Icon = Properties.Resources.VideoFilter; break;
case DebugWindow.EventViewer: frm = new frmEventViewer(); frm.Icon = Properties.Resources.NesEventViewer; break;
}
_openedWindows.Add(frm);
@ -119,6 +120,7 @@ namespace Mesen.GUI.Debugger
MemoryTools,
TraceLogger,
TilemapViewer,
PaletteViewer,
EventViewer
}
}

View file

@ -0,0 +1,92 @@
namespace Mesen.GUI.Debugger
{
partial class frmPaletteViewer
{
/// <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.picPalette = new Mesen.GUI.Controls.ctrlMesenPictureBox();
this.ctrlScanlineCycleSelect = new Mesen.GUI.Debugger.Controls.ctrlScanlineCycleSelect();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.picPalette)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// picPalette
//
this.picPalette.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
this.picPalette.Location = new System.Drawing.Point(3, 3);
this.picPalette.MinimumSize = new System.Drawing.Size(256, 256);
this.picPalette.Name = "picPalette";
this.picPalette.Size = new System.Drawing.Size(256, 256);
this.picPalette.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.picPalette.TabIndex = 0;
this.picPalette.TabStop = false;
//
// ctrlScanlineCycleSelect
//
this.ctrlScanlineCycleSelect.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ctrlScanlineCycleSelect.Location = new System.Drawing.Point(0, 263);
this.ctrlScanlineCycleSelect.Name = "ctrlScanlineCycleSelect";
this.ctrlScanlineCycleSelect.Size = new System.Drawing.Size(485, 28);
this.ctrlScanlineCycleSelect.TabIndex = 5;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.Controls.Add(this.picPalette, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(485, 263);
this.tableLayoutPanel1.TabIndex = 7;
//
// frmPaletteViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(485, 291);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.ctrlScanlineCycleSelect);
this.Name = "frmPaletteViewer";
this.Text = "Tilemap Viewer";
((System.ComponentModel.ISupportInitialize)(this.picPalette)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private GUI.Controls.ctrlMesenPictureBox picPalette;
private Controls.ctrlScanlineCycleSelect ctrlScanlineCycleSelect;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}

View file

@ -0,0 +1,107 @@
using Mesen.GUI.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesen.GUI.Debugger
{
public partial class frmPaletteViewer : BaseForm
{
private NotificationListener _notifListener;
private byte[] _cgRam;
private Bitmap _paletteImage;
public frmPaletteViewer()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if(DesignMode) {
return;
}
_notifListener = new NotificationListener();
_notifListener.OnNotification += OnNotificationReceived;
_paletteImage = new Bitmap(256, 256, PixelFormat.Format32bppArgb);
picPalette.Image = _paletteImage;
ctrlScanlineCycleSelect.Initialize(241, 0);
RefreshData();
RefreshViewer();
}
protected override void OnFormClosed(FormClosedEventArgs e)
{
base.OnFormClosed(e);
_notifListener?.Dispose();
}
private void OnNotificationReceived(NotificationEventArgs e)
{
switch(e.NotificationType) {
case ConsoleNotificationType.ViewerRefresh:
if(e.Parameter.ToInt32() == ctrlScanlineCycleSelect.ViewerId) {
RefreshData();
this.BeginInvoke((Action)(() => {
this.RefreshViewer();
}));
}
break;
}
}
private void RefreshData()
{
_cgRam = DebugApi.GetMemoryState(SnesMemoryType.CGRam);
}
private void RefreshViewer()
{
Func<int, uint> to8Bit = (int color) => { return (uint)((color << 3) + (color >> 2)); };
Func<int, uint> toArgb = (int rgb555) => {
uint b = to8Bit(rgb555 >> 10);
uint g = to8Bit((rgb555 >> 5) & 0x1F);
uint r = to8Bit(rgb555 & 0x1F);
return (0xFF000000 | (r << 16) | (g << 8) | b);
};
UInt32[] argbPalette = new UInt32[256];
for(int i = 0; i < 256; i++) {
argbPalette[i] = toArgb(_cgRam[i * 2] | _cgRam[i * 2 + 1] << 8);
}
using(Graphics g = Graphics.FromImage(_paletteImage)) {
GCHandle handle = GCHandle.Alloc(argbPalette, GCHandleType.Pinned);
Bitmap source = new Bitmap(16, 16, 16 * 4, PixelFormat.Format32bppArgb, handle.AddrOfPinnedObject());
try {
g.InterpolationMode = InterpolationMode.NearestNeighbor;
g.SmoothingMode = SmoothingMode.None;
g.PixelOffsetMode = PixelOffsetMode.Half;
g.ScaleTransform(16, 16);
g.DrawImage(source, 0, 0);
} finally {
handle.Free();
}
}
picPalette.Invalidate();
}
}
}

View file

@ -0,0 +1,123 @@
<?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>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -25,21 +25,27 @@ namespace Mesen.GUI.Debugger
public frmTilemapViewer()
{
InitializeComponent();
}
if(!this.DesignMode) {
_options.BgMode = 0;
_notifListener = new NotificationListener();
_notifListener.OnNotification += OnNotificationReceived;
_tilemapImage = new Bitmap(512, 512, PixelFormat.Format32bppArgb);
picTilemap.Image = _tilemapImage;
ctrlScanlineCycleSelect.Initialize(241, 0);
RefreshData();
RefreshViewer();
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if(DesignMode) {
return;
}
_options.BgMode = 0;
_notifListener = new NotificationListener();
_notifListener.OnNotification += OnNotificationReceived;
_tilemapImage = new Bitmap(512, 512, PixelFormat.Format32bppArgb);
picTilemap.Image = _tilemapImage;
ctrlScanlineCycleSelect.Initialize(241, 0);
RefreshData();
RefreshViewer();
}
protected override void OnFormClosed(FormClosedEventArgs e)

View file

@ -48,14 +48,13 @@ namespace Mesen.GUI.Debugger
GetMember(nameof(DebuggerShortcutsConfig.OpenEventViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenMemoryTools)),
GetMember(nameof(DebuggerShortcutsConfig.OpenProfiler)),
GetMember(nameof(DebuggerShortcutsConfig.OpenPpuViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenScriptWindow)),
GetMember(nameof(DebuggerShortcutsConfig.OpenTextHooker)),
GetMember(nameof(DebuggerShortcutsConfig.OpenTraceLogger)),
GetMember(nameof(DebuggerShortcutsConfig.OpenWatchWindow)),
GetMember(nameof(DebuggerShortcutsConfig.OpenNametableViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenChrViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenTilemapViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenTileViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenSpriteViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenPaletteViewer)),
};

View file

@ -135,6 +135,9 @@
this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem();
this.pnlRenderer = new System.Windows.Forms.Panel();
this.ctrlRecentGames = new Mesen.GUI.Controls.ctrlRecentGames();
this.mnuPaletteViewer = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem22 = new System.Windows.Forms.ToolStripSeparator();
this.mnuMain.SuspendLayout();
this.pnlRenderer.SuspendLayout();
this.SuspendLayout();
@ -245,7 +248,7 @@
this.mnuPause.Enabled = false;
this.mnuPause.Image = global::Mesen.GUI.Properties.Resources.MediaPause;
this.mnuPause.Name = "mnuPause";
this.mnuPause.Size = new System.Drawing.Size(152, 22);
this.mnuPause.Size = new System.Drawing.Size(139, 22);
this.mnuPause.Text = "Pause";
//
// mnuReset
@ -253,7 +256,7 @@
this.mnuReset.Enabled = false;
this.mnuReset.Image = global::Mesen.GUI.Properties.Resources.Refresh;
this.mnuReset.Name = "mnuReset";
this.mnuReset.Size = new System.Drawing.Size(152, 22);
this.mnuReset.Size = new System.Drawing.Size(139, 22);
this.mnuReset.Text = "Reset";
//
// mnuPowerCycle
@ -261,19 +264,19 @@
this.mnuPowerCycle.Enabled = false;
this.mnuPowerCycle.Image = global::Mesen.GUI.Properties.Resources.PowerCycle;
this.mnuPowerCycle.Name = "mnuPowerCycle";
this.mnuPowerCycle.Size = new System.Drawing.Size(152, 22);
this.mnuPowerCycle.Size = new System.Drawing.Size(139, 22);
this.mnuPowerCycle.Text = "Power Cycle";
//
// toolStripMenuItem24
//
this.toolStripMenuItem24.Name = "toolStripMenuItem24";
this.toolStripMenuItem24.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem24.Size = new System.Drawing.Size(136, 6);
//
// mnuPowerOff
//
this.mnuPowerOff.Image = global::Mesen.GUI.Properties.Resources.MediaStop;
this.mnuPowerOff.Name = "mnuPowerOff";
this.mnuPowerOff.Size = new System.Drawing.Size(152, 22);
this.mnuPowerOff.Size = new System.Drawing.Size(139, 22);
this.mnuPowerOff.Text = "Power Off";
//
// optionsToolStripMenuItem
@ -311,7 +314,7 @@
this.mnuShowFPS});
this.mnuEmulationSpeed.Image = global::Mesen.GUI.Properties.Resources.Speed;
this.mnuEmulationSpeed.Name = "mnuEmulationSpeed";
this.mnuEmulationSpeed.Size = new System.Drawing.Size(152, 22);
this.mnuEmulationSpeed.Size = new System.Drawing.Size(135, 22);
this.mnuEmulationSpeed.Text = "Speed";
this.mnuEmulationSpeed.DropDownOpening += new System.EventHandler(this.mnuEmulationSpeed_DropDownOpening);
//
@ -399,7 +402,7 @@
this.mnuFullscreen});
this.mnuVideoScale.Image = global::Mesen.GUI.Properties.Resources.Fullscreen;
this.mnuVideoScale.Name = "mnuVideoScale";
this.mnuVideoScale.Size = new System.Drawing.Size(152, 22);
this.mnuVideoScale.Size = new System.Drawing.Size(135, 22);
this.mnuVideoScale.Text = "Video Size";
this.mnuVideoScale.DropDownOpening += new System.EventHandler(this.mnuVideoScale_DropDownOpening);
//
@ -485,7 +488,7 @@
this.mnuBilinearInterpolation});
this.mnuVideoFilter.Image = global::Mesen.GUI.Properties.Resources.VideoFilter;
this.mnuVideoFilter.Name = "mnuVideoFilter";
this.mnuVideoFilter.Size = new System.Drawing.Size(152, 22);
this.mnuVideoFilter.Size = new System.Drawing.Size(135, 22);
this.mnuVideoFilter.Text = "Video Filter";
this.mnuVideoFilter.DropDownOpening += new System.EventHandler(this.mnuVideoFilter_DropDownOpening);
//
@ -672,7 +675,7 @@
this.mnuRegionPal});
this.mnuRegion.Image = global::Mesen.GUI.Properties.Resources.WebBrowser;
this.mnuRegion.Name = "mnuRegion";
this.mnuRegion.Size = new System.Drawing.Size(152, 22);
this.mnuRegion.Size = new System.Drawing.Size(135, 22);
this.mnuRegion.Text = "Region";
this.mnuRegion.DropDownOpening += new System.EventHandler(this.mnuRegion_DropDownOpening);
//
@ -702,13 +705,13 @@
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem4.Size = new System.Drawing.Size(132, 6);
//
// mnuAudioConfig
//
this.mnuAudioConfig.Image = global::Mesen.GUI.Properties.Resources.Audio;
this.mnuAudioConfig.Name = "mnuAudioConfig";
this.mnuAudioConfig.Size = new System.Drawing.Size(152, 22);
this.mnuAudioConfig.Size = new System.Drawing.Size(135, 22);
this.mnuAudioConfig.Text = "Audio";
this.mnuAudioConfig.Click += new System.EventHandler(this.mnuAudioConfig_Click);
//
@ -716,7 +719,7 @@
//
this.mnuInputConfig.Image = global::Mesen.GUI.Properties.Resources.Controller;
this.mnuInputConfig.Name = "mnuInputConfig";
this.mnuInputConfig.Size = new System.Drawing.Size(152, 22);
this.mnuInputConfig.Size = new System.Drawing.Size(135, 22);
this.mnuInputConfig.Text = "Input";
this.mnuInputConfig.Click += new System.EventHandler(this.mnuInputConfig_Click);
//
@ -724,7 +727,7 @@
//
this.mnuVideoConfig.Image = global::Mesen.GUI.Properties.Resources.VideoOptions;
this.mnuVideoConfig.Name = "mnuVideoConfig";
this.mnuVideoConfig.Size = new System.Drawing.Size(152, 22);
this.mnuVideoConfig.Size = new System.Drawing.Size(135, 22);
this.mnuVideoConfig.Text = "Video";
this.mnuVideoConfig.Click += new System.EventHandler(this.mnuVideoConfig_Click);
//
@ -732,20 +735,20 @@
//
this.mnuEmulationConfig.Image = global::Mesen.GUI.Properties.Resources.DipSwitches;
this.mnuEmulationConfig.Name = "mnuEmulationConfig";
this.mnuEmulationConfig.Size = new System.Drawing.Size(152, 22);
this.mnuEmulationConfig.Size = new System.Drawing.Size(135, 22);
this.mnuEmulationConfig.Text = "Emulation";
this.mnuEmulationConfig.Click += new System.EventHandler(this.mnuEmulationConfig_Click);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem3.Size = new System.Drawing.Size(132, 6);
//
// mnuPreferences
//
this.mnuPreferences.Image = global::Mesen.GUI.Properties.Resources.Settings;
this.mnuPreferences.Name = "mnuPreferences";
this.mnuPreferences.Size = new System.Drawing.Size(152, 22);
this.mnuPreferences.Size = new System.Drawing.Size(135, 22);
this.mnuPreferences.Text = "Preferences";
this.mnuPreferences.Click += new System.EventHandler(this.mnuPreferences_Click);
//
@ -847,7 +850,10 @@
this.mnuDebugger,
this.mnuMemoryTools,
this.mnuTraceLogger,
this.toolStripMenuItem12,
this.mnuTilemapViewer,
this.mnuPaletteViewer,
this.toolStripMenuItem22,
this.mnuEventViewer});
this.debugToolStripMenuItem.Name = "debugToolStripMenuItem";
this.debugToolStripMenuItem.Size = new System.Drawing.Size(54, 20);
@ -959,6 +965,24 @@
this.ctrlRecentGames.TabIndex = 1;
this.ctrlRecentGames.Visible = false;
//
// mnuPaletteViewer
//
this.mnuPaletteViewer.Image = global::Mesen.GUI.Properties.Resources.VideoFilter;
this.mnuPaletteViewer.Name = "mnuPaletteViewer";
this.mnuPaletteViewer.Size = new System.Drawing.Size(155, 22);
this.mnuPaletteViewer.Text = "Palette Viewer";
this.mnuPaletteViewer.Click += new System.EventHandler(this.mnuPaletteViewer_Click);
//
// toolStripMenuItem12
//
this.toolStripMenuItem12.Name = "toolStripMenuItem12";
this.toolStripMenuItem12.Size = new System.Drawing.Size(152, 6);
//
// toolStripMenuItem22
//
this.toolStripMenuItem22.Name = "toolStripMenuItem22";
this.toolStripMenuItem22.Size = new System.Drawing.Size(152, 6);
//
// frmMain
//
this.AllowDrop = true;
@ -1089,5 +1113,8 @@
private System.Windows.Forms.ToolStripMenuItem mnuSoundRecorder;
private System.Windows.Forms.ToolStripMenuItem mnuWaveRecord;
private System.Windows.Forms.ToolStripMenuItem mnuWaveStop;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem12;
private System.Windows.Forms.ToolStripMenuItem mnuPaletteViewer;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem22;
}
}

View file

@ -183,7 +183,8 @@ namespace Mesen.GUI.Forms
mnuDebugger.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenDebugger));
mnuMemoryTools.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenMemoryTools));
mnuEventViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenEventViewer));
mnuTilemapViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenPpuViewer));
mnuTilemapViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenTilemapViewer));
mnuPaletteViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenPaletteViewer));
mnuTraceLogger.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenTraceLogger));
mnuNoneFilter.Click += (s, e) => { _shortcuts.SetVideoFilter(VideoFilterType.None); };
@ -291,6 +292,11 @@ namespace Mesen.GUI.Forms
DebugWindowManager.OpenDebugWindow(DebugWindow.TilemapViewer);
}
private void mnuPaletteViewer_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.PaletteViewer);
}
private void mnuEventViewer_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.EventViewer);

View file

@ -420,6 +420,12 @@
<Compile Include="Debugger\PpuViewer\ctrlScanlineCycleSelect.designer.cs">
<DependentUpon>ctrlScanlineCycleSelect.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\PpuViewer\frmPaletteViewer.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Debugger\PpuViewer\frmPaletteViewer.Designer.cs">
<DependentUpon>frmPaletteViewer.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\PpuViewer\frmTilemapViewer.cs">
<SubType>Form</SubType>
</Compile>
@ -709,6 +715,9 @@
<EmbeddedResource Include="Debugger\PpuViewer\ctrlScanlineCycleSelect.resx">
<DependentUpon>ctrlScanlineCycleSelect.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\PpuViewer\frmPaletteViewer.resx">
<DependentUpon>frmPaletteViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\PpuViewer\frmTilemapViewer.resx">
<DependentUpon>frmTilemapViewer.cs</DependentUpon>
</EmbeddedResource>