Add an Experimental Tools submenu that only shows in Developer Builds and move autohawk there. Add a NewHexEditor tool (in the experimental section), which is currently just a bare bones winform with all the necessary plumbing set up

This commit is contained in:
adelikat 2015-12-23 21:11:25 -05:00
parent f0c939d87c
commit d470703a40
6 changed files with 368 additions and 45 deletions

View File

@ -807,6 +807,12 @@
<Compile Include="tools\HexEditor\HexFind.Designer.cs">
<DependentUpon>HexFind.cs</DependentUpon>
</Compile>
<Compile Include="tools\HexEditor\NewHexEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="tools\HexEditor\NewHexEditor.Designer.cs">
<DependentUpon>NewHexEditor.cs</DependentUpon>
</Compile>
<Compile Include="tools\Lua\EnvironmentSandbox.cs" />
<Compile Include="tools\Lua\Libraries\EmuLuaLibrary.Client.cs" />
<Compile Include="tools\Lua\Libraries\EmuLuaLibrary.Console.cs" />
@ -1421,6 +1427,9 @@
<EmbeddedResource Include="tools\HexEditor\HexFind.resx">
<DependentUpon>HexFind.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\HexEditor\NewHexEditor.resx">
<DependentUpon>NewHexEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\Lua\LuaCanvas.resx">
<DependentUpon>LuaCanvas.cs</DependentUpon>
</EmbeddedResource>

View File

@ -204,17 +204,19 @@
this.TAStudioMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MacroToolMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.VirtualPadMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.AutoHawkMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.BasicBotMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.LuaConsoleMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.CheatsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.LuaConsoleMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.externalToolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dummyExternalTool = new System.Windows.Forms.ToolStripMenuItem();
this.gameSharkConverterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator29 = new System.Windows.Forms.ToolStripSeparator();
this.MultiDiskBundlerFileMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gameSharkConverterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.externalToolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dummyExternalTool = new System.Windows.Forms.ToolStripMenuItem();
this.batchRunnerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ExperimentalToolsSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.AutoHawkMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.NewHexEditorMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.NESSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.coreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.quickNESToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -1852,7 +1854,6 @@
this.TAStudioMenuItem,
this.MacroToolMenuItem,
this.VirtualPadMenuItem,
this.AutoHawkMenuItem,
this.BasicBotMenuItem,
this.LuaConsoleMenuItem,
this.toolStripSeparator11,
@ -1861,7 +1862,8 @@
this.toolStripSeparator29,
this.MultiDiskBundlerFileMenuItem,
this.externalToolToolStripMenuItem,
this.batchRunnerToolStripMenuItem});
this.batchRunnerToolStripMenuItem,
this.ExperimentalToolsSubMenu});
this.ToolsSubMenu.Name = "ToolsSubMenu";
this.ToolsSubMenu.Size = new System.Drawing.Size(47, 19);
this.ToolsSubMenu.Text = "&Tools";
@ -1951,13 +1953,6 @@
this.VirtualPadMenuItem.Text = "Virtual Pad";
this.VirtualPadMenuItem.Click += new System.EventHandler(this.VirtualPadMenuItem_Click);
//
// AutoHawkMenuItem
//
this.AutoHawkMenuItem.Name = "AutoHawkMenuItem";
this.AutoHawkMenuItem.Size = new System.Drawing.Size(189, 22);
this.AutoHawkMenuItem.Text = "AutoHawk";
this.AutoHawkMenuItem.Click += new System.EventHandler(this.AutoHawkMenuItem_Click);
//
// BasicBotMenuItem
//
this.BasicBotMenuItem.Name = "BasicBotMenuItem";
@ -1965,6 +1960,14 @@
this.BasicBotMenuItem.Text = "Basic Bot";
this.BasicBotMenuItem.Click += new System.EventHandler(this.BasicBotMenuItem_Click);
//
// LuaConsoleMenuItem
//
this.LuaConsoleMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Lua;
this.LuaConsoleMenuItem.Name = "LuaConsoleMenuItem";
this.LuaConsoleMenuItem.Size = new System.Drawing.Size(189, 22);
this.LuaConsoleMenuItem.Text = "Lua Console";
this.LuaConsoleMenuItem.Click += new System.EventHandler(this.LuaConsoleMenuItem_Click);
//
// toolStripSeparator11
//
this.toolStripSeparator11.Name = "toolStripSeparator11";
@ -1978,28 +1981,13 @@
this.CheatsMenuItem.Text = "Cheats";
this.CheatsMenuItem.Click += new System.EventHandler(this.CheatsMenuItem_Click);
//
// LuaConsoleMenuItem
// gameSharkConverterToolStripMenuItem
//
this.LuaConsoleMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Lua;
this.LuaConsoleMenuItem.Name = "LuaConsoleMenuItem";
this.LuaConsoleMenuItem.Size = new System.Drawing.Size(189, 22);
this.LuaConsoleMenuItem.Text = "Lua Console";
this.LuaConsoleMenuItem.Click += new System.EventHandler(this.LuaConsoleMenuItem_Click);
//
// externalToolToolStripMenuItem
//
this.externalToolToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.dummyExternalTool});
this.externalToolToolStripMenuItem.Name = "externalToolToolStripMenuItem";
this.externalToolToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
this.externalToolToolStripMenuItem.Text = "External Tool";
this.externalToolToolStripMenuItem.DropDownOpening += new System.EventHandler(this.ExternalToolToolStripMenuItem_DropDownOpening);
//
// dummyExternalTool
//
this.dummyExternalTool.Name = "dummyExternalTool";
this.dummyExternalTool.Size = new System.Drawing.Size(152, 22);
this.dummyExternalTool.Text = "None";
this.gameSharkConverterToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("gameSharkConverterToolStripMenuItem.Image")));
this.gameSharkConverterToolStripMenuItem.Name = "gameSharkConverterToolStripMenuItem";
this.gameSharkConverterToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
this.gameSharkConverterToolStripMenuItem.Text = "GameShark Converter";
this.gameSharkConverterToolStripMenuItem.Click += new System.EventHandler(this.gameSharkConverterToolStripMenuItem_Click);
//
// toolStripSeparator29
//
@ -2014,13 +2002,20 @@
this.MultiDiskBundlerFileMenuItem.Text = "Multi-disk Bundler";
this.MultiDiskBundlerFileMenuItem.Click += new System.EventHandler(this.CreateMultigameFileMenuItem_Click);
//
// gameSharkConverterToolStripMenuItem
// externalToolToolStripMenuItem
//
this.gameSharkConverterToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("gameSharkConverterToolStripMenuItem.Image")));
this.gameSharkConverterToolStripMenuItem.Name = "gameSharkConverterToolStripMenuItem";
this.gameSharkConverterToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
this.gameSharkConverterToolStripMenuItem.Text = "GameShark Converter";
this.gameSharkConverterToolStripMenuItem.Click += new System.EventHandler(this.gameSharkConverterToolStripMenuItem_Click);
this.externalToolToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.dummyExternalTool});
this.externalToolToolStripMenuItem.Name = "externalToolToolStripMenuItem";
this.externalToolToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
this.externalToolToolStripMenuItem.Text = "External Tool";
this.externalToolToolStripMenuItem.DropDownOpening += new System.EventHandler(this.ExternalToolToolStripMenuItem_DropDownOpening);
//
// dummyExternalTool
//
this.dummyExternalTool.Name = "dummyExternalTool";
this.dummyExternalTool.Size = new System.Drawing.Size(103, 22);
this.dummyExternalTool.Text = "None";
//
// batchRunnerToolStripMenuItem
//
@ -2030,6 +2025,28 @@
this.batchRunnerToolStripMenuItem.Visible = false;
this.batchRunnerToolStripMenuItem.Click += new System.EventHandler(this.batchRunnerToolStripMenuItem_Click);
//
// ExperimentalToolsSubMenu
//
this.ExperimentalToolsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.AutoHawkMenuItem,
this.NewHexEditorMenuItem});
this.ExperimentalToolsSubMenu.Name = "ExperimentalToolsSubMenu";
this.ExperimentalToolsSubMenu.Size = new System.Drawing.Size(189, 22);
this.ExperimentalToolsSubMenu.Text = "Experimental Tools";
this.ExperimentalToolsSubMenu.DropDownOpened += new System.EventHandler(this.ExperimentalToolsSubMenu_DropDownOpened);
//
// AutoHawkMenuItem
//
this.AutoHawkMenuItem.Name = "AutoHawkMenuItem";
this.AutoHawkMenuItem.Size = new System.Drawing.Size(155, 22);
this.AutoHawkMenuItem.Text = "AutoHawk";
//
// NewHexEditorMenuItem
//
this.NewHexEditorMenuItem.Name = "NewHexEditorMenuItem";
this.NewHexEditorMenuItem.Size = new System.Drawing.Size(155, 22);
this.NewHexEditorMenuItem.Text = "New Hex Editor";
//
// NESSubMenu
//
this.NESSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -4033,7 +4050,6 @@
private System.Windows.Forms.ToolStripMenuItem GBAmGBAMenuItem;
private System.Windows.Forms.ToolStripMenuItem GBAVBANextMenuItem;
private System.Windows.Forms.ToolStripMenuItem gBAWithMGBAToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem AutoHawkMenuItem;
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem PSXHashDiscsToolStripMenuItem;
private System.Windows.Forms.Timer timerMouseIdle;
@ -4060,5 +4076,8 @@
private System.Windows.Forms.ToolStripMenuItem gameSharkConverterToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem dummyExternalTool;
private System.Windows.Forms.ToolStripMenuItem RecordAVMenuItem;
private System.Windows.Forms.ToolStripMenuItem ExperimentalToolsSubMenu;
private System.Windows.Forms.ToolStripMenuItem AutoHawkMenuItem;
private System.Windows.Forms.ToolStripMenuItem NewHexEditorMenuItem;
}
}

View File

@ -1260,12 +1260,11 @@ namespace BizHawk.Client.EmuHawk
batchRunnerToolStripMenuItem.Visible = VersionInfo.DeveloperBuild;
AutoHawkMenuItem.Enabled = GlobalWin.Tools.IsAvailable<AutoHawk>();
AutoHawkMenuItem.Visible = VersionInfo.DeveloperBuild;
BasicBotMenuItem.Enabled = GlobalWin.Tools.IsAvailable<BasicBot>();
gameSharkConverterToolStripMenuItem.Enabled = GlobalWin.Tools.IsAvailable<GameShark>();
ExperimentalToolsSubMenu.Visible = VersionInfo.DeveloperBuild;
}
private void ExternalToolToolStripMenuItem_DropDownOpening(object sender, EventArgs e)
@ -1294,6 +1293,12 @@ namespace BizHawk.Client.EmuHawk
}
}
private void ExperimentalToolsSubMenu_DropDownOpened(object sender, EventArgs e)
{
AutoHawkMenuItem.Enabled = GlobalWin.Tools.IsAvailable<AutoHawk>();
NewHexEditorMenuItem.Enabled = GlobalWin.Tools.IsAvailable<NewHexEditor>();
}
private void AutoHawkMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.Tools.Load<AutoHawk>();

View File

@ -0,0 +1,87 @@
namespace BizHawk.Client.EmuHawk
{
partial class NewHexEditor
{
/// <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.HexMenu = new System.Windows.Forms.MenuStrip();
this.FileSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.HexMenu.SuspendLayout();
this.SuspendLayout();
//
// HexMenu
//
this.HexMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.FileSubMenu});
this.HexMenu.Location = new System.Drawing.Point(0, 0);
this.HexMenu.Name = "HexMenu";
this.HexMenu.Size = new System.Drawing.Size(284, 24);
this.HexMenu.TabIndex = 0;
this.HexMenu.Text = "menuStrip1";
//
// FileSubMenu
//
this.FileSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ExitMenuItem});
this.FileSubMenu.Name = "FileSubMenu";
this.FileSubMenu.Size = new System.Drawing.Size(37, 20);
this.FileSubMenu.Text = "&File";
this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened);
//
// ExitMenuItem
//
this.ExitMenuItem.Name = "ExitMenuItem";
this.ExitMenuItem.ShortcutKeyDisplayString = "Alt+F4";
this.ExitMenuItem.Size = new System.Drawing.Size(152, 22);
this.ExitMenuItem.Text = "E&xit";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
// NewHexEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261);
this.Controls.Add(this.HexMenu);
this.MainMenuStrip = this.HexMenu;
this.Name = "NewHexEditor";
this.Text = "NewHexEditor";
this.Load += new System.EventHandler(this.NewHexEditor_Load);
this.HexMenu.ResumeLayout(false);
this.HexMenu.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.MenuStrip HexMenu;
private System.Windows.Forms.ToolStripMenuItem FileSubMenu;
private System.Windows.Forms.ToolStripMenuItem ExitMenuItem;
}
}

View File

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk
{
public partial class NewHexEditor : Form, IToolFormAutoConfig
{
#region Initialize and Dependencies
[RequiredService]
private IMemoryDomains MemoryDomains { get; set; }
[RequiredService]
private IEmulator Emulator { get; set; }
public NewHexEditor()
{
InitializeComponent();
Closing += (o, e) => SaveConfigSettings();
}
private void NewHexEditor_Load(object sender, EventArgs e)
{
}
private void SaveConfigSettings()
{
}
#endregion
#region IToolForm implementation
public void UpdateValues()
{
// TODO
}
public void FastUpdate()
{
// TODO
}
public void Restart()
{
// TODO
}
public bool AskSaveChanges()
{
return true; // TODO
}
public bool UpdateBefore { get { return false; } }
#endregion
#region Menu Items
private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{
}
private void ExitMenuItem_Click(object sender, EventArgs e)
{
Close();
}
#endregion
}
}

View File

@ -0,0 +1,123 @@
<?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>
<metadata name="HexMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>