From 8078018905bc1a2a9f8c19372029ab6ae5d23832 Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Wed, 9 Mar 2011 03:47:48 +0000 Subject: [PATCH] NES PPU Viewer - start pattern viewer --- .../BizHawk.MultiClient.csproj | 3 + .../NEStools/NESPPU.Designer.cs | 36 ++++++++---- BizHawk.MultiClient/NEStools/PaletteViewer.cs | 55 ------------------- BizHawk.MultiClient/NEStools/PatternViewer.cs | 39 +++++++++++++ 4 files changed, 66 insertions(+), 67 deletions(-) create mode 100644 BizHawk.MultiClient/NEStools/PatternViewer.cs diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index ba6a80dc8d..182ffc95b6 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -138,6 +138,9 @@ Component + + Component + Form diff --git a/BizHawk.MultiClient/NEStools/NESPPU.Designer.cs b/BizHawk.MultiClient/NEStools/NESPPU.Designer.cs index 8fcf5a6a5d..834803e738 100644 --- a/BizHawk.MultiClient/NEStools/NESPPU.Designer.cs +++ b/BizHawk.MultiClient/NEStools/NESPPU.Designer.cs @@ -30,17 +30,20 @@ { this.groupBox1 = new System.Windows.Forms.GroupBox(); this.PalettesGroup = new System.Windows.Forms.GroupBox(); - this.PaletteView = new BizHawk.MultiClient.PaletteViewer(); this.DetailsBox = new System.Windows.Forms.GroupBox(); this.SectionLabel = new System.Windows.Forms.Label(); this.AddressLabel = new System.Windows.Forms.Label(); this.ValueLabel = new System.Windows.Forms.Label(); + this.PaletteView = new BizHawk.MultiClient.PaletteViewer(); + this.PatternView = new BizHawk.MultiClient.PatternViewer(); + this.groupBox1.SuspendLayout(); this.PalettesGroup.SuspendLayout(); this.DetailsBox.SuspendLayout(); this.SuspendLayout(); // // groupBox1 // + this.groupBox1.Controls.Add(this.PatternView); this.groupBox1.Location = new System.Drawing.Point(12, 26); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(281, 199); @@ -58,17 +61,6 @@ this.PalettesGroup.TabStop = false; this.PalettesGroup.Text = "Palettes"; // - // PaletteView - // - this.PaletteView.BackColor = System.Drawing.Color.White; - this.PaletteView.Location = new System.Drawing.Point(6, 19); - this.PaletteView.Name = "PaletteView"; - this.PaletteView.Size = new System.Drawing.Size(257, 34); - this.PaletteView.TabIndex = 0; - this.PaletteView.MouseLeave += new System.EventHandler(this.PaletteView_MouseLeave); - this.PaletteView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PaletteView_MouseMove); - this.PaletteView.MouseEnter += new System.EventHandler(this.PaletteView_MouseEnter); - // // DetailsBox // this.DetailsBox.Controls.Add(this.ValueLabel); @@ -108,6 +100,23 @@ this.ValueLabel.TabIndex = 2; this.ValueLabel.Text = "label1"; // + // PaletteView + // + this.PaletteView.BackColor = System.Drawing.Color.White; + this.PaletteView.Location = new System.Drawing.Point(6, 19); + this.PaletteView.Name = "PaletteView"; + this.PaletteView.Size = new System.Drawing.Size(257, 34); + this.PaletteView.TabIndex = 0; + this.PaletteView.MouseLeave += new System.EventHandler(this.PaletteView_MouseLeave); + this.PaletteView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PaletteView_MouseMove); + this.PaletteView.MouseEnter += new System.EventHandler(this.PaletteView_MouseEnter); + // + // label1 + // + this.PatternView.Location = new System.Drawing.Point(17, 26); + this.PatternView.Size = new System.Drawing.Size(35, 13); + this.PatternView.TabIndex = 0; + // // NESPPU // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -120,6 +129,8 @@ this.Name = "NESPPU"; this.Text = "PPU Viewer"; this.Load += new System.EventHandler(this.NESPPU_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); this.PalettesGroup.ResumeLayout(false); this.DetailsBox.ResumeLayout(false); this.DetailsBox.PerformLayout(); @@ -136,5 +147,6 @@ private System.Windows.Forms.Label ValueLabel; private System.Windows.Forms.Label AddressLabel; private System.Windows.Forms.Label SectionLabel; + private BizHawk.MultiClient.PatternViewer PatternView; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/NEStools/PaletteViewer.cs b/BizHawk.MultiClient/NEStools/PaletteViewer.cs index 8be21baa33..e00755e78b 100644 --- a/BizHawk.MultiClient/NEStools/PaletteViewer.cs +++ b/BizHawk.MultiClient/NEStools/PaletteViewer.cs @@ -53,8 +53,6 @@ namespace BizHawk.MultiClient this.Size = new Size(128, 32); this.BackColor = Color.White; this.Paint += new System.Windows.Forms.PaintEventHandler(this.PaletteViewer_Paint); - this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PaletteViewer_MouseMove); - this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PaletteViewer_MouseClick); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PaletteViewer_KeyDown); for (int x = 0; x < 16; x++) @@ -89,58 +87,5 @@ namespace BizHawk.MultiClient { Display(e.Graphics); } - - private void PaletteViewer_MouseMove(object sender, MouseEventArgs e) - { - - } - - private void PaletteViewer_MouseClick(object sender, MouseEventArgs e) - { - - } - /* - //adelikat: Using my own approximation of the NES color palette until we have a decent palette system - private Color GetColorByValue(int value) - { - switch (value) - { - case 0x00: - return Color.White; - case 0x01: - return Color.LightBlue; - case 0x02: - return Color.Blue; - case 0x03: - return Color.DarkBlue; - case 0x04: - return Color.Magenta; - case 0x05: - return Color.OrangeRed; - case 0x06: - return Color.Red; - case 0x07: - return Color.DarkRed; - case 0x08: - return Color.Brown; - case 0x09: - return Color.DarkGreen; - case 0x0A: - return Color.Green; - case 0x0B: - return Color.LightGreen; - case 0x0C: - return Color.Aqua; - case 0x0D: - return Color.DarkGray; - case 0x0E: - return Color.Gray; - case 0x0F: - return Color.LightGray; - default: - return Color.Black; - } - } - */ } } diff --git a/BizHawk.MultiClient/NEStools/PatternViewer.cs b/BizHawk.MultiClient/NEStools/PatternViewer.cs new file mode 100644 index 0000000000..299cf8dcde --- /dev/null +++ b/BizHawk.MultiClient/NEStools/PatternViewer.cs @@ -0,0 +1,39 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Globalization; + +namespace BizHawk.MultiClient +{ + public class PatternViewer : Control + { + public PatternViewer() + { + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + this.Size = new Size(128, 32); + this.BackColor = Color.White; + this.Paint += new System.Windows.Forms.PaintEventHandler(this.PatternViewer_Paint); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PatternViewer_KeyDown); + } + + private void PatternViewer_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { } + + private void Display(Graphics g) + { + unchecked + { + + } + } + + private void PatternViewer_Paint(object sender, PaintEventArgs e) + { + Display(e.Graphics); + } + } +}