[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 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) public void ppubus_write(int addr, byte value)
{ {
nes.board.AddressPPU(addr); nes.board.AddressPPU(addr);

View File

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

View File

@ -28,100 +28,123 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.NameTableView = new BizHawk.MultiClient.NameTableViewer(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.txtScanline = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout(); this.label1 = new System.Windows.Forms.Label();
this.menuStrip1.SuspendLayout(); this.NameTableView = new BizHawk.MultiClient.NameTableViewer();
this.SuspendLayout(); this.groupBox1.SuspendLayout();
// this.menuStrip1.SuspendLayout();
// groupBox1 this.SuspendLayout();
// //
this.groupBox1.Controls.Add(this.NameTableView); // groupBox1
this.groupBox1.Location = new System.Drawing.Point(12, 36); //
this.groupBox1.Name = "groupBox1"; this.groupBox1.Controls.Add(this.NameTableView);
this.groupBox1.Size = new System.Drawing.Size(545, 513); this.groupBox1.Location = new System.Drawing.Point(12, 36);
this.groupBox1.TabIndex = 0; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.Size = new System.Drawing.Size(545, 513);
// this.groupBox1.TabIndex = 0;
// NameTableView this.groupBox1.TabStop = false;
// //
this.NameTableView.BackColor = System.Drawing.Color.White; // menuStrip1
this.NameTableView.Location = new System.Drawing.Point(17, 19); //
this.NameTableView.Name = "NameTableView"; this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.NameTableView.Size = new System.Drawing.Size(512, 480);
this.NameTableView.TabIndex = 0;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.optionsToolStripMenuItem}); this.optionsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(572, 24); this.menuStrip1.Size = new System.Drawing.Size(668, 24);
this.menuStrip1.TabIndex = 1; this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1"; this.menuStrip1.Text = "menuStrip1";
// //
// optionsToolStripMenuItem // optionsToolStripMenuItem
// //
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.autoloadToolStripMenuItem, this.autoloadToolStripMenuItem,
this.saveWindowPositionToolStripMenuItem, this.saveWindowPositionToolStripMenuItem,
this.toolStripSeparator1, this.toolStripSeparator1,
this.exitToolStripMenuItem}); this.exitToolStripMenuItem});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20); this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
this.optionsToolStripMenuItem.Text = "&Options"; this.optionsToolStripMenuItem.Text = "&Options";
this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened); this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened);
// //
// autoloadToolStripMenuItem // autoloadToolStripMenuItem
// //
this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem"; this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem";
this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(190, 22); this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.autoloadToolStripMenuItem.Text = "Auto-load"; this.autoloadToolStripMenuItem.Text = "Auto-load";
this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click); this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click);
// //
// saveWindowPositionToolStripMenuItem // saveWindowPositionToolStripMenuItem
// //
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem"; this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(190, 22); this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position"; this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position";
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click); this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
// //
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(187, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(187, 6);
// //
// exitToolStripMenuItem // exitToolStripMenuItem
// //
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); 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.Size = new System.Drawing.Size(190, 22);
this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
// //
// NESNameTableViewer // txtScanline
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.txtScanline.Location = new System.Drawing.Point(563, 64);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.txtScanline.Name = "txtScanline";
this.ClientSize = new System.Drawing.Size(572, 561); this.txtScanline.Size = new System.Drawing.Size(60, 20);
this.Controls.Add(this.groupBox1); this.txtScanline.TabIndex = 2;
this.Controls.Add(this.menuStrip1); this.txtScanline.Text = "0";
this.MainMenuStrip = this.menuStrip1; this.txtScanline.TextChanged += new System.EventHandler(this.txtScanline_TextChanged);
this.Name = "NESNameTableViewer"; //
this.Text = "NESNameTableViewer"; // label1
this.Load += new System.EventHandler(this.NESNameTableViewer_Load); //
this.groupBox1.ResumeLayout(false); this.label1.AutoSize = true;
this.menuStrip1.ResumeLayout(false); this.label1.Location = new System.Drawing.Point(564, 45);
this.menuStrip1.PerformLayout(); this.label1.Name = "label1";
this.ResumeLayout(false); this.label1.Size = new System.Drawing.Size(48, 13);
this.PerformLayout(); 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.ToolStripMenuItem saveWindowPositionToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; 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; int defaultHeight;
NES Nes; NES Nes;
NES.PPU.DebugCallback Callback = new NES.PPU.DebugCallback();
public NESNameTableViewer() public NESNameTableViewer()
{ {
InitializeComponent(); InitializeComponent();
Closing += (o, e) => SaveConfigSettings(); Closing += (o, e) => SaveConfigSettings();
Callback.Callback = () => Generate();
} }
private void SaveConfigSettings() private void SaveConfigSettings()
@ -29,20 +33,22 @@ namespace BizHawk.MultiClient
Global.Config.NESNameTableWndy = this.Location.Y; Global.Config.NESNameTableWndy = this.Location.Y;
} }
public unsafe void UpdateValues() unsafe void Generate()
{ {
if (!(Global.Emulator is NES)) return; if (!this.IsHandleCreated || this.IsDisposed) return;
if (!this.IsHandleCreated || this.IsDisposed) return; if (Nes == null) return;
NES.PPU ppu = (Global.Emulator as NES).ppu;
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); 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* dptr = (int*)bmpdata.Scan0.ToPointer();
int pitch = bmpdata.Stride / 4; int pitch = bmpdata.Stride / 4;
int pt_add = ppu.reg_2000.bg_pattern_hi ? 0x1000 : 0; 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 //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++) for (int y = 0; y < 480; y++)
{ {
if (y == 240) if (y == 240)
@ -56,15 +62,15 @@ namespace BizHawk.MultiClient
int ntaddr = (table << 10); int ntaddr = (table << 10);
int px = x & 255; int px = x & 255;
int py = y - yline; int py = y - yline;
int tx = px>>3; int tx = px >> 3;
int ty = py>>3; int ty = py >> 3;
int ntbyte_ptr = ntaddr + (ty * 32) + tx; int ntbyte_ptr = ntaddr + (ty * 32) + tx;
int atbyte_ptr = ntaddr + 0x3C0 + ((ty >> 2) << 3) + (tx >> 2); int atbyte_ptr = ntaddr + 0x3C0 + ((ty >> 2) << 3) + (tx >> 2);
int nt = ppu.ppubus_peek(ntbyte_ptr + 0x2000); int nt = ppu.ppubus_peek(ntbyte_ptr + 0x2000);
int at = ppu.ppubus_peek(atbyte_ptr + 0x2000); int at = ppu.ppubus_peek(atbyte_ptr + 0x2000);
if((ty&2)!=0) at >>= 4; if ((ty & 2) != 0) at >>= 4;
if((tx&2)!=0) at >>= 2; if ((tx & 2) != 0) at >>= 2;
at &= 0x03; at &= 0x03;
at <<= 2; at <<= 2;
@ -74,10 +80,10 @@ namespace BizHawk.MultiClient
int pt_0 = ppu.ppubus_peek(pt_addr); int pt_0 = ppu.ppubus_peek(pt_addr);
int pt_1 = ppu.ppubus_peek(pt_addr + 8); int pt_1 = ppu.ppubus_peek(pt_addr + 8);
int pixel = ((pt_0 >> (7 - bgpx)) & 1) | (((pt_1 >> (7 - bgpx)) & 1) << 1); int pixel = ((pt_0 >> (7 - bgpx)) & 1) | (((pt_1 >> (7 - bgpx)) & 1) << 1);
//if the pixel is transparent, draw the backdrop color //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 //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 |= at;
pixel = ppu.PALRAM[pixel]; pixel = ppu.PALRAM[pixel];
@ -89,13 +95,19 @@ namespace BizHawk.MultiClient
NameTableView.nametables.UnlockBits(bmpdata); 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() public void Restart()
{ {
if (!(Global.Emulator is NES)) this.Close(); if (!(Global.Emulator is NES)) this.Close();
if (!this.IsHandleCreated || this.IsDisposed) return;
Nes = Global.Emulator as NES; Nes = Global.Emulator as NES;
} }
@ -130,5 +142,21 @@ namespace BizHawk.MultiClient
autoloadToolStripMenuItem.Checked = Global.Config.AutoLoadNESNameTable; autoloadToolStripMenuItem.Checked = Global.Config.AutoLoadNESNameTable;
saveWindowPositionToolStripMenuItem.Checked = Global.Config.NESNameTableSaveWindowPosition; 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> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NESPPU)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NESPPU));
this.PatternGroup = new System.Windows.Forms.GroupBox(); this.PatternGroup = new System.Windows.Forms.GroupBox();
this.Table1PaletteLabel = new System.Windows.Forms.Label(); this.Table1PaletteLabel = new System.Windows.Forms.Label();
this.Table0PaletteLabel = new System.Windows.Forms.Label(); this.Table0PaletteLabel = new System.Windows.Forms.Label();
this.PalettesGroup = new System.Windows.Forms.GroupBox(); this.PalettesGroup = new System.Windows.Forms.GroupBox();
this.DetailsBox = new System.Windows.Forms.GroupBox(); this.DetailsBox = new System.Windows.Forms.GroupBox();
this.Value2Label = new System.Windows.Forms.Label(); this.Value2Label = new System.Windows.Forms.Label();
this.ValueLabel = new System.Windows.Forms.Label(); this.ValueLabel = new System.Windows.Forms.Label();
this.AddressLabel = new System.Windows.Forms.Label(); this.AddressLabel = new System.Windows.Forms.Label();
this.SectionLabel = new System.Windows.Forms.Label(); this.SectionLabel = new System.Windows.Forms.Label();
this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.autoloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton(); this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton();
this.table0PToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.table0PToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P0 = new System.Windows.Forms.ToolStripMenuItem(); this.Table0P0 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P1 = new System.Windows.Forms.ToolStripMenuItem(); this.Table0P1 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P2 = new System.Windows.Forms.ToolStripMenuItem(); this.Table0P2 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P3 = new System.Windows.Forms.ToolStripMenuItem(); this.Table0P3 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P4 = new System.Windows.Forms.ToolStripMenuItem(); this.Table0P4 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P5 = new System.Windows.Forms.ToolStripMenuItem(); this.Table0P5 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P6 = new System.Windows.Forms.ToolStripMenuItem(); this.Table0P6 = new System.Windows.Forms.ToolStripMenuItem();
this.Table0P7 = new System.Windows.Forms.ToolStripMenuItem(); this.Table0P7 = new System.Windows.Forms.ToolStripMenuItem();
this.table1PaletteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.table1PaletteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P0 = new System.Windows.Forms.ToolStripMenuItem(); this.Table1P0 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P1 = new System.Windows.Forms.ToolStripMenuItem(); this.Table1P1 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P2 = new System.Windows.Forms.ToolStripMenuItem(); this.Table1P2 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P3 = new System.Windows.Forms.ToolStripMenuItem(); this.Table1P3 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P4 = new System.Windows.Forms.ToolStripMenuItem(); this.Table1P4 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P5 = new System.Windows.Forms.ToolStripMenuItem(); this.Table1P5 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P6 = new System.Windows.Forms.ToolStripMenuItem(); this.Table1P6 = new System.Windows.Forms.ToolStripMenuItem();
this.Table1P7 = new System.Windows.Forms.ToolStripMenuItem(); this.Table1P7 = new System.Windows.Forms.ToolStripMenuItem();
this.SpriteViewerBox = new System.Windows.Forms.GroupBox(); this.SpriteViewerBox = new System.Windows.Forms.GroupBox();
this.SpriteView = new BizHawk.MultiClient.SpriteViewer(); this.SpriteView = new BizHawk.MultiClient.SpriteViewer();
this.PaletteView = new BizHawk.MultiClient.PaletteViewer(); this.PaletteView = new BizHawk.MultiClient.PaletteViewer();
this.PatternView = new BizHawk.MultiClient.PatternViewer(); this.PatternView = new BizHawk.MultiClient.PatternViewer();
this.PatternGroup.SuspendLayout(); this.label1 = new System.Windows.Forms.Label();
this.PalettesGroup.SuspendLayout(); this.txtScanline = new System.Windows.Forms.TextBox();
this.DetailsBox.SuspendLayout(); this.PatternGroup.SuspendLayout();
this.toolStrip1.SuspendLayout(); this.PalettesGroup.SuspendLayout();
this.SpriteViewerBox.SuspendLayout(); this.DetailsBox.SuspendLayout();
this.SuspendLayout(); this.toolStrip1.SuspendLayout();
// this.SpriteViewerBox.SuspendLayout();
// PatternGroup this.SuspendLayout();
// //
this.PatternGroup.Controls.Add(this.Table1PaletteLabel); // PatternGroup
this.PatternGroup.Controls.Add(this.Table0PaletteLabel); //
this.PatternGroup.Controls.Add(this.PatternView); this.PatternGroup.Controls.Add(this.Table1PaletteLabel);
this.PatternGroup.Location = new System.Drawing.Point(12, 37); this.PatternGroup.Controls.Add(this.Table0PaletteLabel);
this.PatternGroup.Name = "PatternGroup"; this.PatternGroup.Controls.Add(this.PatternView);
this.PatternGroup.Size = new System.Drawing.Size(272, 169); this.PatternGroup.Location = new System.Drawing.Point(12, 37);
this.PatternGroup.TabIndex = 0; this.PatternGroup.Name = "PatternGroup";
this.PatternGroup.TabStop = false; this.PatternGroup.Size = new System.Drawing.Size(272, 169);
this.PatternGroup.Text = "Pattern Tables"; this.PatternGroup.TabIndex = 0;
// this.PatternGroup.TabStop = false;
// Table1PaletteLabel this.PatternGroup.Text = "Pattern Tables";
// //
this.Table1PaletteLabel.AutoSize = true; // Table1PaletteLabel
this.Table1PaletteLabel.Location = new System.Drawing.Point(129, 150); //
this.Table1PaletteLabel.Name = "Table1PaletteLabel"; this.Table1PaletteLabel.AutoSize = true;
this.Table1PaletteLabel.Size = new System.Drawing.Size(52, 13); this.Table1PaletteLabel.Location = new System.Drawing.Point(129, 150);
this.Table1PaletteLabel.TabIndex = 2; this.Table1PaletteLabel.Name = "Table1PaletteLabel";
this.Table1PaletteLabel.Text = "Palette: 0"; this.Table1PaletteLabel.Size = new System.Drawing.Size(52, 13);
// this.Table1PaletteLabel.TabIndex = 2;
// Table0PaletteLabel this.Table1PaletteLabel.Text = "Palette: 0";
// //
this.Table0PaletteLabel.AutoSize = true; // Table0PaletteLabel
this.Table0PaletteLabel.Location = new System.Drawing.Point(6, 150); //
this.Table0PaletteLabel.Name = "Table0PaletteLabel"; this.Table0PaletteLabel.AutoSize = true;
this.Table0PaletteLabel.Size = new System.Drawing.Size(52, 13); this.Table0PaletteLabel.Location = new System.Drawing.Point(6, 150);
this.Table0PaletteLabel.TabIndex = 1; this.Table0PaletteLabel.Name = "Table0PaletteLabel";
this.Table0PaletteLabel.Text = "Palette: 0"; this.Table0PaletteLabel.Size = new System.Drawing.Size(52, 13);
// this.Table0PaletteLabel.TabIndex = 1;
// PalettesGroup this.Table0PaletteLabel.Text = "Palette: 0";
// //
this.PalettesGroup.Controls.Add(this.PaletteView); // PalettesGroup
this.PalettesGroup.Location = new System.Drawing.Point(12, 225); //
this.PalettesGroup.Name = "PalettesGroup"; this.PalettesGroup.Controls.Add(this.PaletteView);
this.PalettesGroup.Size = new System.Drawing.Size(272, 65); this.PalettesGroup.Location = new System.Drawing.Point(12, 225);
this.PalettesGroup.TabIndex = 1; this.PalettesGroup.Name = "PalettesGroup";
this.PalettesGroup.TabStop = false; this.PalettesGroup.Size = new System.Drawing.Size(272, 65);
this.PalettesGroup.Text = "Palettes"; this.PalettesGroup.TabIndex = 1;
// this.PalettesGroup.TabStop = false;
// DetailsBox this.PalettesGroup.Text = "Palettes";
// //
this.DetailsBox.Controls.Add(this.Value2Label); // DetailsBox
this.DetailsBox.Controls.Add(this.ValueLabel); //
this.DetailsBox.Controls.Add(this.AddressLabel); this.DetailsBox.Controls.Add(this.Value2Label);
this.DetailsBox.Controls.Add(this.SectionLabel); this.DetailsBox.Controls.Add(this.ValueLabel);
this.DetailsBox.Location = new System.Drawing.Point(299, 200); this.DetailsBox.Controls.Add(this.AddressLabel);
this.DetailsBox.Name = "DetailsBox"; this.DetailsBox.Controls.Add(this.SectionLabel);
this.DetailsBox.Size = new System.Drawing.Size(177, 90); this.DetailsBox.Location = new System.Drawing.Point(299, 200);
this.DetailsBox.TabIndex = 2; this.DetailsBox.Name = "DetailsBox";
this.DetailsBox.TabStop = false; this.DetailsBox.Size = new System.Drawing.Size(177, 90);
this.DetailsBox.Text = "Details"; this.DetailsBox.TabIndex = 2;
// this.DetailsBox.TabStop = false;
// Value2Label this.DetailsBox.Text = "Details";
// //
this.Value2Label.AutoSize = true; // Value2Label
this.Value2Label.Location = new System.Drawing.Point(6, 72); //
this.Value2Label.Name = "Value2Label"; this.Value2Label.AutoSize = true;
this.Value2Label.Size = new System.Drawing.Size(35, 13); this.Value2Label.Location = new System.Drawing.Point(6, 72);
this.Value2Label.TabIndex = 3; this.Value2Label.Name = "Value2Label";
this.Value2Label.Text = "label1"; this.Value2Label.Size = new System.Drawing.Size(35, 13);
// this.Value2Label.TabIndex = 3;
// ValueLabel this.Value2Label.Text = "label1";
// //
this.ValueLabel.AutoSize = true; // ValueLabel
this.ValueLabel.Location = new System.Drawing.Point(6, 53); //
this.ValueLabel.Name = "ValueLabel"; this.ValueLabel.AutoSize = true;
this.ValueLabel.Size = new System.Drawing.Size(35, 13); this.ValueLabel.Location = new System.Drawing.Point(6, 53);
this.ValueLabel.TabIndex = 2; this.ValueLabel.Name = "ValueLabel";
this.ValueLabel.Text = "label1"; this.ValueLabel.Size = new System.Drawing.Size(35, 13);
// this.ValueLabel.TabIndex = 2;
// AddressLabel this.ValueLabel.Text = "label1";
// //
this.AddressLabel.AutoSize = true; // AddressLabel
this.AddressLabel.Location = new System.Drawing.Point(6, 35); //
this.AddressLabel.Name = "AddressLabel"; this.AddressLabel.AutoSize = true;
this.AddressLabel.Size = new System.Drawing.Size(35, 13); this.AddressLabel.Location = new System.Drawing.Point(6, 35);
this.AddressLabel.TabIndex = 1; this.AddressLabel.Name = "AddressLabel";
this.AddressLabel.Text = "label1"; this.AddressLabel.Size = new System.Drawing.Size(35, 13);
// this.AddressLabel.TabIndex = 1;
// SectionLabel this.AddressLabel.Text = "label1";
// //
this.SectionLabel.AutoSize = true; // SectionLabel
this.SectionLabel.Location = new System.Drawing.Point(6, 18); //
this.SectionLabel.Name = "SectionLabel"; this.SectionLabel.AutoSize = true;
this.SectionLabel.Size = new System.Drawing.Size(35, 13); this.SectionLabel.Location = new System.Drawing.Point(6, 18);
this.SectionLabel.TabIndex = 0; this.SectionLabel.Name = "SectionLabel";
this.SectionLabel.Text = "label1"; this.SectionLabel.Size = new System.Drawing.Size(35, 13);
// this.SectionLabel.TabIndex = 0;
// toolStrip1 this.SectionLabel.Text = "label1";
// //
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { // toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton1, this.toolStripDropDownButton1,
this.toolStripDropDownButton2}); this.toolStripDropDownButton2});
this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(587, 25); this.toolStrip1.Size = new System.Drawing.Size(587, 25);
this.toolStrip1.TabIndex = 3; this.toolStrip1.TabIndex = 3;
this.toolStrip1.Text = "toolStrip1"; this.toolStrip1.Text = "toolStrip1";
// //
// toolStripDropDownButton1 // toolStripDropDownButton1
// //
this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.autoloadToolStripMenuItem, this.autoloadToolStripMenuItem,
this.saveWindowPositionToolStripMenuItem}); this.saveWindowPositionToolStripMenuItem});
this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image"))); this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(59, 22); this.toolStripDropDownButton1.Size = new System.Drawing.Size(59, 22);
this.toolStripDropDownButton1.Text = "Settings"; this.toolStripDropDownButton1.Text = "Settings";
this.toolStripDropDownButton1.DropDownOpened += new System.EventHandler(this.toolStripDropDownButton1_DropDownOpened); this.toolStripDropDownButton1.DropDownOpened += new System.EventHandler(this.toolStripDropDownButton1_DropDownOpened);
// //
// autoloadToolStripMenuItem // autoloadToolStripMenuItem
// //
this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem"; this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem";
this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(188, 22); this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
this.autoloadToolStripMenuItem.Text = "Auto-load"; this.autoloadToolStripMenuItem.Text = "Auto-load";
this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click); this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click);
// //
// saveWindowPositionToolStripMenuItem // saveWindowPositionToolStripMenuItem
// //
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem"; this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(188, 22); this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
this.saveWindowPositionToolStripMenuItem.Text = "Save window position"; this.saveWindowPositionToolStripMenuItem.Text = "Save window position";
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click); this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
// //
// toolStripDropDownButton2 // toolStripDropDownButton2
// //
this.toolStripDropDownButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.toolStripDropDownButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.table0PToolStripMenuItem, this.table0PToolStripMenuItem,
this.table1PaletteToolStripMenuItem}); this.table1PaletteToolStripMenuItem});
this.toolStripDropDownButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton2.Image"))); this.toolStripDropDownButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton2.Image")));
this.toolStripDropDownButton2.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripDropDownButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton2.Name = "toolStripDropDownButton2"; this.toolStripDropDownButton2.Name = "toolStripDropDownButton2";
this.toolStripDropDownButton2.Size = new System.Drawing.Size(56, 22); this.toolStripDropDownButton2.Size = new System.Drawing.Size(56, 22);
this.toolStripDropDownButton2.Text = "Pattern"; this.toolStripDropDownButton2.Text = "Pattern";
this.toolStripDropDownButton2.DropDownOpened += new System.EventHandler(this.toolStripDropDownButton2_DropDownOpened); this.toolStripDropDownButton2.DropDownOpened += new System.EventHandler(this.toolStripDropDownButton2_DropDownOpened);
// //
// table0PToolStripMenuItem // table0PToolStripMenuItem
// //
this.table0PToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.table0PToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Table0P0, this.Table0P0,
this.Table0P1, this.Table0P1,
this.Table0P2, this.Table0P2,
@ -223,69 +225,69 @@
this.Table0P5, this.Table0P5,
this.Table0P6, this.Table0P6,
this.Table0P7}); this.Table0P7});
this.table0PToolStripMenuItem.Name = "table0PToolStripMenuItem"; this.table0PToolStripMenuItem.Name = "table0PToolStripMenuItem";
this.table0PToolStripMenuItem.Size = new System.Drawing.Size(157, 22); this.table0PToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.table0PToolStripMenuItem.Text = "Table 0 Palette"; this.table0PToolStripMenuItem.Text = "Table 0 Palette";
// //
// Table0P0 // Table0P0
// //
this.Table0P0.Name = "Table0P0"; this.Table0P0.Name = "Table0P0";
this.Table0P0.Size = new System.Drawing.Size(91, 22); this.Table0P0.Size = new System.Drawing.Size(91, 22);
this.Table0P0.Text = "0"; this.Table0P0.Text = "0";
this.Table0P0.Click += new System.EventHandler(this.Palette_Click); this.Table0P0.Click += new System.EventHandler(this.Palette_Click);
// //
// Table0P1 // Table0P1
// //
this.Table0P1.Name = "Table0P1"; this.Table0P1.Name = "Table0P1";
this.Table0P1.Size = new System.Drawing.Size(91, 22); this.Table0P1.Size = new System.Drawing.Size(91, 22);
this.Table0P1.Text = "1"; this.Table0P1.Text = "1";
this.Table0P1.Click += new System.EventHandler(this.Palette_Click); this.Table0P1.Click += new System.EventHandler(this.Palette_Click);
// //
// Table0P2 // Table0P2
// //
this.Table0P2.Name = "Table0P2"; this.Table0P2.Name = "Table0P2";
this.Table0P2.Size = new System.Drawing.Size(91, 22); this.Table0P2.Size = new System.Drawing.Size(91, 22);
this.Table0P2.Text = "2"; this.Table0P2.Text = "2";
this.Table0P2.Click += new System.EventHandler(this.Palette_Click); this.Table0P2.Click += new System.EventHandler(this.Palette_Click);
// //
// Table0P3 // Table0P3
// //
this.Table0P3.Name = "Table0P3"; this.Table0P3.Name = "Table0P3";
this.Table0P3.Size = new System.Drawing.Size(91, 22); this.Table0P3.Size = new System.Drawing.Size(91, 22);
this.Table0P3.Text = "3"; this.Table0P3.Text = "3";
this.Table0P3.Click += new System.EventHandler(this.Palette_Click); this.Table0P3.Click += new System.EventHandler(this.Palette_Click);
// //
// Table0P4 // Table0P4
// //
this.Table0P4.Name = "Table0P4"; this.Table0P4.Name = "Table0P4";
this.Table0P4.Size = new System.Drawing.Size(91, 22); this.Table0P4.Size = new System.Drawing.Size(91, 22);
this.Table0P4.Text = "4"; this.Table0P4.Text = "4";
this.Table0P4.Click += new System.EventHandler(this.Palette_Click); this.Table0P4.Click += new System.EventHandler(this.Palette_Click);
// //
// Table0P5 // Table0P5
// //
this.Table0P5.Name = "Table0P5"; this.Table0P5.Name = "Table0P5";
this.Table0P5.Size = new System.Drawing.Size(91, 22); this.Table0P5.Size = new System.Drawing.Size(91, 22);
this.Table0P5.Text = "5"; this.Table0P5.Text = "5";
this.Table0P5.Click += new System.EventHandler(this.Palette_Click); this.Table0P5.Click += new System.EventHandler(this.Palette_Click);
// //
// Table0P6 // Table0P6
// //
this.Table0P6.Name = "Table0P6"; this.Table0P6.Name = "Table0P6";
this.Table0P6.Size = new System.Drawing.Size(91, 22); this.Table0P6.Size = new System.Drawing.Size(91, 22);
this.Table0P6.Text = "6"; this.Table0P6.Text = "6";
this.Table0P6.Click += new System.EventHandler(this.Palette_Click); this.Table0P6.Click += new System.EventHandler(this.Palette_Click);
// //
// Table0P7 // Table0P7
// //
this.Table0P7.Name = "Table0P7"; this.Table0P7.Name = "Table0P7";
this.Table0P7.Size = new System.Drawing.Size(91, 22); this.Table0P7.Size = new System.Drawing.Size(91, 22);
this.Table0P7.Text = "7"; this.Table0P7.Text = "7";
this.Table0P7.Click += new System.EventHandler(this.Palette_Click); this.Table0P7.Click += new System.EventHandler(this.Palette_Click);
// //
// table1PaletteToolStripMenuItem // table1PaletteToolStripMenuItem
// //
this.table1PaletteToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.table1PaletteToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Table1P0, this.Table1P0,
this.Table1P1, this.Table1P1,
this.Table1P2, this.Table1P2,
@ -294,131 +296,152 @@
this.Table1P5, this.Table1P5,
this.Table1P6, this.Table1P6,
this.Table1P7}); this.Table1P7});
this.table1PaletteToolStripMenuItem.Name = "table1PaletteToolStripMenuItem"; this.table1PaletteToolStripMenuItem.Name = "table1PaletteToolStripMenuItem";
this.table1PaletteToolStripMenuItem.Size = new System.Drawing.Size(157, 22); this.table1PaletteToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.table1PaletteToolStripMenuItem.Text = "Table 1 Palette"; this.table1PaletteToolStripMenuItem.Text = "Table 1 Palette";
// //
// Table1P0 // Table1P0
// //
this.Table1P0.Name = "Table1P0"; this.Table1P0.Name = "Table1P0";
this.Table1P0.Size = new System.Drawing.Size(91, 22); this.Table1P0.Size = new System.Drawing.Size(91, 22);
this.Table1P0.Text = "0"; this.Table1P0.Text = "0";
this.Table1P0.Click += new System.EventHandler(this.Palette_Click); this.Table1P0.Click += new System.EventHandler(this.Palette_Click);
// //
// Table1P1 // Table1P1
// //
this.Table1P1.Name = "Table1P1"; this.Table1P1.Name = "Table1P1";
this.Table1P1.Size = new System.Drawing.Size(91, 22); this.Table1P1.Size = new System.Drawing.Size(91, 22);
this.Table1P1.Text = "1"; this.Table1P1.Text = "1";
this.Table1P1.Click += new System.EventHandler(this.Palette_Click); this.Table1P1.Click += new System.EventHandler(this.Palette_Click);
// //
// Table1P2 // Table1P2
// //
this.Table1P2.Name = "Table1P2"; this.Table1P2.Name = "Table1P2";
this.Table1P2.Size = new System.Drawing.Size(91, 22); this.Table1P2.Size = new System.Drawing.Size(91, 22);
this.Table1P2.Text = "2"; this.Table1P2.Text = "2";
this.Table1P2.Click += new System.EventHandler(this.Palette_Click); this.Table1P2.Click += new System.EventHandler(this.Palette_Click);
// //
// Table1P3 // Table1P3
// //
this.Table1P3.Name = "Table1P3"; this.Table1P3.Name = "Table1P3";
this.Table1P3.Size = new System.Drawing.Size(91, 22); this.Table1P3.Size = new System.Drawing.Size(91, 22);
this.Table1P3.Text = "3"; this.Table1P3.Text = "3";
this.Table1P3.Click += new System.EventHandler(this.Palette_Click); this.Table1P3.Click += new System.EventHandler(this.Palette_Click);
// //
// Table1P4 // Table1P4
// //
this.Table1P4.Name = "Table1P4"; this.Table1P4.Name = "Table1P4";
this.Table1P4.Size = new System.Drawing.Size(91, 22); this.Table1P4.Size = new System.Drawing.Size(91, 22);
this.Table1P4.Text = "4"; this.Table1P4.Text = "4";
this.Table1P4.Click += new System.EventHandler(this.Palette_Click); this.Table1P4.Click += new System.EventHandler(this.Palette_Click);
// //
// Table1P5 // Table1P5
// //
this.Table1P5.Name = "Table1P5"; this.Table1P5.Name = "Table1P5";
this.Table1P5.Size = new System.Drawing.Size(91, 22); this.Table1P5.Size = new System.Drawing.Size(91, 22);
this.Table1P5.Text = "5"; this.Table1P5.Text = "5";
this.Table1P5.Click += new System.EventHandler(this.Palette_Click); this.Table1P5.Click += new System.EventHandler(this.Palette_Click);
// //
// Table1P6 // Table1P6
// //
this.Table1P6.Name = "Table1P6"; this.Table1P6.Name = "Table1P6";
this.Table1P6.Size = new System.Drawing.Size(91, 22); this.Table1P6.Size = new System.Drawing.Size(91, 22);
this.Table1P6.Text = "6"; this.Table1P6.Text = "6";
this.Table1P6.Click += new System.EventHandler(this.Palette_Click); this.Table1P6.Click += new System.EventHandler(this.Palette_Click);
// //
// Table1P7 // Table1P7
// //
this.Table1P7.Name = "Table1P7"; this.Table1P7.Name = "Table1P7";
this.Table1P7.Size = new System.Drawing.Size(91, 22); this.Table1P7.Size = new System.Drawing.Size(91, 22);
this.Table1P7.Text = "7"; this.Table1P7.Text = "7";
this.Table1P7.Click += new System.EventHandler(this.Palette_Click); this.Table1P7.Click += new System.EventHandler(this.Palette_Click);
// //
// SpriteViewerBox // SpriteViewerBox
// //
this.SpriteViewerBox.Controls.Add(this.SpriteView); this.SpriteViewerBox.Controls.Add(this.SpriteView);
this.SpriteViewerBox.Location = new System.Drawing.Point(299, 37); this.SpriteViewerBox.Location = new System.Drawing.Point(299, 37);
this.SpriteViewerBox.Name = "SpriteViewerBox"; this.SpriteViewerBox.Name = "SpriteViewerBox";
this.SpriteViewerBox.Size = new System.Drawing.Size(272, 155); this.SpriteViewerBox.Size = new System.Drawing.Size(272, 155);
this.SpriteViewerBox.TabIndex = 5; this.SpriteViewerBox.TabIndex = 5;
this.SpriteViewerBox.TabStop = false; this.SpriteViewerBox.TabStop = false;
this.SpriteViewerBox.Text = "Sprites"; this.SpriteViewerBox.Text = "Sprites";
// //
// SpriteView // SpriteView
// //
this.SpriteView.BackColor = System.Drawing.Color.White; this.SpriteView.BackColor = System.Drawing.Color.White;
this.SpriteView.Location = new System.Drawing.Point(6, 18); this.SpriteView.Location = new System.Drawing.Point(6, 18);
this.SpriteView.Name = "SpriteView"; this.SpriteView.Name = "SpriteView";
this.SpriteView.Size = new System.Drawing.Size(256, 128); this.SpriteView.Size = new System.Drawing.Size(256, 128);
this.SpriteView.TabIndex = 0; this.SpriteView.TabIndex = 0;
// //
// PaletteView // PaletteView
// //
this.PaletteView.BackColor = System.Drawing.Color.White; this.PaletteView.BackColor = System.Drawing.Color.White;
this.PaletteView.Location = new System.Drawing.Point(6, 19); this.PaletteView.Location = new System.Drawing.Point(6, 19);
this.PaletteView.Name = "PaletteView"; this.PaletteView.Name = "PaletteView";
this.PaletteView.Size = new System.Drawing.Size(257, 34); this.PaletteView.Size = new System.Drawing.Size(257, 34);
this.PaletteView.TabIndex = 0; this.PaletteView.TabIndex = 0;
this.PaletteView.MouseLeave += new System.EventHandler(this.PaletteView_MouseLeave); this.PaletteView.MouseLeave += new System.EventHandler(this.PaletteView_MouseLeave);
this.PaletteView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PaletteView_MouseMove); this.PaletteView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PaletteView_MouseMove);
this.PaletteView.MouseEnter += new System.EventHandler(this.PaletteView_MouseEnter); this.PaletteView.MouseEnter += new System.EventHandler(this.PaletteView_MouseEnter);
// //
// PatternView // PatternView
// //
this.PatternView.BackColor = System.Drawing.Color.White; this.PatternView.BackColor = System.Drawing.Color.White;
this.PatternView.Location = new System.Drawing.Point(7, 20); this.PatternView.Location = new System.Drawing.Point(7, 20);
this.PatternView.Name = "PatternView"; this.PatternView.Name = "PatternView";
this.PatternView.Size = new System.Drawing.Size(256, 128); this.PatternView.Size = new System.Drawing.Size(256, 128);
this.PatternView.TabIndex = 0; this.PatternView.TabIndex = 0;
this.PatternView.MouseLeave += new System.EventHandler(this.PatternView_MouseLeave); this.PatternView.MouseLeave += new System.EventHandler(this.PatternView_MouseLeave);
this.PatternView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PatternView_MouseMove); this.PatternView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PatternView_MouseMove);
this.PatternView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PatternView_Click); this.PatternView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PatternView_Click);
this.PatternView.MouseEnter += new System.EventHandler(this.PatternView_MouseEnter); this.PatternView.MouseEnter += new System.EventHandler(this.PatternView_MouseEnter);
// //
// NESPPU // label1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.label1.AutoSize = true;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.label1.Location = new System.Drawing.Point(502, 204);
this.ClientSize = new System.Drawing.Size(587, 317); this.label1.Name = "label1";
this.Controls.Add(this.SpriteViewerBox); this.label1.Size = new System.Drawing.Size(48, 13);
this.Controls.Add(this.toolStrip1); this.label1.TabIndex = 7;
this.Controls.Add(this.DetailsBox); this.label1.Text = "Scanline";
this.Controls.Add(this.PalettesGroup); //
this.Controls.Add(this.PatternGroup); // txtScanline
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; //
this.Name = "NESPPU"; this.txtScanline.Location = new System.Drawing.Point(501, 223);
this.Text = "PPU Viewer"; this.txtScanline.Name = "txtScanline";
this.Load += new System.EventHandler(this.NESPPU_Load); this.txtScanline.Size = new System.Drawing.Size(60, 20);
this.PatternGroup.ResumeLayout(false); this.txtScanline.TabIndex = 6;
this.PatternGroup.PerformLayout(); this.txtScanline.Text = "0";
this.PalettesGroup.ResumeLayout(false); this.txtScanline.TextChanged += new System.EventHandler(this.txtScanline_TextChanged);
this.DetailsBox.ResumeLayout(false); //
this.DetailsBox.PerformLayout(); // NESPPU
this.toolStrip1.ResumeLayout(false); //
this.toolStrip1.PerformLayout(); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.SpriteViewerBox.ResumeLayout(false); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ResumeLayout(false); this.ClientSize = new System.Drawing.Size(587, 317);
this.PerformLayout(); 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.ToolStripMenuItem Table1P7;
private System.Windows.Forms.GroupBox SpriteViewerBox; private System.Windows.Forms.GroupBox SpriteViewerBox;
private SpriteViewer SpriteView; 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; int defaultHeight;
NES Nes; NES Nes;
NES.PPU.DebugCallback Callback = new NES.PPU.DebugCallback();
public NESPPU() public NESPPU()
{ {
InitializeComponent(); InitializeComponent();
Closing += (o, e) => SaveConfigSettings(); Closing += (o, e) => SaveConfigSettings();
Callback.Callback = () => Generate();
} }
private void SaveConfigSettings() private void SaveConfigSettings()
@ -60,9 +63,8 @@ namespace BizHawk.MultiClient
return (byte)(((value >> (7 - bit)) & 1)); 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; if (!this.IsHandleCreated || this.IsDisposed) return;
//Pattern Viewer //Pattern Viewer
@ -72,51 +74,58 @@ namespace BizHawk.MultiClient
PaletteView.spritePalettes[x].SetValue(Nes.LookupColor(Nes.ppu.PALRAM[PaletteView.spritePalettes[x].address])); PaletteView.spritePalettes[x].SetValue(Nes.LookupColor(Nes.ppu.PALRAM[PaletteView.spritePalettes[x].address]));
} }
PaletteView.Refresh(); PaletteView.Refresh();
//Pattern Viewer //Pattern Viewer
int b0 = 0; int b0 = 0;
int b1 = 0; int b1 = 0;
byte value; byte value;
int cvalue; int cvalue;
int pal; 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); 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(); int* framebuf = (int*)bmpdata.Scan0.ToPointer();
for (int z = 0; z < 2; z++) for (int z = 0; z < 2; z++)
{ {
if (z == 0) if (z == 0)
pal = PatternView.Pal0; pal = PatternView.Pal0;
else else
pal = PatternView.Pal1; pal = PatternView.Pal1;
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
for (int j = 0; j < 16; j++) for (int j = 0; j < 16; j++)
{ {
for (int x = 0; x < 8; x++) for (int x = 0; x < 8; x++)
{ {
for (int y = 0; y < 8; y++) for (int y = 0; y < 8; y++)
{ {
b0 = GetBit((z*0x1000) + (i * 256) + (j * 16) + y + 0 * 8, x); b0 = GetBit((z * 0x1000) + (i * 256) + (j * 16) + y + 0 * 8, x);
b1 = GetBit((z*0x1000) + (i * 256) + (j * 16) + y + 1 * 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)]); cvalue = Nes.LookupColor(Nes.ppu.PALRAM[value + (pal * 4)]);
Color color = Color.FromArgb(cvalue);
int adr = (x + (j * 8)) + (y + (i * 8)) * (bmpdata.Stride / 4); Color color = Color.FromArgb(cvalue);
framebuf[adr + (z*128)] = color.ToArgb();
} int adr = (x + (j * 8)) + (y + (i * 8)) * (bmpdata.Stride / 4);
} framebuf[adr + (z * 128)] = color.ToArgb();
} }
} }
} }
}
}
PatternView.pattern.UnlockBits(bmpdata); PatternView.pattern.UnlockBits(bmpdata);
PatternView.Refresh(); 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) private void NESPPU_Load(object sender, EventArgs e)
{ {
LoadConfigSettings(); LoadConfigSettings();
@ -338,5 +347,21 @@ namespace BizHawk.MultiClient
UpdateTableLabels(); 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;
}
} }
} }