PCE: add tile viewer. it doesn't have as many bells and whistles as the other viewers, but it does a basic job of it.

This commit is contained in:
goyuken 2014-02-08 16:40:15 +00:00
parent 0da1e900df
commit 8b006b3b59
7 changed files with 533 additions and 53 deletions

View File

@ -662,6 +662,12 @@
<Compile Include="tools\PCE\PCEBGViewer.Designer.cs">
<DependentUpon>PCEBGViewer.cs</DependentUpon>
</Compile>
<Compile Include="tools\PCE\PCETileViewer.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="tools\PCE\PCETileViewer.Designer.cs">
<DependentUpon>PCETileViewer.cs</DependentUpon>
</Compile>
<Compile Include="tools\SNES\SNESGameGenie.cs">
<SubType>Form</SubType>
</Compile>
@ -1073,6 +1079,9 @@
<EmbeddedResource Include="tools\PCE\PCEBGViewer.resx">
<DependentUpon>PCEBGViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\PCE\PCETileViewer.resx">
<DependentUpon>PCETileViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\SNES\SNESGameGenie.resx">
<DependentUpon>SNESGameGenie.cs</DependentUpon>
</EmbeddedResource>

View File

@ -127,13 +127,13 @@
this.ConfigSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.ControllersMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.HotkeysMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MessagesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.PathsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DisplayConfigMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SoundMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.PathsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.FirmwaresMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MessagesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.AutofireMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.RewindOptionsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DisplayConfigMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.FirmwaresMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.ConfigEnableSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.EnableContextMenuMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -341,6 +341,7 @@
this.ClearSRAMContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ShowMenuContextMenuSeparator = new System.Windows.Forms.ToolStripSeparator();
this.ShowMenuContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.PCEtileViewerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MainformMenu.SuspendLayout();
this.MainStatusBar.SuspendLayout();
this.MainFormContextMenu.SuspendLayout();
@ -1242,7 +1243,7 @@
//
this.ControllersMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.GameController;
this.ControllersMenuItem.Name = "ControllersMenuItem";
this.ControllersMenuItem.Size = new System.Drawing.Size(152, 22);
this.ControllersMenuItem.Size = new System.Drawing.Size(150, 22);
this.ControllersMenuItem.Text = "&Controllers...";
this.ControllersMenuItem.Click += new System.EventHandler(this.ControllersMenuItem_Click);
//
@ -1250,39 +1251,55 @@
//
this.HotkeysMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.HotKeys;
this.HotkeysMenuItem.Name = "HotkeysMenuItem";
this.HotkeysMenuItem.Size = new System.Drawing.Size(152, 22);
this.HotkeysMenuItem.Size = new System.Drawing.Size(150, 22);
this.HotkeysMenuItem.Text = "&Hotkeys...";
this.HotkeysMenuItem.Click += new System.EventHandler(this.HotkeysMenuItem_Click);
//
// MessagesMenuItem
// DisplayConfigMenuItem
//
this.MessagesMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MessageConfig;
this.MessagesMenuItem.Name = "MessagesMenuItem";
this.MessagesMenuItem.Size = new System.Drawing.Size(152, 22);
this.MessagesMenuItem.Text = "&Messages...";
this.MessagesMenuItem.Click += new System.EventHandler(this.MessagesMenuItem_Click);
//
// PathsMenuItem
//
this.PathsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CopyFolderHS;
this.PathsMenuItem.Name = "PathsMenuItem";
this.PathsMenuItem.Size = new System.Drawing.Size(152, 22);
this.PathsMenuItem.Text = "Paths...";
this.PathsMenuItem.Click += new System.EventHandler(this.PathsMenuItem_Click);
this.DisplayConfigMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("DisplayConfigMenuItem.Image")));
this.DisplayConfigMenuItem.Name = "DisplayConfigMenuItem";
this.DisplayConfigMenuItem.Size = new System.Drawing.Size(150, 22);
this.DisplayConfigMenuItem.Text = "Display...";
this.DisplayConfigMenuItem.Click += new System.EventHandler(this.DisplayConfigMenuItem_Click);
//
// SoundMenuItem
//
this.SoundMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.AudioHS;
this.SoundMenuItem.Name = "SoundMenuItem";
this.SoundMenuItem.Size = new System.Drawing.Size(152, 22);
this.SoundMenuItem.Size = new System.Drawing.Size(150, 22);
this.SoundMenuItem.Text = "&Sound...";
this.SoundMenuItem.Click += new System.EventHandler(this.SoundMenuItem_Click);
//
// PathsMenuItem
//
this.PathsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CopyFolderHS;
this.PathsMenuItem.Name = "PathsMenuItem";
this.PathsMenuItem.Size = new System.Drawing.Size(150, 22);
this.PathsMenuItem.Text = "Paths...";
this.PathsMenuItem.Click += new System.EventHandler(this.PathsMenuItem_Click);
//
// FirmwaresMenuItem
//
this.FirmwaresMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("FirmwaresMenuItem.Image")));
this.FirmwaresMenuItem.Name = "FirmwaresMenuItem";
this.FirmwaresMenuItem.Size = new System.Drawing.Size(150, 22);
this.FirmwaresMenuItem.Text = "&Firmwares";
this.FirmwaresMenuItem.Click += new System.EventHandler(this.FirmwaresMenuItem_Click);
//
// MessagesMenuItem
//
this.MessagesMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MessageConfig;
this.MessagesMenuItem.Name = "MessagesMenuItem";
this.MessagesMenuItem.Size = new System.Drawing.Size(150, 22);
this.MessagesMenuItem.Text = "&Messages...";
this.MessagesMenuItem.Click += new System.EventHandler(this.MessagesMenuItem_Click);
//
// AutofireMenuItem
//
this.AutofireMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Lightning;
this.AutofireMenuItem.Name = "AutofireMenuItem";
this.AutofireMenuItem.Size = new System.Drawing.Size(152, 22);
this.AutofireMenuItem.Size = new System.Drawing.Size(150, 22);
this.AutofireMenuItem.Text = "&Autofire...";
this.AutofireMenuItem.Click += new System.EventHandler(this.AutofireMenuItem_Click);
//
@ -1290,30 +1307,14 @@
//
this.RewindOptionsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Previous;
this.RewindOptionsMenuItem.Name = "RewindOptionsMenuItem";
this.RewindOptionsMenuItem.Size = new System.Drawing.Size(152, 22);
this.RewindOptionsMenuItem.Size = new System.Drawing.Size(150, 22);
this.RewindOptionsMenuItem.Text = "&Rewind...";
this.RewindOptionsMenuItem.Click += new System.EventHandler(this.RewindOptionsMenuItem_Click);
//
// DisplayConfigMenuItem
//
this.DisplayConfigMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("DisplayConfigMenuItem.Image")));
this.DisplayConfigMenuItem.Name = "DisplayConfigMenuItem";
this.DisplayConfigMenuItem.Size = new System.Drawing.Size(152, 22);
this.DisplayConfigMenuItem.Text = "Display...";
this.DisplayConfigMenuItem.Click += new System.EventHandler(this.DisplayConfigMenuItem_Click);
//
// FirmwaresMenuItem
//
this.FirmwaresMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("FirmwaresMenuItem.Image")));
this.FirmwaresMenuItem.Name = "FirmwaresMenuItem";
this.FirmwaresMenuItem.Size = new System.Drawing.Size(152, 22);
this.FirmwaresMenuItem.Text = "&Firmwares";
this.FirmwaresMenuItem.Click += new System.EventHandler(this.FirmwaresMenuItem_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(149, 6);
this.toolStripSeparator9.Size = new System.Drawing.Size(147, 6);
//
// ConfigEnableSubMenu
//
@ -1325,7 +1326,7 @@
this.FrameAdvanceSkipLagMenuItem,
this.BackupSaveramMenuItem});
this.ConfigEnableSubMenu.Name = "ConfigEnableSubMenu";
this.ConfigEnableSubMenu.Size = new System.Drawing.Size(152, 22);
this.ConfigEnableSubMenu.Size = new System.Drawing.Size(150, 22);
this.ConfigEnableSubMenu.Text = "&Enable";
this.ConfigEnableSubMenu.DropDownOpened += new System.EventHandler(this.EnableMenuItem_DropDownOpened);
//
@ -1387,7 +1388,7 @@
this.toolStripSeparator23,
this.LogWindowAsConsoleMenuItem});
this.GuiSubMenu.Name = "GuiSubMenu";
this.GuiSubMenu.Size = new System.Drawing.Size(152, 22);
this.GuiSubMenu.Size = new System.Drawing.Size(150, 22);
this.GuiSubMenu.Text = "GUI";
this.GuiSubMenu.DropDownOpened += new System.EventHandler(this.GuiSubMenu_DropDownOpened);
//
@ -1498,7 +1499,7 @@
this.Speed150MenuItem,
this.Speed200MenuItem});
this.SpeedSkipSubMenu.Name = "SpeedSkipSubMenu";
this.SpeedSkipSubMenu.Size = new System.Drawing.Size(152, 22);
this.SpeedSkipSubMenu.Size = new System.Drawing.Size(150, 22);
this.SpeedSkipSubMenu.Text = "Speed/Skip";
this.SpeedSkipSubMenu.DropDownOpened += new System.EventHandler(this.FrameSkipMenuItem_DropDownOpened);
//
@ -1664,7 +1665,7 @@
this.InputOverHkMenuItem,
this.HkOverInputMenuItem});
this.KeyPrioritySubMenu.Name = "KeyPrioritySubMenu";
this.KeyPrioritySubMenu.Size = new System.Drawing.Size(152, 22);
this.KeyPrioritySubMenu.Size = new System.Drawing.Size(150, 22);
this.KeyPrioritySubMenu.Text = "Key Priority";
this.KeyPrioritySubMenu.DropDownOpened += new System.EventHandler(this.KeyPriorityMenuItem_DropDownOpened);
//
@ -1696,7 +1697,7 @@
this.SavestateBinaryMenuItem,
this.SavestateTextMenuItem});
this.SavestateTypeSubMenu.Name = "SavestateTypeSubMenu";
this.SavestateTypeSubMenu.Size = new System.Drawing.Size(152, 22);
this.SavestateTypeSubMenu.Size = new System.Drawing.Size(150, 22);
this.SavestateTypeSubMenu.Text = "Savestate Type";
this.SavestateTypeSubMenu.DropDownOpened += new System.EventHandler(this.SavestateTypeMenuItem_DropDownOpened);
//
@ -1724,13 +1725,13 @@
// toolStripSeparator10
//
this.toolStripSeparator10.Name = "toolStripSeparator10";
this.toolStripSeparator10.Size = new System.Drawing.Size(149, 6);
this.toolStripSeparator10.Size = new System.Drawing.Size(147, 6);
//
// SaveConfigMenuItem
//
this.SaveConfigMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Save;
this.SaveConfigMenuItem.Name = "SaveConfigMenuItem";
this.SaveConfigMenuItem.Size = new System.Drawing.Size(152, 22);
this.SaveConfigMenuItem.Size = new System.Drawing.Size(150, 22);
this.SaveConfigMenuItem.Text = "Save Config";
this.SaveConfigMenuItem.Click += new System.EventHandler(this.SaveConfigMenuItem_Click);
//
@ -1738,14 +1739,14 @@
//
this.LoadConfigMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.LoadConfig;
this.LoadConfigMenuItem.Name = "LoadConfigMenuItem";
this.LoadConfigMenuItem.Size = new System.Drawing.Size(152, 22);
this.LoadConfigMenuItem.Size = new System.Drawing.Size(150, 22);
this.LoadConfigMenuItem.Text = "Load Config";
this.LoadConfigMenuItem.Click += new System.EventHandler(this.LoadConfigMenuItem_Click);
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(149, 6);
this.toolStripSeparator8.Size = new System.Drawing.Size(147, 6);
//
// coreSelectionToolStripMenuItem
//
@ -1753,7 +1754,7 @@
this.gBInSGBToolStripMenuItem,
this.nESInQuickNESToolStripMenuItem});
this.coreSelectionToolStripMenuItem.Name = "coreSelectionToolStripMenuItem";
this.coreSelectionToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.coreSelectionToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.coreSelectionToolStripMenuItem.Text = "Core Selection";
this.coreSelectionToolStripMenuItem.DropDownOpened += new System.EventHandler(this.coreSelectionToolStripMenuItem_DropDownOpened);
this.coreSelectionToolStripMenuItem.Click += new System.EventHandler(this.coreSelectionToolStripMenuItem_Click);
@ -1988,6 +1989,7 @@
//
this.PCESubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.PCEBGViewerMenuItem,
this.PCEtileViewerToolStripMenuItem,
this.toolStripSeparator25,
this.PCEAlwaysPerformSpriteLimitMenuItem,
this.PCEAlwaysEqualizeVolumesMenuItem,
@ -2975,6 +2977,13 @@
this.ShowMenuContextMenuItem.Text = "Show Menu";
this.ShowMenuContextMenuItem.Click += new System.EventHandler(this.ShowMenuContextMenuItem_Click);
//
// PCEtileViewerToolStripMenuItem
//
this.PCEtileViewerToolStripMenuItem.Name = "PCEtileViewerToolStripMenuItem";
this.PCEtileViewerToolStripMenuItem.Size = new System.Drawing.Size(240, 22);
this.PCEtileViewerToolStripMenuItem.Text = "&Tile Viewer";
this.PCEtileViewerToolStripMenuItem.Click += new System.EventHandler(this.PCEtileViewerToolStripMenuItem_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F);
@ -3328,6 +3337,7 @@
private System.Windows.Forms.ToolStripMenuItem nESInQuickNESToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem batchRunnerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem DisplayConfigMenuItem;
private System.Windows.Forms.ToolStripMenuItem PCEtileViewerToolStripMenuItem;
}
}

View File

@ -3052,7 +3052,10 @@ namespace BizHawk.Client.EmuHawk
new config.DisplayConfigLite().ShowDialog();
}
private void PCEtileViewerToolStripMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.Tools.Load<PCETileViewer>();
}
}
}

View File

@ -124,7 +124,7 @@
<data name="DisplayConfigMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NC
YQUAAAAJcEhZcwAADsEAAA7BAbiRa+0AAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NC
NwAAAaRJREFUOE+dk0FLAlEUhd9/kgwFMUQMhMEIhJLIhVCRDIRhAznEIEYtlBiQYApBSGQw2xhBlhLE
zCLQTa3bt2nd8tR5pFTaLLxwuJd7vgNv3syIv+Xz+fA9TpSX96s0TZsAp+0862fAM3xpN5DNZpHL5VAo
FFAqlVCpVFCtVsEgxZk7emTIMsOsyGQyGAwGM4lZkU6n4bouVg4aCO1cQDGusXbyiA1rIMWZO3pkyEYi
@ -138,7 +138,7 @@
<data name="FirmwaresMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAEEwAABBMAbXL4wQAAABwSURBVDhPzZDhCgAhCIN99HvzTgNj6k6i/lzwaW3DKJFH
YQUAAAAJcEhZcwAAEEsAABBLAeePRXsAAABwSURBVDhPzZDhCgAhCIN99HvzTgNj6k6i/lzwaW3DKJFH
xhVMtMU6xYraIDR4BqlCQ87OfBEacnbmtfzsCYr/eu4UK+EJH2hyUjw82CAkeDsDjrDit/nNjofyOUDF
BA4ow9YGzBIimaWheQQVt5HxAoOkokovUz91AAAAAElFTkSuQmCC
</value>

View File

@ -0,0 +1,136 @@
namespace BizHawk.Client.EmuHawk
{
partial class PCETileViewer
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.checkBoxVDC2 = new System.Windows.Forms.CheckBox();
this.bmpViewSPPal = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewSP = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewBGPal = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewBG = new BizHawk.Client.EmuHawk.BmpView();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.bmpViewBGPal);
this.groupBox1.Controls.Add(this.bmpViewBG);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(786, 281);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Background";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.bmpViewSPPal);
this.groupBox2.Controls.Add(this.bmpViewSP);
this.groupBox2.Location = new System.Drawing.Point(12, 299);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(786, 281);
this.groupBox2.TabIndex = 5;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Sprite";
//
// checkBoxVDC2
//
this.checkBoxVDC2.AutoSize = true;
this.checkBoxVDC2.Location = new System.Drawing.Point(12, 586);
this.checkBoxVDC2.Name = "checkBoxVDC2";
this.checkBoxVDC2.Size = new System.Drawing.Size(57, 17);
this.checkBoxVDC2.TabIndex = 6;
this.checkBoxVDC2.Text = "VDC 2";
this.checkBoxVDC2.UseVisualStyleBackColor = true;
this.checkBoxVDC2.CheckedChanged += new System.EventHandler(this.checkBoxVDC2_CheckedChanged);
//
// bmpViewSPPal
//
this.bmpViewSPPal.Location = new System.Drawing.Point(524, 19);
this.bmpViewSPPal.Name = "bmpViewSPPal";
this.bmpViewSPPal.Size = new System.Drawing.Size(256, 256);
this.bmpViewSPPal.TabIndex = 1;
this.bmpViewSPPal.Text = "bmpView4";
this.bmpViewSPPal.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpViewSPPal_MouseClick);
//
// bmpViewSP
//
this.bmpViewSP.Location = new System.Drawing.Point(6, 19);
this.bmpViewSP.Name = "bmpViewSP";
this.bmpViewSP.Size = new System.Drawing.Size(512, 256);
this.bmpViewSP.TabIndex = 0;
this.bmpViewSP.Text = "bmpView3";
//
// bmpViewBGPal
//
this.bmpViewBGPal.Location = new System.Drawing.Point(524, 19);
this.bmpViewBGPal.Name = "bmpViewBGPal";
this.bmpViewBGPal.Size = new System.Drawing.Size(256, 256);
this.bmpViewBGPal.TabIndex = 3;
this.bmpViewBGPal.Text = "bmpView2";
this.bmpViewBGPal.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpViewBGPal_MouseClick);
//
// bmpViewBG
//
this.bmpViewBG.Location = new System.Drawing.Point(6, 19);
this.bmpViewBG.Name = "bmpViewBG";
this.bmpViewBG.Size = new System.Drawing.Size(512, 256);
this.bmpViewBG.TabIndex = 2;
this.bmpViewBG.Text = "bmpView1";
//
// PCETileViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(810, 615);
this.Controls.Add(this.checkBoxVDC2);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "PCETileViewer";
this.Text = "Tile Viewer";
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.CheckBox checkBoxVDC2;
private BmpView bmpViewBGPal;
private BmpView bmpViewBG;
private BmpView bmpViewSPPal;
private BmpView bmpViewSP;
}
}

View File

@ -0,0 +1,202 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BizHawk.Client.Common;
using BizHawk.Emulation.Cores.PCEngine;
using System.Drawing.Imaging;
namespace BizHawk.Client.EmuHawk
{
public partial class PCETileViewer : Form, IToolForm
{
private PCEngine emu;
private VDC vdc;
private VCE vce;
private int bgpalnum;
private int sppalnum;
public PCETileViewer()
{
InitializeComponent();
bmpViewBG.ChangeBitmapSize(512, 256);
bmpViewSP.ChangeBitmapSize(512, 256);
bmpViewBGPal.ChangeBitmapSize(256, 256);
bmpViewSPPal.ChangeBitmapSize(256, 256);
Restart();
}
#region IToolForm
public void UpdateValues()
{
DrawBacks();
DrawSprites();
DrawPalettes();
bmpViewBG.Refresh();
bmpViewBGPal.Refresh();
bmpViewSP.Refresh();
bmpViewSPPal.Refresh();
}
unsafe static void Draw16x16(byte* src, int* dest, int pitch, int* pal)
{
int inc = pitch - 16;
dest -= inc;
for (int i = 0; i < 256; i++)
{
if ((i & 15) == 0)
dest += inc;
*dest++ = pal[*src++];
}
}
unsafe static void Draw8x8(byte* src, int* dest, int pitch, int* pal)
{
int inc = pitch - 8;
dest -= inc;
for (int i = 0; i < 64; i++)
{
if ((i & 7) == 0)
dest += inc;
*dest++ = pal[*src++];
}
}
unsafe void DrawSprites()
{
var lockdata = bmpViewSP.bmp.LockBits(new Rectangle(0, 0, 512, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int* dest = (int*)lockdata.Scan0;
int pitch = lockdata.Stride / sizeof(int);
fixed (byte* src = vdc.SpriteBuffer)
{
fixed (int* pal = &vce.Palette[256 + sppalnum * 16])
{
for (int tile = 0; tile < 512; tile++)
{
int srcaddr = tile * 256;
int tx = tile & 31;
int ty = tile >> 5;
int destaddr = ty * 16 * pitch + tx * 16;
Draw16x16(src + srcaddr, dest + destaddr, pitch, pal);
}
}
}
bmpViewSP.bmp.UnlockBits(lockdata);
}
unsafe void DrawBacks()
{
var lockdata = bmpViewBG.bmp.LockBits(new Rectangle(0, 0, 512, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int* dest = (int*)lockdata.Scan0;
int pitch = lockdata.Stride / sizeof(int);
fixed (byte* src = vdc.PatternBuffer)
{
fixed (int* pal = &vce.Palette[0 + bgpalnum * 16])
{
for (int tile = 0; tile < 2048; tile++)
{
int srcaddr = tile * 64;
int tx = tile & 63;
int ty = tile >> 6;
int destaddr = ty * 8 * pitch + tx * 8;
Draw8x8(src + srcaddr, dest + destaddr, pitch, pal);
}
}
}
bmpViewBG.bmp.UnlockBits(lockdata);
}
unsafe void DrawPalettes()
{
fixed (int* pal = vce.Palette)
{
DrawPalette(bmpViewBGPal.bmp, pal);
DrawPalette(bmpViewSPPal.bmp, pal + 256);
}
}
unsafe static void DrawPalette(Bitmap bmp, int* pal)
{
var lockdata = bmp.LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int* dest = (int*)lockdata.Scan0;
int pitch = lockdata.Stride / sizeof(int);
int inc = pitch - 256;
for (int j = 0; j < 256; j++)
{
for (int i = 0; i < 256; i++)
{
int pindex = j & 0xf0 | i >> 4;
*dest++ = pal[pindex];
}
dest += inc;
}
bmp.UnlockBits(lockdata);
}
public void Restart()
{
if (!(Global.Emulator is PCEngine))
Close();
emu = (PCEngine)Global.Emulator;
vce = emu.VCE;
if (emu.SystemId == "SGX")
{
checkBoxVDC2.Enabled = true;
}
else
{
checkBoxVDC2.Enabled = false;
checkBoxVDC2.Checked = false;
}
checkBoxVDC2_CheckedChanged(null, null);
}
public bool AskSave()
{
return true;
}
public bool UpdateBefore
{
get { return true; }
}
#endregion
private void checkBoxVDC2_CheckedChanged(object sender, EventArgs e)
{
vdc = checkBoxVDC2.Checked ? emu.VDC2 : emu.VDC1;
UpdateValues();
}
private void bmpViewBGPal_MouseClick(object sender, MouseEventArgs e)
{
int p = Math.Min(Math.Max(e.Y / 16, 0), 15);
bgpalnum = p;
DrawBacks();
bmpViewBG.Refresh();
}
private void bmpViewSPPal_MouseClick(object sender, MouseEventArgs e)
{
int p = Math.Min(Math.Max(e.Y / 16, 0), 15);
sppalnum = p;
DrawSprites();
bmpViewSP.Refresh();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>