[NES] specify scanlines in PPU/NT viewers

This commit is contained in:
zeromus 2011-06-10 07:43:48 +00:00
parent 40b7827798
commit 51367f58c7
6 changed files with 626 additions and 510 deletions

View File

@ -13,9 +13,19 @@ namespace BizHawk.Emulation.Consoles.Nintendo
{
public partial class PPU
{
public MemoryDomain.FreezeData[] ppubus_freeze = new MemoryDomain.FreezeData[16384];
public class DebugCallback
{
public int Scanline;
//public int Dot; //not supported
public Action Callback;
}
//when the ppu issues a write it goes through here and into the game board
public DebugCallback NTViewCallback;
public DebugCallback PPUViewCallback;
public MemoryDomain.FreezeData[] ppubus_freeze = new MemoryDomain.FreezeData[16384];
//when the ppu issues a write it goes through here and into the game board
public void ppubus_write(int addr, byte value)
{
nes.board.AddressPPU(addr);

View File

@ -130,6 +130,9 @@ namespace BizHawk.Emulation.Consoles.Nintendo
int yp = sl - 1;
ppuphase = PPUPHASE.BG;
if (NTViewCallback != null && yp == NTViewCallback.Scanline) NTViewCallback.Callback();
if (PPUViewCallback != null && yp == PPUViewCallback.Scanline) PPUViewCallback.Callback();
//twiddle the oam buffers
int scanslot = oamslot ^ 1;
int renderslot = oamslot;

View File

@ -28,100 +28,123 @@
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.NameTableView = new BizHawk.MultiClient.NameTableViewer();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.NameTableView);
this.groupBox1.Location = new System.Drawing.Point(12, 36);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(545, 513);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// NameTableView
//
this.NameTableView.BackColor = System.Drawing.Color.White;
this.NameTableView.Location = new System.Drawing.Point(17, 19);
this.NameTableView.Name = "NameTableView";
this.NameTableView.Size = new System.Drawing.Size(512, 480);
this.NameTableView.TabIndex = 0;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.txtScanline = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.NameTableView = new BizHawk.MultiClient.NameTableViewer();
this.groupBox1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.NameTableView);
this.groupBox1.Location = new System.Drawing.Point(12, 36);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(545, 513);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.optionsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(572, 24);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
//
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(668, 24);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
//
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.autoloadToolStripMenuItem,
this.saveWindowPositionToolStripMenuItem,
this.toolStripSeparator1,
this.exitToolStripMenuItem});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
this.optionsToolStripMenuItem.Text = "&Options";
this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened);
//
// autoloadToolStripMenuItem
//
this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem";
this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.autoloadToolStripMenuItem.Text = "Auto-load";
this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click);
//
// saveWindowPositionToolStripMenuItem
//
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position";
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(187, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
this.exitToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// NESNameTableViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(572, 561);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "NESNameTableViewer";
this.Text = "NESNameTableViewer";
this.Load += new System.EventHandler(this.NESNameTableViewer_Load);
this.groupBox1.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
this.optionsToolStripMenuItem.Text = "&Options";
this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened);
//
// autoloadToolStripMenuItem
//
this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem";
this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.autoloadToolStripMenuItem.Text = "Auto-load";
this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click);
//
// saveWindowPositionToolStripMenuItem
//
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position";
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(187, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
this.exitToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// txtScanline
//
this.txtScanline.Location = new System.Drawing.Point(563, 64);
this.txtScanline.Name = "txtScanline";
this.txtScanline.Size = new System.Drawing.Size(60, 20);
this.txtScanline.TabIndex = 2;
this.txtScanline.Text = "0";
this.txtScanline.TextChanged += new System.EventHandler(this.txtScanline_TextChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(564, 45);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Scanline";
//
// NameTableView
//
this.NameTableView.BackColor = System.Drawing.Color.White;
this.NameTableView.Location = new System.Drawing.Point(17, 19);
this.NameTableView.Name = "NameTableView";
this.NameTableView.Size = new System.Drawing.Size(512, 480);
this.NameTableView.TabIndex = 0;
//
// NESNameTableViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(668, 561);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtScanline);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "NESNameTableViewer";
this.Text = "NES Nametable Viewer";
this.Load += new System.EventHandler(this.NESNameTableViewer_Load);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NESNameTableViewer_FormClosed);
this.groupBox1.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -135,5 +158,7 @@
private System.Windows.Forms.ToolStripMenuItem saveWindowPositionToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.TextBox txtScanline;
private System.Windows.Forms.Label label1;
}
}

View File

@ -17,10 +17,14 @@ namespace BizHawk.MultiClient
int defaultHeight;
NES Nes;
NES.PPU.DebugCallback Callback = new NES.PPU.DebugCallback();
public NESNameTableViewer()
{
InitializeComponent();
Closing += (o, e) => SaveConfigSettings();
Callback.Callback = () => Generate();
}
private void SaveConfigSettings()
@ -29,20 +33,22 @@ namespace BizHawk.MultiClient
Global.Config.NESNameTableWndy = this.Location.Y;
}
public unsafe void UpdateValues()
{
if (!(Global.Emulator is NES)) return;
if (!this.IsHandleCreated || this.IsDisposed) return;
NES.PPU ppu = (Global.Emulator as NES).ppu;
unsafe void Generate()
{
if (!this.IsHandleCreated || this.IsDisposed) return;
if (Nes == null) return;
NES.PPU ppu = Nes.ppu;
if (!this.IsHandleCreated || this.IsDisposed) return;
BitmapData bmpdata = NameTableView.nametables.LockBits(new Rectangle(0, 0, 512, 480), ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
int* dptr = (int*)bmpdata.Scan0.ToPointer();
int pitch = bmpdata.Stride / 4;
int pt_add = ppu.reg_2000.bg_pattern_hi ? 0x1000 : 0;
//TODO - buffer all the data from the ppu, because it will be read multiple times and that is slow
int ytable = 0, yline=0;
int ytable = 0, yline = 0;
for (int y = 0; y < 480; y++)
{
if (y == 240)
@ -56,15 +62,15 @@ namespace BizHawk.MultiClient
int ntaddr = (table << 10);
int px = x & 255;
int py = y - yline;
int tx = px>>3;
int ty = py>>3;
int tx = px >> 3;
int ty = py >> 3;
int ntbyte_ptr = ntaddr + (ty * 32) + tx;
int atbyte_ptr = ntaddr + 0x3C0 + ((ty >> 2) << 3) + (tx >> 2);
int nt = ppu.ppubus_peek(ntbyte_ptr + 0x2000);
int at = ppu.ppubus_peek(atbyte_ptr + 0x2000);
if((ty&2)!=0) at >>= 4;
if((tx&2)!=0) at >>= 2;
if ((ty & 2) != 0) at >>= 4;
if ((tx & 2) != 0) at >>= 2;
at &= 0x03;
at <<= 2;
@ -74,10 +80,10 @@ namespace BizHawk.MultiClient
int pt_0 = ppu.ppubus_peek(pt_addr);
int pt_1 = ppu.ppubus_peek(pt_addr + 8);
int pixel = ((pt_0 >> (7 - bgpx)) & 1) | (((pt_1 >> (7 - bgpx)) & 1) << 1);
//if the pixel is transparent, draw the backdrop color
//TODO - consider making this optional? nintendulator does it and fceux doesnt need to do it due to buggy palette logic which creates the same effect
if(pixel!=0)
if (pixel != 0)
pixel |= at;
pixel = ppu.PALRAM[pixel];
@ -89,13 +95,19 @@ namespace BizHawk.MultiClient
NameTableView.nametables.UnlockBits(bmpdata);
NameTableView.Refresh();
NameTableView.Refresh();
}
public void UpdateValues()
{
if (!(Global.Emulator is NES)) return;
NES.PPU ppu = (Global.Emulator as NES).ppu;
ppu.NTViewCallback = Callback;
}
public void Restart()
{
if (!(Global.Emulator is NES)) this.Close();
if (!this.IsHandleCreated || this.IsDisposed) return;
Nes = Global.Emulator as NES;
}
@ -130,5 +142,21 @@ namespace BizHawk.MultiClient
autoloadToolStripMenuItem.Checked = Global.Config.AutoLoadNESNameTable;
saveWindowPositionToolStripMenuItem.Checked = Global.Config.NESNameTableSaveWindowPosition;
}
private void txtScanline_TextChanged(object sender, EventArgs e)
{
int temp=0;
if (int.TryParse(txtScanline.Text, out temp))
{
Callback.Scanline = temp;
}
}
private void NESNameTableViewer_FormClosed(object sender, FormClosedEventArgs e)
{
if (Nes == null) return;
if (Nes.ppu.NTViewCallback == Callback)
Nes.ppu.NTViewCallback = null;
}
}
}

View File

@ -28,193 +28,195 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NESPPU));
this.PatternGroup = new System.Windows.Forms.GroupBox();
this.Table1PaletteLabel = new System.Windows.Forms.Label();
this.Table0PaletteLabel = new System.Windows.Forms.Label();
this.PalettesGroup = new System.Windows.Forms.GroupBox();
this.DetailsBox = new System.Windows.Forms.GroupBox();
this.Value2Label = new System.Windows.Forms.Label();
this.ValueLabel = new System.Windows.Forms.Label();
this.AddressLabel = new System.Windows.Forms.Label();
this.SectionLabel = new System.Windows.Forms.Label();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton();
this.table0PToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P0 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P1 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P2 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P3 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P4 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P5 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P6 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P7 = new System.Windows.Forms.ToolStripMenuItem();
this.table1PaletteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P0 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P1 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P2 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P3 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P4 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P5 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P6 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P7 = new System.Windows.Forms.ToolStripMenuItem();
this.SpriteViewerBox = new System.Windows.Forms.GroupBox();
this.SpriteView = new BizHawk.MultiClient.SpriteViewer();
this.PaletteView = new BizHawk.MultiClient.PaletteViewer();
this.PatternView = new BizHawk.MultiClient.PatternViewer();
this.PatternGroup.SuspendLayout();
this.PalettesGroup.SuspendLayout();
this.DetailsBox.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SpriteViewerBox.SuspendLayout();
this.SuspendLayout();
//
// PatternGroup
//
this.PatternGroup.Controls.Add(this.Table1PaletteLabel);
this.PatternGroup.Controls.Add(this.Table0PaletteLabel);
this.PatternGroup.Controls.Add(this.PatternView);
this.PatternGroup.Location = new System.Drawing.Point(12, 37);
this.PatternGroup.Name = "PatternGroup";
this.PatternGroup.Size = new System.Drawing.Size(272, 169);
this.PatternGroup.TabIndex = 0;
this.PatternGroup.TabStop = false;
this.PatternGroup.Text = "Pattern Tables";
//
// Table1PaletteLabel
//
this.Table1PaletteLabel.AutoSize = true;
this.Table1PaletteLabel.Location = new System.Drawing.Point(129, 150);
this.Table1PaletteLabel.Name = "Table1PaletteLabel";
this.Table1PaletteLabel.Size = new System.Drawing.Size(52, 13);
this.Table1PaletteLabel.TabIndex = 2;
this.Table1PaletteLabel.Text = "Palette: 0";
//
// Table0PaletteLabel
//
this.Table0PaletteLabel.AutoSize = true;
this.Table0PaletteLabel.Location = new System.Drawing.Point(6, 150);
this.Table0PaletteLabel.Name = "Table0PaletteLabel";
this.Table0PaletteLabel.Size = new System.Drawing.Size(52, 13);
this.Table0PaletteLabel.TabIndex = 1;
this.Table0PaletteLabel.Text = "Palette: 0";
//
// PalettesGroup
//
this.PalettesGroup.Controls.Add(this.PaletteView);
this.PalettesGroup.Location = new System.Drawing.Point(12, 225);
this.PalettesGroup.Name = "PalettesGroup";
this.PalettesGroup.Size = new System.Drawing.Size(272, 65);
this.PalettesGroup.TabIndex = 1;
this.PalettesGroup.TabStop = false;
this.PalettesGroup.Text = "Palettes";
//
// DetailsBox
//
this.DetailsBox.Controls.Add(this.Value2Label);
this.DetailsBox.Controls.Add(this.ValueLabel);
this.DetailsBox.Controls.Add(this.AddressLabel);
this.DetailsBox.Controls.Add(this.SectionLabel);
this.DetailsBox.Location = new System.Drawing.Point(299, 200);
this.DetailsBox.Name = "DetailsBox";
this.DetailsBox.Size = new System.Drawing.Size(177, 90);
this.DetailsBox.TabIndex = 2;
this.DetailsBox.TabStop = false;
this.DetailsBox.Text = "Details";
//
// Value2Label
//
this.Value2Label.AutoSize = true;
this.Value2Label.Location = new System.Drawing.Point(6, 72);
this.Value2Label.Name = "Value2Label";
this.Value2Label.Size = new System.Drawing.Size(35, 13);
this.Value2Label.TabIndex = 3;
this.Value2Label.Text = "label1";
//
// ValueLabel
//
this.ValueLabel.AutoSize = true;
this.ValueLabel.Location = new System.Drawing.Point(6, 53);
this.ValueLabel.Name = "ValueLabel";
this.ValueLabel.Size = new System.Drawing.Size(35, 13);
this.ValueLabel.TabIndex = 2;
this.ValueLabel.Text = "label1";
//
// AddressLabel
//
this.AddressLabel.AutoSize = true;
this.AddressLabel.Location = new System.Drawing.Point(6, 35);
this.AddressLabel.Name = "AddressLabel";
this.AddressLabel.Size = new System.Drawing.Size(35, 13);
this.AddressLabel.TabIndex = 1;
this.AddressLabel.Text = "label1";
//
// SectionLabel
//
this.SectionLabel.AutoSize = true;
this.SectionLabel.Location = new System.Drawing.Point(6, 18);
this.SectionLabel.Name = "SectionLabel";
this.SectionLabel.Size = new System.Drawing.Size(35, 13);
this.SectionLabel.TabIndex = 0;
this.SectionLabel.Text = "label1";
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NESPPU));
this.PatternGroup = new System.Windows.Forms.GroupBox();
this.Table1PaletteLabel = new System.Windows.Forms.Label();
this.Table0PaletteLabel = new System.Windows.Forms.Label();
this.PalettesGroup = new System.Windows.Forms.GroupBox();
this.DetailsBox = new System.Windows.Forms.GroupBox();
this.Value2Label = new System.Windows.Forms.Label();
this.ValueLabel = new System.Windows.Forms.Label();
this.AddressLabel = new System.Windows.Forms.Label();
this.SectionLabel = new System.Windows.Forms.Label();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton();
this.table0PToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P0 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P1 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P2 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P3 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P4 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P5 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P6 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P7 = new System.Windows.Forms.ToolStripMenuItem();
this.table1PaletteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P0 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P1 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P2 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P3 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P4 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P5 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P6 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P7 = new System.Windows.Forms.ToolStripMenuItem();
this.SpriteViewerBox = new System.Windows.Forms.GroupBox();
this.SpriteView = new BizHawk.MultiClient.SpriteViewer();
this.PaletteView = new BizHawk.MultiClient.PaletteViewer();
this.PatternView = new BizHawk.MultiClient.PatternViewer();
this.label1 = new System.Windows.Forms.Label();
this.txtScanline = new System.Windows.Forms.TextBox();
this.PatternGroup.SuspendLayout();
this.PalettesGroup.SuspendLayout();
this.DetailsBox.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SpriteViewerBox.SuspendLayout();
this.SuspendLayout();
//
// PatternGroup
//
this.PatternGroup.Controls.Add(this.Table1PaletteLabel);
this.PatternGroup.Controls.Add(this.Table0PaletteLabel);
this.PatternGroup.Controls.Add(this.PatternView);
this.PatternGroup.Location = new System.Drawing.Point(12, 37);
this.PatternGroup.Name = "PatternGroup";
this.PatternGroup.Size = new System.Drawing.Size(272, 169);
this.PatternGroup.TabIndex = 0;
this.PatternGroup.TabStop = false;
this.PatternGroup.Text = "Pattern Tables";
//
// Table1PaletteLabel
//
this.Table1PaletteLabel.AutoSize = true;
this.Table1PaletteLabel.Location = new System.Drawing.Point(129, 150);
this.Table1PaletteLabel.Name = "Table1PaletteLabel";
this.Table1PaletteLabel.Size = new System.Drawing.Size(52, 13);
this.Table1PaletteLabel.TabIndex = 2;
this.Table1PaletteLabel.Text = "Palette: 0";
//
// Table0PaletteLabel
//
this.Table0PaletteLabel.AutoSize = true;
this.Table0PaletteLabel.Location = new System.Drawing.Point(6, 150);
this.Table0PaletteLabel.Name = "Table0PaletteLabel";
this.Table0PaletteLabel.Size = new System.Drawing.Size(52, 13);
this.Table0PaletteLabel.TabIndex = 1;
this.Table0PaletteLabel.Text = "Palette: 0";
//
// PalettesGroup
//
this.PalettesGroup.Controls.Add(this.PaletteView);
this.PalettesGroup.Location = new System.Drawing.Point(12, 225);
this.PalettesGroup.Name = "PalettesGroup";
this.PalettesGroup.Size = new System.Drawing.Size(272, 65);
this.PalettesGroup.TabIndex = 1;
this.PalettesGroup.TabStop = false;
this.PalettesGroup.Text = "Palettes";
//
// DetailsBox
//
this.DetailsBox.Controls.Add(this.Value2Label);
this.DetailsBox.Controls.Add(this.ValueLabel);
this.DetailsBox.Controls.Add(this.AddressLabel);
this.DetailsBox.Controls.Add(this.SectionLabel);
this.DetailsBox.Location = new System.Drawing.Point(299, 200);
this.DetailsBox.Name = "DetailsBox";
this.DetailsBox.Size = new System.Drawing.Size(177, 90);
this.DetailsBox.TabIndex = 2;
this.DetailsBox.TabStop = false;
this.DetailsBox.Text = "Details";
//
// Value2Label
//
this.Value2Label.AutoSize = true;
this.Value2Label.Location = new System.Drawing.Point(6, 72);
this.Value2Label.Name = "Value2Label";
this.Value2Label.Size = new System.Drawing.Size(35, 13);
this.Value2Label.TabIndex = 3;
this.Value2Label.Text = "label1";
//
// ValueLabel
//
this.ValueLabel.AutoSize = true;
this.ValueLabel.Location = new System.Drawing.Point(6, 53);
this.ValueLabel.Name = "ValueLabel";
this.ValueLabel.Size = new System.Drawing.Size(35, 13);
this.ValueLabel.TabIndex = 2;
this.ValueLabel.Text = "label1";
//
// AddressLabel
//
this.AddressLabel.AutoSize = true;
this.AddressLabel.Location = new System.Drawing.Point(6, 35);
this.AddressLabel.Name = "AddressLabel";
this.AddressLabel.Size = new System.Drawing.Size(35, 13);
this.AddressLabel.TabIndex = 1;
this.AddressLabel.Text = "label1";
//
// SectionLabel
//
this.SectionLabel.AutoSize = true;
this.SectionLabel.Location = new System.Drawing.Point(6, 18);
this.SectionLabel.Name = "SectionLabel";
this.SectionLabel.Size = new System.Drawing.Size(35, 13);
this.SectionLabel.TabIndex = 0;
this.SectionLabel.Text = "label1";
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton1,
this.toolStripDropDownButton2});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(587, 25);
this.toolStrip1.TabIndex = 3;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(587, 25);
this.toolStrip1.TabIndex = 3;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.autoloadToolStripMenuItem,
this.saveWindowPositionToolStripMenuItem});
this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(59, 22);
this.toolStripDropDownButton1.Text = "Settings";
this.toolStripDropDownButton1.DropDownOpened += new System.EventHandler(this.toolStripDropDownButton1_DropDownOpened);
//
// autoloadToolStripMenuItem
//
this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem";
this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
this.autoloadToolStripMenuItem.Text = "Auto-load";
this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click);
//
// saveWindowPositionToolStripMenuItem
//
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
this.saveWindowPositionToolStripMenuItem.Text = "Save window position";
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
//
// toolStripDropDownButton2
//
this.toolStripDropDownButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(59, 22);
this.toolStripDropDownButton1.Text = "Settings";
this.toolStripDropDownButton1.DropDownOpened += new System.EventHandler(this.toolStripDropDownButton1_DropDownOpened);
//
// autoloadToolStripMenuItem
//
this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem";
this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
this.autoloadToolStripMenuItem.Text = "Auto-load";
this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click);
//
// saveWindowPositionToolStripMenuItem
//
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
this.saveWindowPositionToolStripMenuItem.Text = "Save window position";
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
//
// toolStripDropDownButton2
//
this.toolStripDropDownButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.table0PToolStripMenuItem,
this.table1PaletteToolStripMenuItem});
this.toolStripDropDownButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton2.Image")));
this.toolStripDropDownButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton2.Name = "toolStripDropDownButton2";
this.toolStripDropDownButton2.Size = new System.Drawing.Size(56, 22);
this.toolStripDropDownButton2.Text = "Pattern";
this.toolStripDropDownButton2.DropDownOpened += new System.EventHandler(this.toolStripDropDownButton2_DropDownOpened);
//
// table0PToolStripMenuItem
//
this.table0PToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton2.Image")));
this.toolStripDropDownButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton2.Name = "toolStripDropDownButton2";
this.toolStripDropDownButton2.Size = new System.Drawing.Size(56, 22);
this.toolStripDropDownButton2.Text = "Pattern";
this.toolStripDropDownButton2.DropDownOpened += new System.EventHandler(this.toolStripDropDownButton2_DropDownOpened);
//
// table0PToolStripMenuItem
//
this.table0PToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Table0P0,
this.Table0P1,
this.Table0P2,
@ -223,69 +225,69 @@
this.Table0P5,
this.Table0P6,
this.Table0P7});
this.table0PToolStripMenuItem.Name = "table0PToolStripMenuItem";
this.table0PToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.table0PToolStripMenuItem.Text = "Table 0 Palette";
//
// Table0P0
//
this.Table0P0.Name = "Table0P0";
this.Table0P0.Size = new System.Drawing.Size(91, 22);
this.Table0P0.Text = "0";
this.Table0P0.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P1
//
this.Table0P1.Name = "Table0P1";
this.Table0P1.Size = new System.Drawing.Size(91, 22);
this.Table0P1.Text = "1";
this.Table0P1.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P2
//
this.Table0P2.Name = "Table0P2";
this.Table0P2.Size = new System.Drawing.Size(91, 22);
this.Table0P2.Text = "2";
this.Table0P2.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P3
//
this.Table0P3.Name = "Table0P3";
this.Table0P3.Size = new System.Drawing.Size(91, 22);
this.Table0P3.Text = "3";
this.Table0P3.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P4
//
this.Table0P4.Name = "Table0P4";
this.Table0P4.Size = new System.Drawing.Size(91, 22);
this.Table0P4.Text = "4";
this.Table0P4.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P5
//
this.Table0P5.Name = "Table0P5";
this.Table0P5.Size = new System.Drawing.Size(91, 22);
this.Table0P5.Text = "5";
this.Table0P5.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P6
//
this.Table0P6.Name = "Table0P6";
this.Table0P6.Size = new System.Drawing.Size(91, 22);
this.Table0P6.Text = "6";
this.Table0P6.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P7
//
this.Table0P7.Name = "Table0P7";
this.Table0P7.Size = new System.Drawing.Size(91, 22);
this.Table0P7.Text = "7";
this.Table0P7.Click += new System.EventHandler(this.Palette_Click);
//
// table1PaletteToolStripMenuItem
//
this.table1PaletteToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.table0PToolStripMenuItem.Name = "table0PToolStripMenuItem";
this.table0PToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.table0PToolStripMenuItem.Text = "Table 0 Palette";
//
// Table0P0
//
this.Table0P0.Name = "Table0P0";
this.Table0P0.Size = new System.Drawing.Size(91, 22);
this.Table0P0.Text = "0";
this.Table0P0.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P1
//
this.Table0P1.Name = "Table0P1";
this.Table0P1.Size = new System.Drawing.Size(91, 22);
this.Table0P1.Text = "1";
this.Table0P1.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P2
//
this.Table0P2.Name = "Table0P2";
this.Table0P2.Size = new System.Drawing.Size(91, 22);
this.Table0P2.Text = "2";
this.Table0P2.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P3
//
this.Table0P3.Name = "Table0P3";
this.Table0P3.Size = new System.Drawing.Size(91, 22);
this.Table0P3.Text = "3";
this.Table0P3.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P4
//
this.Table0P4.Name = "Table0P4";
this.Table0P4.Size = new System.Drawing.Size(91, 22);
this.Table0P4.Text = "4";
this.Table0P4.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P5
//
this.Table0P5.Name = "Table0P5";
this.Table0P5.Size = new System.Drawing.Size(91, 22);
this.Table0P5.Text = "5";
this.Table0P5.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P6
//
this.Table0P6.Name = "Table0P6";
this.Table0P6.Size = new System.Drawing.Size(91, 22);
this.Table0P6.Text = "6";
this.Table0P6.Click += new System.EventHandler(this.Palette_Click);
//
// Table0P7
//
this.Table0P7.Name = "Table0P7";
this.Table0P7.Size = new System.Drawing.Size(91, 22);
this.Table0P7.Text = "7";
this.Table0P7.Click += new System.EventHandler(this.Palette_Click);
//
// table1PaletteToolStripMenuItem
//
this.table1PaletteToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Table1P0,
this.Table1P1,
this.Table1P2,
@ -294,131 +296,152 @@
this.Table1P5,
this.Table1P6,
this.Table1P7});
this.table1PaletteToolStripMenuItem.Name = "table1PaletteToolStripMenuItem";
this.table1PaletteToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.table1PaletteToolStripMenuItem.Text = "Table 1 Palette";
//
// Table1P0
//
this.Table1P0.Name = "Table1P0";
this.Table1P0.Size = new System.Drawing.Size(91, 22);
this.Table1P0.Text = "0";
this.Table1P0.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P1
//
this.Table1P1.Name = "Table1P1";
this.Table1P1.Size = new System.Drawing.Size(91, 22);
this.Table1P1.Text = "1";
this.Table1P1.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P2
//
this.Table1P2.Name = "Table1P2";
this.Table1P2.Size = new System.Drawing.Size(91, 22);
this.Table1P2.Text = "2";
this.Table1P2.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P3
//
this.Table1P3.Name = "Table1P3";
this.Table1P3.Size = new System.Drawing.Size(91, 22);
this.Table1P3.Text = "3";
this.Table1P3.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P4
//
this.Table1P4.Name = "Table1P4";
this.Table1P4.Size = new System.Drawing.Size(91, 22);
this.Table1P4.Text = "4";
this.Table1P4.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P5
//
this.Table1P5.Name = "Table1P5";
this.Table1P5.Size = new System.Drawing.Size(91, 22);
this.Table1P5.Text = "5";
this.Table1P5.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P6
//
this.Table1P6.Name = "Table1P6";
this.Table1P6.Size = new System.Drawing.Size(91, 22);
this.Table1P6.Text = "6";
this.Table1P6.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P7
//
this.Table1P7.Name = "Table1P7";
this.Table1P7.Size = new System.Drawing.Size(91, 22);
this.Table1P7.Text = "7";
this.Table1P7.Click += new System.EventHandler(this.Palette_Click);
//
// SpriteViewerBox
//
this.SpriteViewerBox.Controls.Add(this.SpriteView);
this.SpriteViewerBox.Location = new System.Drawing.Point(299, 37);
this.SpriteViewerBox.Name = "SpriteViewerBox";
this.SpriteViewerBox.Size = new System.Drawing.Size(272, 155);
this.SpriteViewerBox.TabIndex = 5;
this.SpriteViewerBox.TabStop = false;
this.SpriteViewerBox.Text = "Sprites";
//
// SpriteView
//
this.SpriteView.BackColor = System.Drawing.Color.White;
this.SpriteView.Location = new System.Drawing.Point(6, 18);
this.SpriteView.Name = "SpriteView";
this.SpriteView.Size = new System.Drawing.Size(256, 128);
this.SpriteView.TabIndex = 0;
//
// 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);
//
// PatternView
//
this.PatternView.BackColor = System.Drawing.Color.White;
this.PatternView.Location = new System.Drawing.Point(7, 20);
this.PatternView.Name = "PatternView";
this.PatternView.Size = new System.Drawing.Size(256, 128);
this.PatternView.TabIndex = 0;
this.PatternView.MouseLeave += new System.EventHandler(this.PatternView_MouseLeave);
this.PatternView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PatternView_MouseMove);
this.PatternView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PatternView_Click);
this.PatternView.MouseEnter += new System.EventHandler(this.PatternView_MouseEnter);
//
// NESPPU
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(587, 317);
this.Controls.Add(this.SpriteViewerBox);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.DetailsBox);
this.Controls.Add(this.PalettesGroup);
this.Controls.Add(this.PatternGroup);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "NESPPU";
this.Text = "PPU Viewer";
this.Load += new System.EventHandler(this.NESPPU_Load);
this.PatternGroup.ResumeLayout(false);
this.PatternGroup.PerformLayout();
this.PalettesGroup.ResumeLayout(false);
this.DetailsBox.ResumeLayout(false);
this.DetailsBox.PerformLayout();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.SpriteViewerBox.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
this.table1PaletteToolStripMenuItem.Name = "table1PaletteToolStripMenuItem";
this.table1PaletteToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.table1PaletteToolStripMenuItem.Text = "Table 1 Palette";
//
// Table1P0
//
this.Table1P0.Name = "Table1P0";
this.Table1P0.Size = new System.Drawing.Size(91, 22);
this.Table1P0.Text = "0";
this.Table1P0.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P1
//
this.Table1P1.Name = "Table1P1";
this.Table1P1.Size = new System.Drawing.Size(91, 22);
this.Table1P1.Text = "1";
this.Table1P1.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P2
//
this.Table1P2.Name = "Table1P2";
this.Table1P2.Size = new System.Drawing.Size(91, 22);
this.Table1P2.Text = "2";
this.Table1P2.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P3
//
this.Table1P3.Name = "Table1P3";
this.Table1P3.Size = new System.Drawing.Size(91, 22);
this.Table1P3.Text = "3";
this.Table1P3.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P4
//
this.Table1P4.Name = "Table1P4";
this.Table1P4.Size = new System.Drawing.Size(91, 22);
this.Table1P4.Text = "4";
this.Table1P4.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P5
//
this.Table1P5.Name = "Table1P5";
this.Table1P5.Size = new System.Drawing.Size(91, 22);
this.Table1P5.Text = "5";
this.Table1P5.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P6
//
this.Table1P6.Name = "Table1P6";
this.Table1P6.Size = new System.Drawing.Size(91, 22);
this.Table1P6.Text = "6";
this.Table1P6.Click += new System.EventHandler(this.Palette_Click);
//
// Table1P7
//
this.Table1P7.Name = "Table1P7";
this.Table1P7.Size = new System.Drawing.Size(91, 22);
this.Table1P7.Text = "7";
this.Table1P7.Click += new System.EventHandler(this.Palette_Click);
//
// SpriteViewerBox
//
this.SpriteViewerBox.Controls.Add(this.SpriteView);
this.SpriteViewerBox.Location = new System.Drawing.Point(299, 37);
this.SpriteViewerBox.Name = "SpriteViewerBox";
this.SpriteViewerBox.Size = new System.Drawing.Size(272, 155);
this.SpriteViewerBox.TabIndex = 5;
this.SpriteViewerBox.TabStop = false;
this.SpriteViewerBox.Text = "Sprites";
//
// SpriteView
//
this.SpriteView.BackColor = System.Drawing.Color.White;
this.SpriteView.Location = new System.Drawing.Point(6, 18);
this.SpriteView.Name = "SpriteView";
this.SpriteView.Size = new System.Drawing.Size(256, 128);
this.SpriteView.TabIndex = 0;
//
// 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);
//
// PatternView
//
this.PatternView.BackColor = System.Drawing.Color.White;
this.PatternView.Location = new System.Drawing.Point(7, 20);
this.PatternView.Name = "PatternView";
this.PatternView.Size = new System.Drawing.Size(256, 128);
this.PatternView.TabIndex = 0;
this.PatternView.MouseLeave += new System.EventHandler(this.PatternView_MouseLeave);
this.PatternView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PatternView_MouseMove);
this.PatternView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PatternView_Click);
this.PatternView.MouseEnter += new System.EventHandler(this.PatternView_MouseEnter);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(502, 204);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 13);
this.label1.TabIndex = 7;
this.label1.Text = "Scanline";
//
// txtScanline
//
this.txtScanline.Location = new System.Drawing.Point(501, 223);
this.txtScanline.Name = "txtScanline";
this.txtScanline.Size = new System.Drawing.Size(60, 20);
this.txtScanline.TabIndex = 6;
this.txtScanline.Text = "0";
this.txtScanline.TextChanged += new System.EventHandler(this.txtScanline_TextChanged);
//
// NESPPU
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(587, 317);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtScanline);
this.Controls.Add(this.SpriteViewerBox);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.DetailsBox);
this.Controls.Add(this.PalettesGroup);
this.Controls.Add(this.PatternGroup);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "NESPPU";
this.Text = "NES PPU Viewer";
this.Load += new System.EventHandler(this.NESPPU_Load);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NESPPU_FormClosed);
this.PatternGroup.ResumeLayout(false);
this.PatternGroup.PerformLayout();
this.PalettesGroup.ResumeLayout(false);
this.DetailsBox.ResumeLayout(false);
this.DetailsBox.PerformLayout();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.SpriteViewerBox.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
@ -460,5 +483,7 @@
private System.Windows.Forms.ToolStripMenuItem Table1P7;
private System.Windows.Forms.GroupBox SpriteViewerBox;
private SpriteViewer SpriteView;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtScanline;
}
}

View File

@ -26,10 +26,13 @@ namespace BizHawk.MultiClient
int defaultHeight;
NES Nes;
NES.PPU.DebugCallback Callback = new NES.PPU.DebugCallback();
public NESPPU()
{
InitializeComponent();
Closing += (o, e) => SaveConfigSettings();
Callback.Callback = () => Generate();
}
private void SaveConfigSettings()
@ -60,9 +63,8 @@ namespace BizHawk.MultiClient
return (byte)(((value >> (7 - bit)) & 1));
}
public unsafe void UpdateValues()
unsafe void Generate()
{
if (!(Global.Emulator is NES)) return;
if (!this.IsHandleCreated || this.IsDisposed) return;
//Pattern Viewer
@ -72,51 +74,58 @@ namespace BizHawk.MultiClient
PaletteView.spritePalettes[x].SetValue(Nes.LookupColor(Nes.ppu.PALRAM[PaletteView.spritePalettes[x].address]));
}
PaletteView.Refresh();
//Pattern Viewer
int b0 = 0;
int b1 = 0;
byte value;
int cvalue;
int pal;
int b0 = 0;
int b1 = 0;
byte value;
int cvalue;
int pal;
System.Drawing.Imaging.BitmapData bmpdata = PatternView.pattern.LockBits(new Rectangle(new Point(0, 0), PatternView.pattern.Size), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
int* framebuf = (int*)bmpdata.Scan0.ToPointer();
for (int z = 0; z < 2; z++)
{
if (z == 0)
pal = PatternView.Pal0;
else
pal = PatternView.Pal1;
for (int z = 0; z < 2; z++)
{
if (z == 0)
pal = PatternView.Pal0;
else
pal = PatternView.Pal1;
for (int i = 0; i < 16; i++)
{
for (int j = 0; j < 16; j++)
{
for (int x = 0; x < 8; x++)
{
for (int y = 0; y < 8; y++)
{
b0 = GetBit((z*0x1000) + (i * 256) + (j * 16) + y + 0 * 8, x);
b1 = GetBit((z*0x1000) + (i * 256) + (j * 16) + y + 1 * 8, x);
for (int i = 0; i < 16; i++)
{
for (int j = 0; j < 16; j++)
{
for (int x = 0; x < 8; x++)
{
for (int y = 0; y < 8; y++)
{
b0 = GetBit((z * 0x1000) + (i * 256) + (j * 16) + y + 0 * 8, x);
b1 = GetBit((z * 0x1000) + (i * 256) + (j * 16) + y + 1 * 8, x);
value = (byte)(b0 + (b1 << 1));
value = (byte)(b0 + (b1 << 1));
cvalue = Nes.LookupColor(Nes.ppu.PALRAM[value + (pal * 4)]);
Color color = Color.FromArgb(cvalue);
cvalue = Nes.LookupColor(Nes.ppu.PALRAM[value + (pal * 4)]);
int adr = (x + (j * 8)) + (y + (i * 8)) * (bmpdata.Stride / 4);
framebuf[adr + (z*128)] = color.ToArgb();
}
}
}
}
}
Color color = Color.FromArgb(cvalue);
int adr = (x + (j * 8)) + (y + (i * 8)) * (bmpdata.Stride / 4);
framebuf[adr + (z * 128)] = color.ToArgb();
}
}
}
}
}
PatternView.pattern.UnlockBits(bmpdata);
PatternView.Refresh();
}
public unsafe void UpdateValues()
{
if (!(Global.Emulator is NES)) return;
NES.PPU ppu = (Global.Emulator as NES).ppu;
ppu.PPUViewCallback = Callback;
}
private void NESPPU_Load(object sender, EventArgs e)
{
LoadConfigSettings();
@ -338,5 +347,21 @@ namespace BizHawk.MultiClient
UpdateTableLabels();
}
private void txtScanline_TextChanged(object sender, EventArgs e)
{
int temp = 0;
if (int.TryParse(txtScanline.Text, out temp))
{
Callback.Scanline = temp;
}
}
private void NESPPU_FormClosed(object sender, FormClosedEventArgs e)
{
if (Nes == null) return;
if (Nes.ppu.PPUViewCallback == Callback)
Nes.ppu.PPUViewCallback = null;
}
}
}