NES: set NT and PPU viewers to use the new settings stuff
This commit is contained in:
parent
3ff57483ff
commit
ed6082cab3
|
@ -422,17 +422,6 @@ namespace BizHawk.Client.Common
|
|||
public ToolDialogSettings PceVdpSettings = new ToolDialogSettings();
|
||||
public bool PceVdpAutoLoad = false;
|
||||
|
||||
// NESPPU Settings
|
||||
public ToolDialogSettings NesPPUSettings = new ToolDialogSettings();
|
||||
public bool AutoLoadNESPPU = false;
|
||||
public int NESPPURefreshRate = 4;
|
||||
public bool NESPPUChrRomView = false;
|
||||
|
||||
// NES NameTableViewer Settings
|
||||
public ToolDialogSettings NesNameTableSettings = new ToolDialogSettings();
|
||||
public bool AutoLoadNESNameTable = false;
|
||||
public int NESNameTableRefreshRate = 4;
|
||||
|
||||
// SNES Graphics Debugger Dialog Settings
|
||||
public bool AutoLoadSNESGraphicsDebugger = false;
|
||||
public bool SNESGraphicsDebuggerSaveWindowPosition = true;
|
||||
|
|
|
@ -377,16 +377,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.Tools.Load<Cheats>();
|
||||
}
|
||||
|
||||
if (Global.Config.AutoLoadNESPPU)
|
||||
{
|
||||
GlobalWin.Tools.Load<NesPPU>();
|
||||
}
|
||||
|
||||
if (Global.Config.AutoLoadNESNameTable)
|
||||
{
|
||||
GlobalWin.Tools.Load<NESNameTableViewer>();
|
||||
}
|
||||
|
||||
if (Global.Config.NESGGAutoload)
|
||||
{
|
||||
GlobalWin.Tools.LoadGameGenieEc();
|
||||
|
|
|
@ -41,11 +41,6 @@
|
|||
this.ScreenshotToClipboardMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.OptionsSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.AutoloadMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.SaveWindowPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.FloatingWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.txtScanline = new System.Windows.Forms.TextBox();
|
||||
this.rbNametableNW = new System.Windows.Forms.RadioButton();
|
||||
this.rbNametableNE = new System.Windows.Forms.RadioButton();
|
||||
|
@ -136,8 +131,7 @@
|
|||
//
|
||||
this.menuStrip1.ClickThrough = true;
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.FileSubMenu,
|
||||
this.OptionsSubMenu});
|
||||
this.FileSubMenu});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(679, 24);
|
||||
|
@ -152,13 +146,13 @@
|
|||
this.toolStripSeparator2,
|
||||
this.ExitMenuItem});
|
||||
this.FileSubMenu.Name = "FileSubMenu";
|
||||
this.FileSubMenu.Size = new System.Drawing.Size(37, 20);
|
||||
this.FileSubMenu.Size = new System.Drawing.Size(35, 20);
|
||||
this.FileSubMenu.Text = "&File";
|
||||
//
|
||||
// ScreenshotMenuItem
|
||||
//
|
||||
this.ScreenshotMenuItem.Name = "ScreenshotMenuItem";
|
||||
this.ScreenshotMenuItem.Size = new System.Drawing.Size(243, 22);
|
||||
this.ScreenshotMenuItem.Size = new System.Drawing.Size(228, 22);
|
||||
this.ScreenshotMenuItem.Text = "Save Screenshot &As...";
|
||||
this.ScreenshotMenuItem.Click += new System.EventHandler(this.ScreenshotMenuItem_Click);
|
||||
//
|
||||
|
@ -166,63 +160,23 @@
|
|||
//
|
||||
this.ScreenshotToClipboardMenuItem.Name = "ScreenshotToClipboardMenuItem";
|
||||
this.ScreenshotToClipboardMenuItem.ShortcutKeyDisplayString = "Ctrl+C";
|
||||
this.ScreenshotToClipboardMenuItem.Size = new System.Drawing.Size(243, 22);
|
||||
this.ScreenshotToClipboardMenuItem.Size = new System.Drawing.Size(228, 22);
|
||||
this.ScreenshotToClipboardMenuItem.Text = "Screenshot to &Clipboard";
|
||||
this.ScreenshotToClipboardMenuItem.Click += new System.EventHandler(this.ScreenshotToClipboardMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(240, 6);
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(225, 6);
|
||||
//
|
||||
// ExitMenuItem
|
||||
//
|
||||
this.ExitMenuItem.Name = "ExitMenuItem";
|
||||
this.ExitMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
|
||||
this.ExitMenuItem.Size = new System.Drawing.Size(243, 22);
|
||||
this.ExitMenuItem.Size = new System.Drawing.Size(228, 22);
|
||||
this.ExitMenuItem.Text = "E&xit";
|
||||
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
|
||||
//
|
||||
// OptionsSubMenu
|
||||
//
|
||||
this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.AutoloadMenuItem,
|
||||
this.SaveWindowPositionMenuItem,
|
||||
this.AlwaysOnTopMenuItem,
|
||||
this.FloatingWindowMenuItem});
|
||||
this.OptionsSubMenu.Name = "OptionsSubMenu";
|
||||
this.OptionsSubMenu.Size = new System.Drawing.Size(61, 20);
|
||||
this.OptionsSubMenu.Text = "&Options";
|
||||
this.OptionsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened);
|
||||
//
|
||||
// AutoloadMenuItem
|
||||
//
|
||||
this.AutoloadMenuItem.Name = "AutoloadMenuItem";
|
||||
this.AutoloadMenuItem.Size = new System.Drawing.Size(191, 22);
|
||||
this.AutoloadMenuItem.Text = "Autoload";
|
||||
this.AutoloadMenuItem.Click += new System.EventHandler(this.AutoloadMenuItem_Click);
|
||||
//
|
||||
// SaveWindowPositionMenuItem
|
||||
//
|
||||
this.SaveWindowPositionMenuItem.Name = "SaveWindowPositionMenuItem";
|
||||
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(191, 22);
|
||||
this.SaveWindowPositionMenuItem.Text = "Save Window Position";
|
||||
this.SaveWindowPositionMenuItem.Click += new System.EventHandler(this.SaveWindowPositionMenuItem_Click);
|
||||
//
|
||||
// AlwaysOnTopMenuItem
|
||||
//
|
||||
this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem";
|
||||
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(191, 22);
|
||||
this.AlwaysOnTopMenuItem.Text = "Always On Top";
|
||||
this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
|
||||
//
|
||||
// FloatingWindowMenuItem
|
||||
//
|
||||
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
|
||||
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(191, 22);
|
||||
this.FloatingWindowMenuItem.Text = "Floating Window";
|
||||
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
|
||||
//
|
||||
// txtScanline
|
||||
//
|
||||
this.txtScanline.Location = new System.Drawing.Point(4, 19);
|
||||
|
@ -460,7 +414,7 @@
|
|||
this.RefreshRate.Minimum = 1;
|
||||
this.RefreshRate.Name = "RefreshRate";
|
||||
this.RefreshRate.Orientation = System.Windows.Forms.Orientation.Vertical;
|
||||
this.RefreshRate.Size = new System.Drawing.Size(45, 136);
|
||||
this.RefreshRate.Size = new System.Drawing.Size(42, 136);
|
||||
this.RefreshRate.TabIndex = 0;
|
||||
this.RefreshRate.TickFrequency = 4;
|
||||
this.RefreshRate.Value = 1;
|
||||
|
@ -508,9 +462,6 @@
|
|||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private NameTableViewer NameTableView;
|
||||
private MenuStripEx menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem OptionsSubMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem AutoloadMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem SaveWindowPositionMenuItem;
|
||||
private System.Windows.Forms.TextBox txtScanline;
|
||||
private System.Windows.Forms.RadioButton rbNametableNW;
|
||||
private System.Windows.Forms.RadioButton rbNametableNE;
|
||||
|
@ -544,7 +495,5 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem SaveImageClipboardMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem ScreenshotToClipboardMenuItem;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem AlwaysOnTopMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem;
|
||||
}
|
||||
}
|
|
@ -18,28 +18,22 @@ namespace BizHawk.Client.EmuHawk
|
|||
[RequiredService]
|
||||
private IEmulator _emu { get; set; }
|
||||
|
||||
[ConfigPersist]
|
||||
private int RefreshRateConfig
|
||||
{
|
||||
get { return RefreshRate.Value; }
|
||||
set { RefreshRate.Value = value; }
|
||||
}
|
||||
|
||||
int scanline;
|
||||
|
||||
public NESNameTableViewer()
|
||||
{
|
||||
InitializeComponent();
|
||||
Closing += (o, e) =>
|
||||
{
|
||||
Global.Config.NesNameTableSettings.Wndx = Location.X;
|
||||
Global.Config.NesNameTableSettings.Wndx = Location.Y;
|
||||
Global.Config.NESNameTableRefreshRate = RefreshRate.Value;
|
||||
};
|
||||
TopMost = Global.Config.NesNameTableSettings.TopMost;
|
||||
}
|
||||
|
||||
private void NESNameTableViewer_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (Global.Config.NesNameTableSettings.UseWindowPosition)
|
||||
{
|
||||
Location = Global.Config.NesNameTableSettings.WindowPosition;
|
||||
}
|
||||
|
||||
RefreshRate.Value = Global.Config.NESNameTableRefreshRate;
|
||||
Generate(true);
|
||||
}
|
||||
|
||||
|
@ -199,7 +193,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void RefreshFloatingWindowControl()
|
||||
{
|
||||
Owner = Global.Config.NesNameTableSettings.FloatingWindow ? null : GlobalWin.MainForm;
|
||||
}
|
||||
|
||||
#region Events
|
||||
|
@ -221,36 +214,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
Close();
|
||||
}
|
||||
|
||||
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
AutoloadMenuItem.Checked = Global.Config.AutoLoadNESNameTable;
|
||||
SaveWindowPositionMenuItem.Checked = Global.Config.NesNameTableSettings.SaveWindowPosition;
|
||||
AlwaysOnTopMenuItem.Checked = Global.Config.NesNameTableSettings.TopMost;
|
||||
FloatingWindowMenuItem.Checked = Global.Config.NesNameTableSettings.FloatingWindow;
|
||||
}
|
||||
|
||||
private void AutoloadMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.AutoLoadNESNameTable ^= true;
|
||||
}
|
||||
|
||||
private void SaveWindowPositionMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.NesNameTableSettings.SaveWindowPosition ^= true;
|
||||
}
|
||||
|
||||
private void AlwaysOnTopMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.NesNameTableSettings.TopMost ^= true;
|
||||
TopMost = Global.Config.NesNameTableSettings.TopMost;
|
||||
}
|
||||
|
||||
private void FloatingWindowMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.NesNameTableSettings.FloatingWindow ^= true;
|
||||
RefreshFloatingWindowControl();
|
||||
}
|
||||
|
||||
private void RefreshImageContextMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
UpdateValues();
|
||||
|
|
|
@ -126,7 +126,4 @@
|
|||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>281, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>281, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -97,18 +97,14 @@
|
|||
this.Table1P6MenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.Table1P7MenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.SettingsSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.AutoLoadMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.SaveWindowPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.FloatingWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cHRROMTileViewerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.NesPPUStatusBar = new StatusStripEx();
|
||||
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.Messagetimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.CHRROMGroup = new System.Windows.Forms.GroupBox();
|
||||
this.CHRROMView = new BizHawk.Client.EmuHawk.PatternViewer();
|
||||
this.numericUpDownCHRROMBank = new System.Windows.Forms.NumericUpDown();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.cHRROMTileViewerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.numericUpDownCHRROMBank = new System.Windows.Forms.NumericUpDown();
|
||||
this.CHRROMView = new BizHawk.Client.EmuHawk.PatternViewer();
|
||||
this.PatternGroup.SuspendLayout();
|
||||
this.PatternContext.SuspendLayout();
|
||||
this.PalettesGroup.SuspendLayout();
|
||||
|
@ -578,7 +574,7 @@
|
|||
this.Table0P6MenuItem,
|
||||
this.Table0P7MenuItem});
|
||||
this.Table0PaletteSubMenu.Name = "Table0PaletteSubMenu";
|
||||
this.Table0PaletteSubMenu.Size = new System.Drawing.Size(152, 22);
|
||||
this.Table0PaletteSubMenu.Size = new System.Drawing.Size(146, 22);
|
||||
this.Table0PaletteSubMenu.Text = "Table 0 Palette";
|
||||
this.Table0PaletteSubMenu.DropDownOpened += new System.EventHandler(this.Table0PaletteSubMenu_DropDownOpened);
|
||||
//
|
||||
|
@ -650,7 +646,7 @@
|
|||
this.Table1P6MenuItem,
|
||||
this.Table1P7MenuItem});
|
||||
this.Table1PaletteSubMenu.Name = "Table1PaletteSubMenu";
|
||||
this.Table1PaletteSubMenu.Size = new System.Drawing.Size(152, 22);
|
||||
this.Table1PaletteSubMenu.Size = new System.Drawing.Size(146, 22);
|
||||
this.Table1PaletteSubMenu.Text = "Table 1 Palette";
|
||||
this.Table1PaletteSubMenu.DropDownOpened += new System.EventHandler(this.Table1PaletteSubMenu_DropDownOpened);
|
||||
//
|
||||
|
@ -713,46 +709,22 @@
|
|||
// SettingsSubMenu
|
||||
//
|
||||
this.SettingsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.AutoLoadMenuItem,
|
||||
this.SaveWindowPositionMenuItem,
|
||||
this.AlwaysOnTopMenuItem,
|
||||
this.FloatingWindowMenuItem,
|
||||
this.cHRROMTileViewerToolStripMenuItem});
|
||||
this.SettingsSubMenu.Name = "SettingsSubMenu";
|
||||
this.SettingsSubMenu.Size = new System.Drawing.Size(58, 20);
|
||||
this.SettingsSubMenu.Text = "&Settings";
|
||||
this.SettingsSubMenu.DropDownOpened += new System.EventHandler(this.SettingsSubMenu_DropDownOpened);
|
||||
//
|
||||
// AutoLoadMenuItem
|
||||
// cHRROMTileViewerToolStripMenuItem
|
||||
//
|
||||
this.AutoLoadMenuItem.Name = "AutoLoadMenuItem";
|
||||
this.AutoLoadMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.AutoLoadMenuItem.Text = "Autoload";
|
||||
this.AutoLoadMenuItem.Click += new System.EventHandler(this.AutoloadMenuItem_Click);
|
||||
//
|
||||
// SaveWindowPositionMenuItem
|
||||
//
|
||||
this.SaveWindowPositionMenuItem.Name = "SaveWindowPositionMenuItem";
|
||||
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.SaveWindowPositionMenuItem.Text = "Save Window Position";
|
||||
this.SaveWindowPositionMenuItem.Click += new System.EventHandler(this.SaveWindowPositionMenuItem_Click);
|
||||
//
|
||||
// AlwaysOnTopMenuItem
|
||||
//
|
||||
this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem";
|
||||
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.AlwaysOnTopMenuItem.Text = "Always On Top";
|
||||
this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
|
||||
//
|
||||
// FloatingWindowMenuItem
|
||||
//
|
||||
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
|
||||
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.FloatingWindowMenuItem.Text = "Floating Window";
|
||||
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
|
||||
this.cHRROMTileViewerToolStripMenuItem.Name = "cHRROMTileViewerToolStripMenuItem";
|
||||
this.cHRROMTileViewerToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
|
||||
this.cHRROMTileViewerToolStripMenuItem.Text = "CHR ROM Tile Viewer";
|
||||
this.cHRROMTileViewerToolStripMenuItem.Click += new System.EventHandler(this.cHRROMTileViewerToolStripMenuItem_Click);
|
||||
//
|
||||
// NesPPUStatusBar
|
||||
//
|
||||
this.NesPPUStatusBar.ClickThrough = true;
|
||||
this.NesPPUStatusBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripStatusLabel1});
|
||||
this.NesPPUStatusBar.Location = new System.Drawing.Point(0, 349);
|
||||
|
@ -785,23 +757,6 @@
|
|||
this.CHRROMGroup.TabStop = false;
|
||||
this.CHRROMGroup.Text = "CHR ROM Tiles";
|
||||
//
|
||||
// CHRROMView
|
||||
//
|
||||
this.CHRROMView.BackColor = System.Drawing.Color.Transparent;
|
||||
this.CHRROMView.Location = new System.Drawing.Point(7, 20);
|
||||
this.CHRROMView.Name = "CHRROMView";
|
||||
this.CHRROMView.Size = new System.Drawing.Size(256, 128);
|
||||
this.CHRROMView.TabIndex = 0;
|
||||
this.CHRROMView.Text = "patternViewer1";
|
||||
//
|
||||
// numericUpDownCHRROMBank
|
||||
//
|
||||
this.numericUpDownCHRROMBank.Location = new System.Drawing.Point(47, 154);
|
||||
this.numericUpDownCHRROMBank.Name = "numericUpDownCHRROMBank";
|
||||
this.numericUpDownCHRROMBank.Size = new System.Drawing.Size(120, 20);
|
||||
this.numericUpDownCHRROMBank.TabIndex = 1;
|
||||
this.numericUpDownCHRROMBank.ValueChanged += new System.EventHandler(this.numericUpDownCHRROMBank_ValueChanged);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
|
@ -811,12 +766,22 @@
|
|||
this.label5.TabIndex = 2;
|
||||
this.label5.Text = "Bank:";
|
||||
//
|
||||
// cHRROMTileViewerToolStripMenuItem
|
||||
// numericUpDownCHRROMBank
|
||||
//
|
||||
this.cHRROMTileViewerToolStripMenuItem.Name = "cHRROMTileViewerToolStripMenuItem";
|
||||
this.cHRROMTileViewerToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.cHRROMTileViewerToolStripMenuItem.Text = "CHR ROM Tile Viewer";
|
||||
this.cHRROMTileViewerToolStripMenuItem.Click += new System.EventHandler(this.cHRROMTileViewerToolStripMenuItem_Click);
|
||||
this.numericUpDownCHRROMBank.Location = new System.Drawing.Point(47, 154);
|
||||
this.numericUpDownCHRROMBank.Name = "numericUpDownCHRROMBank";
|
||||
this.numericUpDownCHRROMBank.Size = new System.Drawing.Size(120, 20);
|
||||
this.numericUpDownCHRROMBank.TabIndex = 1;
|
||||
this.numericUpDownCHRROMBank.ValueChanged += new System.EventHandler(this.numericUpDownCHRROMBank_ValueChanged);
|
||||
//
|
||||
// CHRROMView
|
||||
//
|
||||
this.CHRROMView.BackColor = System.Drawing.Color.Transparent;
|
||||
this.CHRROMView.Location = new System.Drawing.Point(7, 20);
|
||||
this.CHRROMView.Name = "CHRROMView";
|
||||
this.CHRROMView.Size = new System.Drawing.Size(256, 128);
|
||||
this.CHRROMView.TabIndex = 0;
|
||||
this.CHRROMView.Text = "patternViewer1";
|
||||
//
|
||||
// NesPPU
|
||||
//
|
||||
|
@ -899,8 +864,6 @@
|
|||
private System.Windows.Forms.Label label3;
|
||||
private MenuStripEx NesPPUMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem SettingsSubMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem AutoLoadMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem SaveWindowPositionMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem PatternSubMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem Table0PaletteSubMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem Table0P0MenuItem;
|
||||
|
@ -945,8 +908,6 @@
|
|||
private StatusStripEx NesPPUStatusBar;
|
||||
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
|
||||
private System.Windows.Forms.Timer Messagetimer;
|
||||
private System.Windows.Forms.ToolStripMenuItem AlwaysOnTopMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem;
|
||||
private System.Windows.Forms.GroupBox CHRROMGroup;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDownCHRROMBank;
|
||||
|
|
|
@ -10,7 +10,7 @@ using System.Collections.Generic;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public partial class NesPPU : Form, IToolForm
|
||||
public partial class NesPPU : Form, IToolFormAutoConfig
|
||||
{
|
||||
// TODO:
|
||||
// If 8/16 sprite mode, mouse over should put 32x64 version of prite
|
||||
|
@ -30,24 +30,30 @@ namespace BizHawk.Client.EmuHawk
|
|||
[RequiredService]
|
||||
private IEmulator _emu { get; set; }
|
||||
|
||||
[ConfigPersist]
|
||||
private int RefreshRateConfig
|
||||
{
|
||||
get { return RefreshRate.Value; }
|
||||
set { RefreshRate.Value = value; }
|
||||
}
|
||||
|
||||
private bool _chrromview = false;
|
||||
[ConfigPersist]
|
||||
private bool ChrRomView
|
||||
{
|
||||
get { return _chrromview; }
|
||||
set { _chrromview = value; CalculateFormSize(); }
|
||||
}
|
||||
|
||||
public NesPPU()
|
||||
{
|
||||
InitializeComponent();
|
||||
Closing += (o, e) =>
|
||||
{
|
||||
Global.Config.NesPPUSettings.Wndx = Location.X;
|
||||
Global.Config.NesPPUSettings.Wndy = Location.Y;
|
||||
Global.Config.NESPPURefreshRate = RefreshRate.Value;
|
||||
};
|
||||
TopMost = Global.Config.NesPPUSettings.TopMost;
|
||||
CalculateFormSize();
|
||||
}
|
||||
|
||||
private void NesPPU_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadConfigSettings();
|
||||
ClearDetails();
|
||||
RefreshRate.Value = Global.Config.NESPPURefreshRate;
|
||||
Generate(true);
|
||||
CHRROMViewReload();
|
||||
}
|
||||
|
@ -75,14 +81,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#endregion
|
||||
|
||||
private void LoadConfigSettings()
|
||||
{
|
||||
if (Global.Config.NesPPUSettings.UseWindowPosition)
|
||||
{
|
||||
Location = Global.Config.NesPPUSettings.WindowPosition;
|
||||
}
|
||||
}
|
||||
|
||||
private byte GetBit(byte[] PPUBus, int address, int bit)
|
||||
{
|
||||
return (byte)((PPUBus[address] >> (7 - bit)) & 1);
|
||||
|
@ -326,7 +324,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void RefreshFloatingWindowControl()
|
||||
{
|
||||
Owner = Global.Config.NesPPUSettings.FloatingWindow ? null : GlobalWin.MainForm;
|
||||
}
|
||||
|
||||
#region Events
|
||||
|
@ -474,33 +471,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SettingsSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
AutoLoadMenuItem.Checked = Global.Config.AutoLoadNESPPU;
|
||||
SaveWindowPositionMenuItem.Checked = Global.Config.NesPPUSettings.SaveWindowPosition;
|
||||
AlwaysOnTopMenuItem.Checked = Global.Config.NesPPUSettings.TopMost;
|
||||
FloatingWindowMenuItem.Checked = Global.Config.NesPPUSettings.FloatingWindow;
|
||||
cHRROMTileViewerToolStripMenuItem.Checked = Global.Config.NESPPUChrRomView;
|
||||
}
|
||||
|
||||
private void AutoloadMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.AutoLoadNESPPU ^= true;
|
||||
}
|
||||
|
||||
private void SaveWindowPositionMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.NesPPUSettings.SaveWindowPosition ^= true;
|
||||
}
|
||||
|
||||
private void AlwaysOnTopMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.NesPPUSettings.TopMost ^= true;
|
||||
TopMost = Global.Config.NesPPUSettings.TopMost;
|
||||
}
|
||||
|
||||
private void FloatingWindowMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.NesPPUSettings.FloatingWindow ^= true;
|
||||
RefreshFloatingWindowControl();
|
||||
cHRROMTileViewerToolStripMenuItem.Checked = ChrRomView;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -838,13 +809,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void cHRROMTileViewerToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.NESPPUChrRomView ^= true;
|
||||
CalculateFormSize();
|
||||
ChrRomView ^= true;
|
||||
}
|
||||
|
||||
private void CalculateFormSize()
|
||||
{
|
||||
Width = Global.Config.NESPPUChrRomView ? 861 : 580;
|
||||
Width = ChrRomView ? 861 : 580;
|
||||
}
|
||||
|
||||
private void CHRROMViewReload()
|
||||
|
|
|
@ -229,6 +229,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
var converter = TypeDescriptor.GetConverter(prop.PropertyType);
|
||||
val = converter.ConvertFromString((string)val);
|
||||
}
|
||||
else if (!(val is bool) && prop.PropertyType.IsPrimitive)
|
||||
{
|
||||
// numeric constanst are similarly hosed
|
||||
val = Convert.ChangeType(val, prop.PropertyType);
|
||||
}
|
||||
prop.SetValue(tool, val, null);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue