Fix Sprite Viewer Copy Tile function only give the first half if it is a large sprites

This commit is contained in:
mkwong98 2021-01-13 00:42:07 +08:00
parent 2d0468eff5
commit c56edc9f92
2 changed files with 584 additions and 555 deletions

View file

@ -97,7 +97,7 @@ namespace Mesen.GUI.Debugger.Controls
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()); 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.Percent, 100F));
this.tlpMain.Size = new System.Drawing.Size(682, 527); this.tlpMain.Size = new System.Drawing.Size(682, 486);
this.tlpMain.TabIndex = 3; this.tlpMain.TabIndex = 3;
// //
// tableLayoutPanel2 // tableLayoutPanel2
@ -115,16 +115,16 @@ namespace Mesen.GUI.Debugger.Controls
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(416, 527); this.tableLayoutPanel2.Size = new System.Drawing.Size(416, 486);
this.tableLayoutPanel2.TabIndex = 28; this.tableLayoutPanel2.TabIndex = 28;
// //
// grpSpriteInfo // grpSpriteInfo
// //
this.grpSpriteInfo.Controls.Add(this.tlpInfo); this.grpSpriteInfo.Controls.Add(this.tlpInfo);
this.grpSpriteInfo.Dock = System.Windows.Forms.DockStyle.Fill; this.grpSpriteInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpSpriteInfo.Location = new System.Drawing.Point(3, 28); this.grpSpriteInfo.Location = new System.Drawing.Point(3, 26);
this.grpSpriteInfo.Name = "grpSpriteInfo"; this.grpSpriteInfo.Name = "grpSpriteInfo";
this.grpSpriteInfo.Size = new System.Drawing.Size(410, 496); this.grpSpriteInfo.Size = new System.Drawing.Size(410, 458);
this.grpSpriteInfo.TabIndex = 4; this.grpSpriteInfo.TabIndex = 4;
this.grpSpriteInfo.TabStop = false; this.grpSpriteInfo.TabStop = false;
this.grpSpriteInfo.Text = "Sprite Info"; this.grpSpriteInfo.Text = "Sprite Info";
@ -156,7 +156,7 @@ namespace Mesen.GUI.Debugger.Controls
this.tlpInfo.Controls.Add(this.txtTileAddress, 3, 0); this.tlpInfo.Controls.Add(this.txtTileAddress, 3, 0);
this.tlpInfo.Controls.Add(this.txtPaletteAddress, 3, 1); this.tlpInfo.Controls.Add(this.txtPaletteAddress, 3, 1);
this.tlpInfo.Dock = System.Windows.Forms.DockStyle.Fill; this.tlpInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpInfo.Location = new System.Drawing.Point(3, 16); this.tlpInfo.Location = new System.Drawing.Point(3, 18);
this.tlpInfo.Name = "tlpInfo"; this.tlpInfo.Name = "tlpInfo";
this.tlpInfo.RowCount = 7; this.tlpInfo.RowCount = 7;
this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle());
@ -166,26 +166,26 @@ namespace Mesen.GUI.Debugger.Controls
this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tlpInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 18F));
this.tlpInfo.Size = new System.Drawing.Size(404, 477); this.tlpInfo.Size = new System.Drawing.Size(404, 437);
this.tlpInfo.TabIndex = 0; this.tlpInfo.TabIndex = 0;
// //
// txtSpriteIndex // txtSpriteIndex
// //
this.txtSpriteIndex.BackColor = System.Drawing.SystemColors.Window; this.txtSpriteIndex.BackColor = System.Drawing.SystemColors.Window;
this.txtSpriteIndex.Location = new System.Drawing.Point(75, 3); this.txtSpriteIndex.Location = new System.Drawing.Point(74, 3);
this.txtSpriteIndex.Name = "txtSpriteIndex"; this.txtSpriteIndex.Name = "txtSpriteIndex";
this.txtSpriteIndex.ReadOnly = true; this.txtSpriteIndex.ReadOnly = true;
this.txtSpriteIndex.Size = new System.Drawing.Size(26, 20); this.txtSpriteIndex.Size = new System.Drawing.Size(26, 22);
this.txtSpriteIndex.TabIndex = 23; this.txtSpriteIndex.TabIndex = 23;
// //
// lblSpriteIndex // lblSpriteIndex
// //
this.lblSpriteIndex.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblSpriteIndex.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblSpriteIndex.AutoSize = true; this.lblSpriteIndex.AutoSize = true;
this.lblSpriteIndex.Location = new System.Drawing.Point(3, 6); this.lblSpriteIndex.Location = new System.Drawing.Point(3, 8);
this.lblSpriteIndex.Name = "lblSpriteIndex"; this.lblSpriteIndex.Name = "lblSpriteIndex";
this.lblSpriteIndex.Size = new System.Drawing.Size(66, 13); this.lblSpriteIndex.Size = new System.Drawing.Size(65, 12);
this.lblSpriteIndex.TabIndex = 22; this.lblSpriteIndex.TabIndex = 22;
this.lblSpriteIndex.Text = "Sprite Index:"; this.lblSpriteIndex.Text = "Sprite Index:";
// //
@ -196,10 +196,10 @@ namespace Mesen.GUI.Debugger.Controls
this.tlpInfo.SetColumnSpan(this.picPreview, 4); this.tlpInfo.SetColumnSpan(this.picPreview, 4);
this.picPreview.ContextMenuStrip = this.ctxMenu; this.picPreview.ContextMenuStrip = this.ctxMenu;
this.picPreview.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default; this.picPreview.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default;
this.picPreview.Location = new System.Drawing.Point(76, 192); this.picPreview.Location = new System.Drawing.Point(75, 186);
this.picPreview.Margin = new System.Windows.Forms.Padding(4); this.picPreview.Margin = new System.Windows.Forms.Padding(4);
this.picPreview.Name = "picPreview"; this.picPreview.Name = "picPreview";
this.picPreview.Size = new System.Drawing.Size(258, 242); this.picPreview.Size = new System.Drawing.Size(258, 224);
this.picPreview.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.picPreview.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picPreview.TabIndex = 21; this.picPreview.TabIndex = 21;
this.picPreview.TabStop = false; this.picPreview.TabStop = false;
@ -220,14 +220,14 @@ namespace Mesen.GUI.Debugger.Controls
this.mnuCopyToClipboard, this.mnuCopyToClipboard,
this.mnuExportToPng}); this.mnuExportToPng});
this.ctxMenu.Name = "ctxMenu"; this.ctxMenu.Name = "ctxMenu";
this.ctxMenu.Size = new System.Drawing.Size(255, 148); this.ctxMenu.Size = new System.Drawing.Size(264, 148);
this.ctxMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ctxMenu_Opening); this.ctxMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ctxMenu_Opening);
// //
// mnuEditInMemoryViewer // mnuEditInMemoryViewer
// //
this.mnuEditInMemoryViewer.Image = global::Mesen.GUI.Properties.Resources.CheatCode; this.mnuEditInMemoryViewer.Image = global::Mesen.GUI.Properties.Resources.CheatCode;
this.mnuEditInMemoryViewer.Name = "mnuEditInMemoryViewer"; this.mnuEditInMemoryViewer.Name = "mnuEditInMemoryViewer";
this.mnuEditInMemoryViewer.Size = new System.Drawing.Size(254, 22); this.mnuEditInMemoryViewer.Size = new System.Drawing.Size(263, 22);
this.mnuEditInMemoryViewer.Text = "Edit in Memory Viewer"; this.mnuEditInMemoryViewer.Text = "Edit in Memory Viewer";
this.mnuEditInMemoryViewer.Click += new System.EventHandler(this.mnuEditInMemoryViewer_Click); this.mnuEditInMemoryViewer.Click += new System.EventHandler(this.mnuEditInMemoryViewer_Click);
// //
@ -236,39 +236,39 @@ namespace Mesen.GUI.Debugger.Controls
this.mnuShowInChrViewer.Image = global::Mesen.GUI.Properties.Resources.NextArrow; this.mnuShowInChrViewer.Image = global::Mesen.GUI.Properties.Resources.NextArrow;
this.mnuShowInChrViewer.Name = "mnuShowInChrViewer"; this.mnuShowInChrViewer.Name = "mnuShowInChrViewer";
this.mnuShowInChrViewer.ShortcutKeyDisplayString = "Dbl-Click"; this.mnuShowInChrViewer.ShortcutKeyDisplayString = "Dbl-Click";
this.mnuShowInChrViewer.Size = new System.Drawing.Size(254, 22); this.mnuShowInChrViewer.Size = new System.Drawing.Size(263, 22);
this.mnuShowInChrViewer.Text = "View in CHR viewer"; this.mnuShowInChrViewer.Text = "View in CHR viewer";
this.mnuShowInChrViewer.Click += new System.EventHandler(this.mnuShowInChrViewer_Click); this.mnuShowInChrViewer.Click += new System.EventHandler(this.mnuShowInChrViewer_Click);
// //
// toolStripMenuItem1 // toolStripMenuItem1
// //
this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(251, 6); this.toolStripMenuItem1.Size = new System.Drawing.Size(260, 6);
// //
// mnuCopyHdPack // mnuCopyHdPack
// //
this.mnuCopyHdPack.Name = "mnuCopyHdPack"; this.mnuCopyHdPack.Name = "mnuCopyHdPack";
this.mnuCopyHdPack.Size = new System.Drawing.Size(254, 22); this.mnuCopyHdPack.Size = new System.Drawing.Size(263, 22);
this.mnuCopyHdPack.Text = "Copy Tile (HD Pack Format)"; this.mnuCopyHdPack.Text = "Copy Tile (HD Pack Format)";
this.mnuCopyHdPack.Click += new System.EventHandler(this.mnuCopyHdPack_Click); this.mnuCopyHdPack.Click += new System.EventHandler(this.mnuCopyHdPack_Click);
// //
// mnuCopyAllSpritesHdPack // mnuCopyAllSpritesHdPack
// //
this.mnuCopyAllSpritesHdPack.Name = "mnuCopyAllSpritesHdPack"; this.mnuCopyAllSpritesHdPack.Name = "mnuCopyAllSpritesHdPack";
this.mnuCopyAllSpritesHdPack.Size = new System.Drawing.Size(254, 22); this.mnuCopyAllSpritesHdPack.Size = new System.Drawing.Size(263, 22);
this.mnuCopyAllSpritesHdPack.Text = "Copy All Sprites (HD Pack Format)"; this.mnuCopyAllSpritesHdPack.Text = "Copy All Sprites (HD Pack Format)";
this.mnuCopyAllSpritesHdPack.Click += new System.EventHandler(this.mnuCopyAllSpritesHdPack_Click); this.mnuCopyAllSpritesHdPack.Click += new System.EventHandler(this.mnuCopyAllSpritesHdPack_Click);
// //
// toolStripMenuItem2 // toolStripMenuItem2
// //
this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(251, 6); this.toolStripMenuItem2.Size = new System.Drawing.Size(260, 6);
// //
// mnuCopyToClipboard // mnuCopyToClipboard
// //
this.mnuCopyToClipboard.Image = global::Mesen.GUI.Properties.Resources.Copy; this.mnuCopyToClipboard.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.mnuCopyToClipboard.Name = "mnuCopyToClipboard"; this.mnuCopyToClipboard.Name = "mnuCopyToClipboard";
this.mnuCopyToClipboard.Size = new System.Drawing.Size(254, 22); this.mnuCopyToClipboard.Size = new System.Drawing.Size(263, 22);
this.mnuCopyToClipboard.Text = "Copy image to clipboard"; this.mnuCopyToClipboard.Text = "Copy image to clipboard";
this.mnuCopyToClipboard.Click += new System.EventHandler(this.mnuCopyToClipboard_Click); this.mnuCopyToClipboard.Click += new System.EventHandler(this.mnuCopyToClipboard_Click);
// //
@ -276,17 +276,17 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.mnuExportToPng.Image = global::Mesen.GUI.Properties.Resources.Export; this.mnuExportToPng.Image = global::Mesen.GUI.Properties.Resources.Export;
this.mnuExportToPng.Name = "mnuExportToPng"; this.mnuExportToPng.Name = "mnuExportToPng";
this.mnuExportToPng.Size = new System.Drawing.Size(254, 22); this.mnuExportToPng.Size = new System.Drawing.Size(263, 22);
this.mnuExportToPng.Text = "Export image to PNG"; this.mnuExportToPng.Text = "Export image to PNG";
this.mnuExportToPng.Click += new System.EventHandler(this.mnuExportToPng_Click); this.mnuExportToPng.Click += new System.EventHandler(this.mnuExportToPng_Click);
// //
// lblScreenPreview // lblScreenPreview
// //
this.lblScreenPreview.AutoSize = true; this.lblScreenPreview.AutoSize = true;
this.lblScreenPreview.Location = new System.Drawing.Point(3, 193); this.lblScreenPreview.Location = new System.Drawing.Point(3, 187);
this.lblScreenPreview.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0); this.lblScreenPreview.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
this.lblScreenPreview.Name = "lblScreenPreview"; this.lblScreenPreview.Name = "lblScreenPreview";
this.lblScreenPreview.Size = new System.Drawing.Size(48, 13); this.lblScreenPreview.Size = new System.Drawing.Size(45, 12);
this.lblScreenPreview.TabIndex = 20; this.lblScreenPreview.TabIndex = 20;
this.lblScreenPreview.Text = "Preview:"; this.lblScreenPreview.Text = "Preview:";
// //
@ -294,28 +294,28 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.lblTileIndex.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblTileIndex.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblTileIndex.AutoSize = true; this.lblTileIndex.AutoSize = true;
this.lblTileIndex.Location = new System.Drawing.Point(3, 32); this.lblTileIndex.Location = new System.Drawing.Point(3, 36);
this.lblTileIndex.Name = "lblTileIndex"; this.lblTileIndex.Name = "lblTileIndex";
this.lblTileIndex.Size = new System.Drawing.Size(56, 13); this.lblTileIndex.Size = new System.Drawing.Size(56, 12);
this.lblTileIndex.TabIndex = 0; this.lblTileIndex.TabIndex = 0;
this.lblTileIndex.Text = "Tile Index:"; this.lblTileIndex.Text = "Tile Index:";
// //
// txtTileIndex // txtTileIndex
// //
this.txtTileIndex.BackColor = System.Drawing.SystemColors.Window; this.txtTileIndex.BackColor = System.Drawing.SystemColors.Window;
this.txtTileIndex.Location = new System.Drawing.Point(75, 29); this.txtTileIndex.Location = new System.Drawing.Point(74, 31);
this.txtTileIndex.Name = "txtTileIndex"; this.txtTileIndex.Name = "txtTileIndex";
this.txtTileIndex.ReadOnly = true; this.txtTileIndex.ReadOnly = true;
this.txtTileIndex.Size = new System.Drawing.Size(26, 20); this.txtTileIndex.Size = new System.Drawing.Size(26, 22);
this.txtTileIndex.TabIndex = 7; this.txtTileIndex.TabIndex = 7;
// //
// lblTile // lblTile
// //
this.lblTile.AutoSize = true; this.lblTile.AutoSize = true;
this.lblTile.Location = new System.Drawing.Point(3, 57); this.lblTile.Location = new System.Drawing.Point(3, 61);
this.lblTile.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0); this.lblTile.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
this.lblTile.Name = "lblTile"; this.lblTile.Name = "lblTile";
this.lblTile.Size = new System.Drawing.Size(27, 13); this.lblTile.Size = new System.Drawing.Size(26, 12);
this.lblTile.TabIndex = 6; this.lblTile.TabIndex = 6;
this.lblTile.Text = "Tile:"; this.lblTile.Text = "Tile:";
// //
@ -323,10 +323,10 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.picTile.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.picTile.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.picTile.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.picTile.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picTile.Location = new System.Drawing.Point(75, 55); this.picTile.Location = new System.Drawing.Point(74, 59);
this.picTile.Name = "picTile"; this.picTile.Name = "picTile";
this.tlpInfo.SetRowSpan(this.picTile, 3); this.tlpInfo.SetRowSpan(this.picTile, 3);
this.picTile.Size = new System.Drawing.Size(66, 130); this.picTile.Size = new System.Drawing.Size(66, 120);
this.picTile.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.picTile.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picTile.TabIndex = 12; this.picTile.TabIndex = 12;
this.picTile.TabStop = false; this.picTile.TabStop = false;
@ -335,9 +335,9 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.chkDisplaySpriteOutlines.AutoSize = true; this.chkDisplaySpriteOutlines.AutoSize = true;
this.tlpInfo.SetColumnSpan(this.chkDisplaySpriteOutlines, 4); this.tlpInfo.SetColumnSpan(this.chkDisplaySpriteOutlines, 4);
this.chkDisplaySpriteOutlines.Location = new System.Drawing.Point(3, 441); this.chkDisplaySpriteOutlines.Location = new System.Drawing.Point(3, 417);
this.chkDisplaySpriteOutlines.Name = "chkDisplaySpriteOutlines"; this.chkDisplaySpriteOutlines.Name = "chkDisplaySpriteOutlines";
this.chkDisplaySpriteOutlines.Size = new System.Drawing.Size(227, 17); this.chkDisplaySpriteOutlines.Size = new System.Drawing.Size(228, 16);
this.chkDisplaySpriteOutlines.TabIndex = 27; this.chkDisplaySpriteOutlines.TabIndex = 27;
this.chkDisplaySpriteOutlines.Text = "Display outline around all sprites in preview"; this.chkDisplaySpriteOutlines.Text = "Display outline around all sprites in preview";
this.chkDisplaySpriteOutlines.UseVisualStyleBackColor = true; this.chkDisplaySpriteOutlines.UseVisualStyleBackColor = true;
@ -353,7 +353,7 @@ namespace Mesen.GUI.Debugger.Controls
this.tableLayoutPanel1.Controls.Add(this.chkHorizontalMirroring, 0, 0); this.tableLayoutPanel1.Controls.Add(this.chkHorizontalMirroring, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.chkVerticalMirroring, 0, 1); this.tableLayoutPanel1.Controls.Add(this.chkVerticalMirroring, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.chkBackgroundPriority, 0, 2); this.tableLayoutPanel1.Controls.Add(this.chkBackgroundPriority, 0, 2);
this.tableLayoutPanel1.Location = new System.Drawing.Point(144, 118); this.tableLayoutPanel1.Location = new System.Drawing.Point(143, 121);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(3); this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(3);
@ -361,7 +361,7 @@ namespace Mesen.GUI.Debugger.Controls
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(130, 57); this.tableLayoutPanel1.Size = new System.Drawing.Size(132, 54);
this.tableLayoutPanel1.TabIndex = 24; this.tableLayoutPanel1.TabIndex = 24;
// //
// chkHorizontalMirroring // chkHorizontalMirroring
@ -371,7 +371,7 @@ namespace Mesen.GUI.Debugger.Controls
this.chkHorizontalMirroring.Location = new System.Drawing.Point(6, 3); this.chkHorizontalMirroring.Location = new System.Drawing.Point(6, 3);
this.chkHorizontalMirroring.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); this.chkHorizontalMirroring.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.chkHorizontalMirroring.Name = "chkHorizontalMirroring"; this.chkHorizontalMirroring.Name = "chkHorizontalMirroring";
this.chkHorizontalMirroring.Size = new System.Drawing.Size(89, 17); this.chkHorizontalMirroring.Size = new System.Drawing.Size(92, 16);
this.chkHorizontalMirroring.TabIndex = 13; this.chkHorizontalMirroring.TabIndex = 13;
this.chkHorizontalMirroring.Text = "Horizontal flip"; this.chkHorizontalMirroring.Text = "Horizontal flip";
this.chkHorizontalMirroring.UseVisualStyleBackColor = true; this.chkHorizontalMirroring.UseVisualStyleBackColor = true;
@ -380,10 +380,10 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.chkVerticalMirroring.AutoCheck = false; this.chkVerticalMirroring.AutoCheck = false;
this.chkVerticalMirroring.AutoSize = true; this.chkVerticalMirroring.AutoSize = true;
this.chkVerticalMirroring.Location = new System.Drawing.Point(6, 20); this.chkVerticalMirroring.Location = new System.Drawing.Point(6, 19);
this.chkVerticalMirroring.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); this.chkVerticalMirroring.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.chkVerticalMirroring.Name = "chkVerticalMirroring"; this.chkVerticalMirroring.Name = "chkVerticalMirroring";
this.chkVerticalMirroring.Size = new System.Drawing.Size(77, 17); this.chkVerticalMirroring.Size = new System.Drawing.Size(79, 16);
this.chkVerticalMirroring.TabIndex = 14; this.chkVerticalMirroring.TabIndex = 14;
this.chkVerticalMirroring.Text = "Vertical flip"; this.chkVerticalMirroring.Text = "Vertical flip";
this.chkVerticalMirroring.UseVisualStyleBackColor = true; this.chkVerticalMirroring.UseVisualStyleBackColor = true;
@ -392,10 +392,10 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.chkBackgroundPriority.AutoCheck = false; this.chkBackgroundPriority.AutoCheck = false;
this.chkBackgroundPriority.AutoSize = true; this.chkBackgroundPriority.AutoSize = true;
this.chkBackgroundPriority.Location = new System.Drawing.Point(6, 37); this.chkBackgroundPriority.Location = new System.Drawing.Point(6, 35);
this.chkBackgroundPriority.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); this.chkBackgroundPriority.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.chkBackgroundPriority.Name = "chkBackgroundPriority"; this.chkBackgroundPriority.Name = "chkBackgroundPriority";
this.chkBackgroundPriority.Size = new System.Drawing.Size(118, 17); this.chkBackgroundPriority.Size = new System.Drawing.Size(120, 16);
this.chkBackgroundPriority.TabIndex = 19; this.chkBackgroundPriority.TabIndex = 19;
this.chkBackgroundPriority.Text = "Background Priority"; this.chkBackgroundPriority.Text = "Background Priority";
this.chkBackgroundPriority.UseVisualStyleBackColor = true; this.chkBackgroundPriority.UseVisualStyleBackColor = true;
@ -404,9 +404,9 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.lblPosition.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPosition.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblPosition.AutoSize = true; this.lblPosition.AutoSize = true;
this.lblPosition.Location = new System.Drawing.Point(147, 98); this.lblPosition.Location = new System.Drawing.Point(146, 101);
this.lblPosition.Name = "lblPosition"; this.lblPosition.Name = "lblPosition";
this.lblPosition.Size = new System.Drawing.Size(73, 13); this.lblPosition.Size = new System.Drawing.Size(75, 12);
this.lblPosition.TabIndex = 16; this.lblPosition.TabIndex = 16;
this.lblPosition.Text = "Position (X,Y):"; this.lblPosition.Text = "Position (X,Y):";
// //
@ -414,20 +414,20 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.lblPalette.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPalette.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblPalette.AutoSize = true; this.lblPalette.AutoSize = true;
this.lblPalette.Location = new System.Drawing.Point(147, 68); this.lblPalette.Location = new System.Drawing.Point(146, 71);
this.lblPalette.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0); this.lblPalette.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
this.lblPalette.Name = "lblPalette"; this.lblPalette.Name = "lblPalette";
this.lblPalette.Size = new System.Drawing.Size(43, 13); this.lblPalette.Size = new System.Drawing.Size(38, 12);
this.lblPalette.TabIndex = 26; this.lblPalette.TabIndex = 26;
this.lblPalette.Text = "Palette:"; this.lblPalette.Text = "Palette:";
// //
// txtPosition // txtPosition
// //
this.txtPosition.BackColor = System.Drawing.SystemColors.Window; this.txtPosition.BackColor = System.Drawing.SystemColors.Window;
this.txtPosition.Location = new System.Drawing.Point(237, 95); this.txtPosition.Location = new System.Drawing.Point(230, 96);
this.txtPosition.Name = "txtPosition"; this.txtPosition.Name = "txtPosition";
this.txtPosition.ReadOnly = true; this.txtPosition.ReadOnly = true;
this.txtPosition.Size = new System.Drawing.Size(66, 20); this.txtPosition.Size = new System.Drawing.Size(66, 22);
this.txtPosition.TabIndex = 18; this.txtPosition.TabIndex = 18;
// //
// ctrlTilePalette // ctrlTilePalette
@ -436,18 +436,18 @@ namespace Mesen.GUI.Debugger.Controls
this.tlpInfo.SetColumnSpan(this.ctrlTilePalette, 2); this.tlpInfo.SetColumnSpan(this.ctrlTilePalette, 2);
this.ctrlTilePalette.DisplayIndexes = false; this.ctrlTilePalette.DisplayIndexes = false;
this.ctrlTilePalette.HighlightMouseOver = false; this.ctrlTilePalette.HighlightMouseOver = false;
this.ctrlTilePalette.Location = new System.Drawing.Point(237, 55); this.ctrlTilePalette.Location = new System.Drawing.Point(230, 59);
this.ctrlTilePalette.Name = "ctrlTilePalette"; this.ctrlTilePalette.Name = "ctrlTilePalette";
this.ctrlTilePalette.Size = new System.Drawing.Size(130, 34); this.ctrlTilePalette.Size = new System.Drawing.Size(130, 31);
this.ctrlTilePalette.TabIndex = 25; this.ctrlTilePalette.TabIndex = 25;
// //
// lblTileAddress // lblTileAddress
// //
this.lblTileAddress.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblTileAddress.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblTileAddress.AutoSize = true; this.lblTileAddress.AutoSize = true;
this.lblTileAddress.Location = new System.Drawing.Point(147, 6); this.lblTileAddress.Location = new System.Drawing.Point(146, 8);
this.lblTileAddress.Name = "lblTileAddress"; this.lblTileAddress.Name = "lblTileAddress";
this.lblTileAddress.Size = new System.Drawing.Size(68, 13); this.lblTileAddress.Size = new System.Drawing.Size(66, 12);
this.lblTileAddress.TabIndex = 1; this.lblTileAddress.TabIndex = 1;
this.lblTileAddress.Text = "Tile Address:"; this.lblTileAddress.Text = "Tile Address:";
// //
@ -455,28 +455,28 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.lblPaletteAddr.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPaletteAddr.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblPaletteAddr.AutoSize = true; this.lblPaletteAddr.AutoSize = true;
this.lblPaletteAddr.Location = new System.Drawing.Point(147, 32); this.lblPaletteAddr.Location = new System.Drawing.Point(146, 36);
this.lblPaletteAddr.Name = "lblPaletteAddr"; this.lblPaletteAddr.Name = "lblPaletteAddr";
this.lblPaletteAddr.Size = new System.Drawing.Size(84, 13); this.lblPaletteAddr.Size = new System.Drawing.Size(78, 12);
this.lblPaletteAddr.TabIndex = 15; this.lblPaletteAddr.TabIndex = 15;
this.lblPaletteAddr.Text = "Palette Address:"; this.lblPaletteAddr.Text = "Palette Address:";
// //
// txtTileAddress // txtTileAddress
// //
this.txtTileAddress.BackColor = System.Drawing.SystemColors.Window; this.txtTileAddress.BackColor = System.Drawing.SystemColors.Window;
this.txtTileAddress.Location = new System.Drawing.Point(237, 3); this.txtTileAddress.Location = new System.Drawing.Point(230, 3);
this.txtTileAddress.Name = "txtTileAddress"; this.txtTileAddress.Name = "txtTileAddress";
this.txtTileAddress.ReadOnly = true; this.txtTileAddress.ReadOnly = true;
this.txtTileAddress.Size = new System.Drawing.Size(42, 20); this.txtTileAddress.Size = new System.Drawing.Size(42, 22);
this.txtTileAddress.TabIndex = 8; this.txtTileAddress.TabIndex = 8;
// //
// txtPaletteAddress // txtPaletteAddress
// //
this.txtPaletteAddress.BackColor = System.Drawing.SystemColors.Window; this.txtPaletteAddress.BackColor = System.Drawing.SystemColors.Window;
this.txtPaletteAddress.Location = new System.Drawing.Point(237, 29); this.txtPaletteAddress.Location = new System.Drawing.Point(230, 31);
this.txtPaletteAddress.Name = "txtPaletteAddress"; this.txtPaletteAddress.Name = "txtPaletteAddress";
this.txtPaletteAddress.ReadOnly = true; this.txtPaletteAddress.ReadOnly = true;
this.txtPaletteAddress.Size = new System.Drawing.Size(42, 20); this.txtPaletteAddress.Size = new System.Drawing.Size(42, 22);
this.txtPaletteAddress.TabIndex = 17; this.txtPaletteAddress.TabIndex = 17;
// //
// tableLayoutPanel3 // tableLayoutPanel3
@ -497,15 +497,15 @@ namespace Mesen.GUI.Debugger.Controls
this.tableLayoutPanel3.Name = "tableLayoutPanel3"; this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 1; this.tableLayoutPanel3.RowCount = 1;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(416, 25); this.tableLayoutPanel3.Size = new System.Drawing.Size(416, 23);
this.tableLayoutPanel3.TabIndex = 5; this.tableLayoutPanel3.TabIndex = 5;
// //
// radCpuPage // radCpuPage
// //
this.radCpuPage.AutoSize = true; this.radCpuPage.AutoSize = true;
this.radCpuPage.Location = new System.Drawing.Point(164, 3); this.radCpuPage.Location = new System.Drawing.Point(158, 3);
this.radCpuPage.Name = "radCpuPage"; this.radCpuPage.Name = "radCpuPage";
this.radCpuPage.Size = new System.Drawing.Size(85, 17); this.radCpuPage.Size = new System.Drawing.Size(79, 16);
this.radCpuPage.TabIndex = 2; this.radCpuPage.TabIndex = 2;
this.radCpuPage.Text = "CPU Page #"; this.radCpuPage.Text = "CPU Page #";
this.radCpuPage.UseVisualStyleBackColor = true; this.radCpuPage.UseVisualStyleBackColor = true;
@ -514,9 +514,9 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 6); this.label1.Location = new System.Drawing.Point(3, 5);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(70, 13); this.label1.Size = new System.Drawing.Size(64, 12);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "Data Source:"; this.label1.Text = "Data Source:";
// //
@ -524,9 +524,9 @@ namespace Mesen.GUI.Debugger.Controls
// //
this.radSpriteRam.AutoSize = true; this.radSpriteRam.AutoSize = true;
this.radSpriteRam.Checked = true; this.radSpriteRam.Checked = true;
this.radSpriteRam.Location = new System.Drawing.Point(79, 3); this.radSpriteRam.Location = new System.Drawing.Point(73, 3);
this.radSpriteRam.Name = "radSpriteRam"; this.radSpriteRam.Name = "radSpriteRam";
this.radSpriteRam.Size = new System.Drawing.Size(79, 17); this.radSpriteRam.Size = new System.Drawing.Size(79, 16);
this.radSpriteRam.TabIndex = 1; this.radSpriteRam.TabIndex = 1;
this.radSpriteRam.TabStop = true; this.radSpriteRam.TabStop = true;
this.radSpriteRam.Text = "Sprite RAM"; this.radSpriteRam.Text = "Sprite RAM";
@ -535,14 +535,14 @@ namespace Mesen.GUI.Debugger.Controls
// nudCpuPage // nudCpuPage
// //
this.nudCpuPage.Hexadecimal = true; this.nudCpuPage.Hexadecimal = true;
this.nudCpuPage.Location = new System.Drawing.Point(255, 3); this.nudCpuPage.Location = new System.Drawing.Point(243, 3);
this.nudCpuPage.Maximum = new decimal(new int[] { this.nudCpuPage.Maximum = new decimal(new int[] {
255, 255,
0, 0,
0, 0,
0}); 0});
this.nudCpuPage.Name = "nudCpuPage"; this.nudCpuPage.Name = "nudCpuPage";
this.nudCpuPage.Size = new System.Drawing.Size(42, 20); this.nudCpuPage.Size = new System.Drawing.Size(42, 22);
this.nudCpuPage.TabIndex = 3; this.nudCpuPage.TabIndex = 3;
this.nudCpuPage.Click += new System.EventHandler(this.nudCpuPage_Click); this.nudCpuPage.Click += new System.EventHandler(this.nudCpuPage_Click);
// //
@ -555,7 +555,7 @@ namespace Mesen.GUI.Debugger.Controls
this.picSprites.Margin = new System.Windows.Forms.Padding(4); this.picSprites.Margin = new System.Windows.Forms.Padding(4);
this.picSprites.Name = "picSprites"; this.picSprites.Name = "picSprites";
this.tlpMain.SetRowSpan(this.picSprites, 2); this.tlpMain.SetRowSpan(this.picSprites, 2);
this.picSprites.Size = new System.Drawing.Size(258, 514); this.picSprites.Size = new System.Drawing.Size(258, 475);
this.picSprites.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.picSprites.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picSprites.TabIndex = 0; this.picSprites.TabIndex = 0;
this.picSprites.TabStop = false; this.picSprites.TabStop = false;
@ -566,11 +566,11 @@ namespace Mesen.GUI.Debugger.Controls
// //
// ctrlSpriteViewer // ctrlSpriteViewer
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tlpMain); this.Controls.Add(this.tlpMain);
this.Name = "ctrlSpriteViewer"; this.Name = "ctrlSpriteViewer";
this.Size = new System.Drawing.Size(682, 527); this.Size = new System.Drawing.Size(682, 486);
this.tlpMain.ResumeLayout(false); this.tlpMain.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false);
this.grpSpriteInfo.ResumeLayout(false); this.grpSpriteInfo.ResumeLayout(false);

View file

@ -390,10 +390,21 @@ namespace Mesen.GUI.Debugger.Controls
} }
_contextMenuSpriteIndex = _selectedSprite; _contextMenuSpriteIndex = _selectedSprite;
_copyData = ToHdPackFormat(_selectedSprite);
if (_largeSprites)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine(ToHdPackFormat(_selectedSprite, false));
sb.AppendLine(ToHdPackFormat(_selectedSprite, true));
_copyData = sb.ToString();
}
else {
_copyData = ToHdPackFormat(_selectedSprite, false);
} }
private string ToHdPackFormat(int spriteIndex) }
private string ToHdPackFormat(int spriteIndex, bool isLargeSpriteSecondHalf)
{ {
int ramAddr = spriteIndex * 4; int ramAddr = spriteIndex * 4;
int tileIndex = _spriteRam[ramAddr + 1]; int tileIndex = _spriteRam[ramAddr + 1];
@ -401,7 +412,7 @@ namespace Mesen.GUI.Debugger.Controls
int tileAddr; int tileAddr;
if(_largeSprites) { if(_largeSprites) {
tileAddr = ((tileIndex & 0x01) == 0x01 ? 0x1000 : 0x0000) + ((tileIndex & 0xFE) << 4); tileAddr = ((tileIndex & 0x01) == 0x01 ? 0x1000 : 0x0000) + (((tileIndex & 0xFE) + (isLargeSpriteSecondHalf ? 1 : 0)) << 4);
} else { } else {
tileAddr = _spritePatternAddr + (tileIndex << 4); tileAddr = _spritePatternAddr + (tileIndex << 4);
} }
@ -544,13 +555,31 @@ namespace Mesen.GUI.Debugger.Controls
bool verticalMirror = (attributes & 0x80) == 0x80; bool verticalMirror = (attributes & 0x80) == 0x80;
if(spriteY >= 0 && spriteY < 240) { if(spriteY >= 0 && spriteY < 240) {
if (_largeSprites){
sb.AppendLine( sb.AppendLine(
ToHdPackFormat(i) + "," + ToHdPackFormat(i, verticalMirror) + "," +
spriteX.ToString() + "," + spriteX.ToString() + "," +
spriteY.ToString() + "," + spriteY.ToString() + "," +
(horizontalMirror ? "Y" : "N") + "," + (horizontalMirror ? "Y" : "N") + "," +
(verticalMirror ? "Y" : "N") (verticalMirror ? "Y" : "N")
); );
sb.AppendLine(
ToHdPackFormat(i, !verticalMirror) + "," +
spriteX.ToString() + "," +
(spriteY + 8).ToString() + "," +
(horizontalMirror ? "Y" : "N") + "," +
(verticalMirror ? "Y" : "N")
);
}
else{
sb.AppendLine(
ToHdPackFormat(i, false) + "," +
spriteX.ToString() + "," +
spriteY.ToString() + "," +
(horizontalMirror ? "Y" : "N") + "," +
(verticalMirror ? "Y" : "N")
);
}
} }
} }
if(sb.Length > 0) { if(sb.Length > 0) {