diff --git a/GUI.NET/Debugger/Controls/ctrlChrViewer.Designer.cs b/GUI.NET/Debugger/Controls/ctrlChrViewer.Designer.cs index 52df1ab4..7e5a81de 100644 --- a/GUI.NET/Debugger/Controls/ctrlChrViewer.Designer.cs +++ b/GUI.NET/Debugger/Controls/ctrlChrViewer.Designer.cs @@ -89,7 +89,7 @@ this.grpTileInfo.Dock = System.Windows.Forms.DockStyle.Top; this.grpTileInfo.Location = new System.Drawing.Point(267, 3); this.grpTileInfo.Name = "grpTileInfo"; - this.grpTileInfo.Size = new System.Drawing.Size(264, 142); + this.grpTileInfo.Size = new System.Drawing.Size(264, 152); this.grpTileInfo.TabIndex = 4; this.grpTileInfo.TabStop = false; this.grpTileInfo.Text = "Tile Info"; diff --git a/GUI.NET/Debugger/Controls/ctrlChrViewer.cs b/GUI.NET/Debugger/Controls/ctrlChrViewer.cs index d37a18c3..9588c974 100644 --- a/GUI.NET/Debugger/Controls/ctrlChrViewer.cs +++ b/GUI.NET/Debugger/Controls/ctrlChrViewer.cs @@ -56,8 +56,8 @@ namespace Mesen.GUI.Debugger.Controls g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half; - g.Clear(Color.Black); - g.DrawImage(source, new Rectangle(0, 0, 256, 256), new Rectangle(0, 0, 128, 128), GraphicsUnit.Pixel); + g.ScaleTransform(2, 2); + g.DrawImageUnscaled(source, 0, 0); } chrBanks[i].Image = target; } finally { @@ -142,11 +142,16 @@ namespace Mesen.GUI.Debugger.Controls this.txtTileAddress.Text = (baseAddress + tileIndex * 16).ToString("X4"); Bitmap tile = new Bitmap(64, 64); + Bitmap tilePreview = new Bitmap(16, 16); + using(Graphics g = Graphics.FromImage(tilePreview)) { + g.DrawImage(((PictureBox)sender).Image, new Rectangle(0, 0, 16, 16), new Rectangle(tileX*16, tileY*16, 16, 16), GraphicsUnit.Pixel); + } using(Graphics g = Graphics.FromImage(tile)) { g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half; - g.DrawImage(((PictureBox)sender).Image, new Rectangle(0, 0, 64, 64), new Rectangle(tileX*16, tileY*16, 16, 16), GraphicsUnit.Pixel); + g.ScaleTransform(4, 4); + g.DrawImageUnscaled(tilePreview, 0, 0); } this.picTile.Image = tile; } diff --git a/GUI.NET/Debugger/Controls/ctrlConsoleStatus.Designer.cs b/GUI.NET/Debugger/Controls/ctrlConsoleStatus.Designer.cs index f7a1b1ca..a19a3a1a 100644 --- a/GUI.NET/Debugger/Controls/ctrlConsoleStatus.Designer.cs +++ b/GUI.NET/Debugger/Controls/ctrlConsoleStatus.Designer.cs @@ -150,16 +150,14 @@ this.tableLayoutPanel2.RowCount = 3; 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.Absolute, 20F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.Size = new System.Drawing.Size(470, 391); this.tableLayoutPanel2.TabIndex = 2; // // grpPPUStatus // - this.grpPPUStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); this.grpPPUStatus.Controls.Add(this.tableLayoutPanel8); + this.grpPPUStatus.Dock = System.Windows.Forms.DockStyle.Fill; this.grpPPUStatus.Location = new System.Drawing.Point(3, 180); this.grpPPUStatus.Name = "grpPPUStatus"; this.grpPPUStatus.Size = new System.Drawing.Size(464, 179); diff --git a/GUI.NET/Debugger/Controls/ctrlMemoryAccessCounters.Designer.cs b/GUI.NET/Debugger/Controls/ctrlMemoryAccessCounters.Designer.cs index 09246e27..cdec3503 100644 --- a/GUI.NET/Debugger/Controls/ctrlMemoryAccessCounters.Designer.cs +++ b/GUI.NET/Debugger/Controls/ctrlMemoryAccessCounters.Designer.cs @@ -104,7 +104,7 @@ this.flowLayoutPanel2.Controls.Add(this.cboSort); this.flowLayoutPanel2.Location = new System.Drawing.Point(335, 3); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Size = new System.Drawing.Size(176, 26); + this.flowLayoutPanel2.Size = new System.Drawing.Size(182, 26); this.flowLayoutPanel2.TabIndex = 3; // // lblSort diff --git a/GUI.NET/Debugger/Controls/ctrlNametableViewer.Designer.cs b/GUI.NET/Debugger/Controls/ctrlNametableViewer.Designer.cs index 627acd14..e2fc9943 100644 --- a/GUI.NET/Debugger/Controls/ctrlNametableViewer.Designer.cs +++ b/GUI.NET/Debugger/Controls/ctrlNametableViewer.Designer.cs @@ -90,7 +90,7 @@ this.grpTileInfo.Controls.Add(this.tableLayoutPanel2); this.grpTileInfo.Location = new System.Drawing.Point(519, 3); this.grpTileInfo.Name = "grpTileInfo"; - this.grpTileInfo.Size = new System.Drawing.Size(175, 224); + this.grpTileInfo.Size = new System.Drawing.Size(175, 238); this.grpTileInfo.TabIndex = 4; this.grpTileInfo.TabStop = false; this.grpTileInfo.Text = "Tile Info"; @@ -196,7 +196,7 @@ this.lblAttributeAddress.Name = "lblAttributeAddress"; this.lblAttributeAddress.Size = new System.Drawing.Size(90, 13); this.lblAttributeAddress.TabIndex = 3; - this.lblAttributeAddress.Text = "Attribute Address:"; + this.lblAttributeAddress.Text = "Attribute Addr:"; // // lblPaletteAddress // @@ -206,7 +206,7 @@ this.lblPaletteAddress.Name = "lblPaletteAddress"; this.lblPaletteAddress.Size = new System.Drawing.Size(84, 13); this.lblPaletteAddress.TabIndex = 4; - this.lblPaletteAddress.Text = "Palette Address:"; + this.lblPaletteAddress.Text = "Palette Addr:"; // // lblTile // diff --git a/GUI.NET/Debugger/Controls/ctrlNametableViewer.cs b/GUI.NET/Debugger/Controls/ctrlNametableViewer.cs index 3c8e181f..a6911ae2 100644 --- a/GUI.NET/Debugger/Controls/ctrlNametableViewer.cs +++ b/GUI.NET/Debugger/Controls/ctrlNametableViewer.cs @@ -165,12 +165,17 @@ namespace Mesen.GUI.Debugger.Controls this.txtAttributeAddress.Text = attributeAddr.ToString("X4"); this.txtPaletteAddress.Text = (0x3F00 + paletteBaseAddr).ToString("X4"); - Bitmap tile = new Bitmap(64, 64); + Bitmap tile = new Bitmap(64, 64); + Bitmap tilePreview = new Bitmap(8, 8); + using(Graphics g = Graphics.FromImage(tilePreview)) { + g.DrawImage(_nametableImage, new Rectangle(0, 0, 8, 8), new Rectangle(e.X/8*8, e.Y/8*8, 8, 8), GraphicsUnit.Pixel); + } using(Graphics g = Graphics.FromImage(tile)) { g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half; - g.DrawImage(_nametableImage, new Rectangle(0, 0, 64, 64), new Rectangle(e.X/8*8, e.Y/8*8, 8, 8), GraphicsUnit.Pixel); + g.ScaleTransform(8, 8); + g.DrawImageUnscaled(tilePreview, 0, 0); } this.picTile.Image = tile; } diff --git a/GUI.NET/Debugger/Controls/ctrlPaletteViewer.cs b/GUI.NET/Debugger/Controls/ctrlPaletteViewer.cs index ec7714bf..482e0f8c 100644 --- a/GUI.NET/Debugger/Controls/ctrlPaletteViewer.cs +++ b/GUI.NET/Debugger/Controls/ctrlPaletteViewer.cs @@ -44,7 +44,8 @@ namespace Mesen.GUI.Debugger.Controls g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half; - g.DrawImage(source, new Rectangle(0, 0, 128, 256), new Rectangle(0, 0, 4, 8), GraphicsUnit.Pixel); + g.ScaleTransform(32, 32); + g.DrawImageUnscaled(source, 0, 0); } this.picPalette.Image = target; } finally { diff --git a/GUI.NET/Debugger/Controls/ctrlSpriteViewer.cs b/GUI.NET/Debugger/Controls/ctrlSpriteViewer.cs index 37bc4b31..2340f995 100644 --- a/GUI.NET/Debugger/Controls/ctrlSpriteViewer.cs +++ b/GUI.NET/Debugger/Controls/ctrlSpriteViewer.cs @@ -51,7 +51,9 @@ namespace Mesen.GUI.Debugger.Controls g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half; - g.DrawImage(source, new Rectangle(0, 0, 256, 512), new Rectangle(0, 0, 64, 128), GraphicsUnit.Pixel); + + g.ScaleTransform(4, 4); + g.DrawImageUnscaled(source, 0, 0); } picSprites.Image = target; } finally { @@ -142,11 +144,16 @@ namespace Mesen.GUI.Debugger.Controls this.chkBackgroundPriority.Checked = backgroundPriority; Bitmap tile = new Bitmap(64, 128); + Bitmap tilePreview = new Bitmap(8, 16); + using(Graphics g = Graphics.FromImage(tilePreview)) { + g.DrawImage(((PictureBox)sender).Image, new Rectangle(0, 0, 8, 16), new Rectangle(tileX*32, tileY*64, 32, 64), GraphicsUnit.Pixel); + } using(Graphics g = Graphics.FromImage(tile)) { g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half; - g.DrawImage(((PictureBox)sender).Image, new Rectangle(0, 0, 64, 128), new Rectangle(tileX*32, tileY*64, 32, 64), GraphicsUnit.Pixel); + g.ScaleTransform(8, 8); + g.DrawImageUnscaled(tilePreview, 0, 0); } this.picTile.Image = tile; diff --git a/GUI.NET/Debugger/frmMemoryViewer.Designer.cs b/GUI.NET/Debugger/frmMemoryViewer.Designer.cs index d84f10c1..97eb0b00 100644 --- a/GUI.NET/Debugger/frmMemoryViewer.Designer.cs +++ b/GUI.NET/Debugger/frmMemoryViewer.Designer.cs @@ -87,7 +87,7 @@ // this.flowLayoutPanel1.Controls.Add(this.lblViewMemoryType); this.flowLayoutPanel1.Controls.Add(this.cboMemoryType); - this.flowLayoutPanel1.Location = new System.Drawing.Point(6, 31); + this.flowLayoutPanel1.Location = new System.Drawing.Point(6, 27); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new System.Drawing.Size(167, 27); this.flowLayoutPanel1.TabIndex = 1; diff --git a/GUI.NET/Forms/Config/frmVideoConfig.Designer.cs b/GUI.NET/Forms/Config/frmVideoConfig.Designer.cs index a0683bcd..3dd674b2 100644 --- a/GUI.NET/Forms/Config/frmVideoConfig.Designer.cs +++ b/GUI.NET/Forms/Config/frmVideoConfig.Designer.cs @@ -891,8 +891,7 @@ // this.tableLayoutPanel3.ColumnCount = 2; this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel3.Controls.Add(this.picPalette, 0, 1); this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel2, 1, 1); this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; @@ -911,7 +910,7 @@ this.picPalette.Location = new System.Drawing.Point(1, 1); this.picPalette.Margin = new System.Windows.Forms.Padding(1); this.picPalette.Name = "picPalette"; - this.picPalette.Size = new System.Drawing.Size(386, 98); + this.picPalette.Size = new System.Drawing.Size(352, 88); this.picPalette.TabIndex = 0; this.picPalette.TabStop = false; this.picPalette.MouseDown += new System.Windows.Forms.MouseEventHandler(this.picPalette_MouseDown); @@ -923,6 +922,7 @@ this.tableLayoutPanel2.Controls.Add(this.btnExportPalette, 0, 2); this.tableLayoutPanel2.Controls.Add(this.btnSelectPalette, 0, 0); this.tableLayoutPanel2.Controls.Add(this.btnLoadPalFile, 0, 1); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(388, 0); this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; diff --git a/GUI.NET/Forms/Config/frmVideoConfig.cs b/GUI.NET/Forms/Config/frmVideoConfig.cs index 6947f7ea..8920ce37 100644 --- a/GUI.NET/Forms/Config/frmVideoConfig.cs +++ b/GUI.NET/Forms/Config/frmVideoConfig.cs @@ -102,7 +102,8 @@ namespace Mesen.GUI.Forms.Config g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half; - g.DrawImage(source, new Rectangle(0, 0, 384, 96), new Rectangle(0, 0, 16, 4), GraphicsUnit.Pixel); + g.ScaleTransform(22, 22); + g.DrawImageUnscaled(source, 0, 0); } this.picPalette.Image = target; } finally { @@ -112,7 +113,7 @@ namespace Mesen.GUI.Forms.Config private void picPalette_MouseDown(object sender, MouseEventArgs e) { - int offset = (e.X / 24) + (e.Y / 24 * 16); + int offset = (e.X / 22) + (e.Y / 22 * 16); colorDialog.SolidColorOnly = true; colorDialog.AllowFullOpen = true; diff --git a/GUI.NET/Forms/frmAbout.Designer.cs b/GUI.NET/Forms/frmAbout.Designer.cs index 34a85db8..6869bfdb 100644 --- a/GUI.NET/Forms/frmAbout.Designer.cs +++ b/GUI.NET/Forms/frmAbout.Designer.cs @@ -70,6 +70,7 @@ // this.logoPictureBox.Image = global::Mesen.GUI.Properties.Resources.MesenLogo; this.logoPictureBox.Location = new System.Drawing.Point(3, 3); + this.logoPictureBox.Margin = new System.Windows.Forms.Padding(0, 0, 0, 5); this.logoPictureBox.Name = "logoPictureBox"; this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 4); this.logoPictureBox.Size = new System.Drawing.Size(64, 65);