Gensis Game Geneie Encoder/Decoder - convert to IToolFormAutoConfig, fix a bug that would have made it never be available, make it available on non-interm builds (I think the issue keeping it unreleased was a core endian issue that was resolved), add a menu item for it in the Genesis menu

This commit is contained in:
adelikat 2015-01-01 19:02:00 +00:00
parent 93fe387311
commit bb5b20cc33
7 changed files with 355 additions and 486 deletions

View File

@ -344,11 +344,6 @@ namespace BizHawk.Client.Common
// GB/GG Game Genie Encoder/Decoder
public ToolDialogSettings GbGGSettings = new ToolDialogSettings();
public bool GBGGAutoload = false;
// GEN Game Genie Encoder/Decoder
public ToolDialogSettings GenGGSettings = new ToolDialogSettings();
public bool GenGGAutoload = false;
// Movie Settings
public RecentFiles RecentMovies = new RecentFiles(8);

File diff suppressed because it is too large Load Diff

View File

@ -1905,6 +1905,11 @@ namespace BizHawk.Client.EmuHawk
GenericCoreConfig.DoDialog(this, "Genesis Settings");
}
private void GenesisGameGenieECDC_Click(object sender, EventArgs e)
{
GlobalWin.Tools.Load<GenGameGenie>();
}
#endregion
#region Wondersawn

View File

@ -3648,9 +3648,5 @@ namespace BizHawk.Client.EmuHawk
{
FeaturesMenuItem.Visible = VersionInfo.DeveloperBuild;
}
}
}

View File

@ -29,11 +29,6 @@
private void InitializeComponent()
{
this.menuStrip1 = new MenuStripEx();
this.OptionsSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.AutoloadMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SaveWindowPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.GGCodeMaskBox = new System.Windows.Forms.MaskedTextBox();
this.AddCheatButton = new System.Windows.Forms.Button();
this.GameGenieCodeBox = new System.Windows.Forms.GroupBox();
@ -47,9 +42,6 @@
this.ClearButton = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.cheatname = new System.Windows.Forms.TextBox();
this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.FloatingWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.GameGenieCodeBox.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
@ -58,55 +50,12 @@
// menuStrip1
//
this.menuStrip1.ClickThrough = true;
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.OptionsSubMenu});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(292, 24);
this.menuStrip1.TabIndex = 8;
this.menuStrip1.Text = "menuStrip1";
//
// OptionsSubMenu
//
this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.AutoloadMenuItem,
this.SaveWindowPositionMenuItem,
this.AlwaysOnTopMenuItem,
this.FloatingWindowMenuItem,
this.toolStripSeparator1,
this.ExitMenuItem});
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);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(188, 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(191, 22);
this.ExitMenuItem.Text = "E&xit";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
// GGCodeMaskBox
//
this.GGCodeMaskBox.Location = new System.Drawing.Point(18, 30);
@ -259,20 +208,6 @@
this.cheatname.Size = new System.Drawing.Size(228, 20);
this.cheatname.TabIndex = 0;
//
// 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);
//
// GenGameGenie
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -295,8 +230,6 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Genesis Game Genie Encoder / Decoder";
this.Load += new System.EventHandler(this.GenGameGenie_Load);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.GameGenieCodeBox.ResumeLayout(false);
this.GameGenieCodeBox.PerformLayout();
this.groupBox1.ResumeLayout(false);
@ -311,11 +244,6 @@
#endregion
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.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem ExitMenuItem;
private System.Windows.Forms.MaskedTextBox GGCodeMaskBox;
private System.Windows.Forms.Button AddCheatButton;
private System.Windows.Forms.GroupBox GameGenieCodeBox;
@ -329,7 +257,5 @@
private HexTextBox AddressBox;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox cheatname;
private System.Windows.Forms.ToolStripMenuItem AlwaysOnTopMenuItem;
private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem;
}
}

View File

@ -10,14 +10,16 @@ using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
public partial class GenGameGenie : Form, IToolForm
public partial class GenGameGenie : Form, IToolFormAutoConfig
{
#pragma warning disable 675
#pragma warning disable 675
[RequiredService]
private IEmulator Emulator { get; set; }
[RequiredService]
private MemoryDomainList MemoryDomains { get; set; }
private IMemoryDomains MemoryDomainService { get; set; }
private MemoryDomainList MemoryDomains { get { return MemoryDomainService.MemoryDomains; } }
private readonly Dictionary<char, int> _gameGenieTable = new Dictionary<char, int>
{
@ -59,10 +61,7 @@ namespace BizHawk.Client.EmuHawk
private void GenGameGenie_Load(object sender, EventArgs e)
{
if (Global.Config.GenGGSettings.UseWindowPosition)
{
Location = Global.Config.GenGGSettings.WindowPosition;
}
}
#region Public API
@ -95,8 +94,6 @@ namespace BizHawk.Client.EmuHawk
public GenGameGenie()
{
InitializeComponent();
Closing += (o, e) => SaveConfigSettings();
TopMost = Global.Config.GenGGSettings.TopMost;
}
#endregion
@ -152,59 +149,7 @@ namespace BizHawk.Client.EmuHawk
return new string(array);
}
private void SaveConfigSettings()
{
Global.Config.GenGGSettings.Wndx = Location.X;
Global.Config.GenGGSettings.Wndy = Location.Y;
}
private void RefreshFloatingWindowControl()
{
Owner = Global.Config.GenGGSettings.FloatingWindow ? null : GlobalWin.MainForm;
}
#region Events
#region Menu
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
{
AutoloadMenuItem.Checked = Global.Config.GenGGAutoload;
SaveWindowPositionMenuItem.Checked = Global.Config.GenGGSettings.SaveWindowPosition;
AlwaysOnTopMenuItem.Checked = Global.Config.GenGGSettings.TopMost;
FloatingWindowMenuItem.Checked = Global.Config.GenGGSettings.FloatingWindow;
}
private void AutoloadMenuItem_Click(object sender, EventArgs e)
{
Global.Config.GenGGAutoload ^= true;
}
private void SaveWindowPositionMenuItem_Click(object sender, EventArgs e)
{
Global.Config.GenGGSettings.SaveWindowPosition ^= true;
}
private void AlwaysOnTopMenuItem_Click(object sender, EventArgs e)
{
Global.Config.GenGGSettings.TopMost ^= true;
TopMost = Global.Config.GenGGSettings.TopMost;
}
private void FloatingWindowMenuItem_Click(object sender, EventArgs e)
{
Global.Config.GenGGSettings.FloatingWindow ^= true;
RefreshFloatingWindowControl();
}
private void ExitMenuItem_Click(object sender, EventArgs e)
{
Close();
}
#endregion
#region Dialog and Controls
#region Dialog and Control Events
private void GGCodeMaskBox_KeyPress(object sender, KeyPressEventArgs e)
{
@ -377,14 +322,6 @@ namespace BizHawk.Client.EmuHawk
));
}
protected override void OnShown(EventArgs e)
{
RefreshFloatingWindowControl();
base.OnShown(e);
}
#endregion
#endregion
}
}

View File

@ -551,7 +551,7 @@ namespace BizHawk.Client.EmuHawk
get
{
return (Global.Emulator.SystemId == "NES")
|| (Global.Emulator.SystemId == "GEN" && VersionInfo.DeveloperBuild)
|| (Global.Emulator.SystemId == "GEN")
|| (Global.Emulator.SystemId == "GB")
|| (Global.Game.System == "GG")
|| (Global.Emulator is BizHawk.Emulation.Cores.Nintendo.SNES.LibsnesCore);