Hex Editor - add a save as binary option (in addition to the text option)
This commit is contained in:
parent
bac863aa70
commit
81198cc89f
|
@ -751,6 +751,7 @@
|
||||||
<None Include="images\Import.png" />
|
<None Include="images\Import.png" />
|
||||||
<None Include="images\atari_controller.png" />
|
<None Include="images\atari_controller.png" />
|
||||||
<Content Include="images\logo.ico" />
|
<Content Include="images\logo.ico" />
|
||||||
|
<None Include="images\Paste.png" />
|
||||||
<Content Include="output\gamedb.txt" />
|
<Content Include="output\gamedb.txt" />
|
||||||
<Content Include="output\gamedb_neshomebrew.txt" />
|
<Content Include="output\gamedb_neshomebrew.txt" />
|
||||||
<Content Include="output\gamedb_pce_cd.txt" />
|
<Content Include="output\gamedb_pce_cd.txt" />
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.1
|
// Runtime Version:4.0.30319.269
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
|
@ -444,6 +444,13 @@ namespace BizHawk.MultiClient.Properties {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static System.Drawing.Bitmap Paste {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Paste", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal static System.Drawing.Bitmap Pause {
|
internal static System.Drawing.Bitmap Pause {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("Pause", resourceCulture);
|
object obj = ResourceManager.GetObject("Pause", resourceCulture);
|
||||||
|
|
|
@ -819,4 +819,7 @@
|
||||||
<data name="TurboFastForward" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="TurboFastForward" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\images\TurboFastForward.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\images\TurboFastForward.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Paste" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\images\Paste.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
Binary file not shown.
After Width: | Height: | Size: 730 B |
|
@ -33,11 +33,13 @@
|
||||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.dumpToFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.dumpToFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.saveAsBinaryToolStripMenuItem = 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.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.findToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
this.findToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.memoryDomainsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.memoryDomainsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
@ -68,7 +70,6 @@
|
||||||
this.MemoryViewerBox = new System.Windows.Forms.GroupBox();
|
this.MemoryViewerBox = new System.Windows.Forms.GroupBox();
|
||||||
this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
|
this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
|
||||||
this.AddressesLabel = new System.Windows.Forms.Label();
|
this.AddressesLabel = new System.Windows.Forms.Label();
|
||||||
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
|
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.ViewerContextMenuStrip.SuspendLayout();
|
this.ViewerContextMenuStrip.SuspendLayout();
|
||||||
this.MemoryViewerBox.SuspendLayout();
|
this.MemoryViewerBox.SuspendLayout();
|
||||||
|
@ -91,6 +92,7 @@
|
||||||
//
|
//
|
||||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.dumpToFileToolStripMenuItem,
|
this.dumpToFileToolStripMenuItem,
|
||||||
|
this.saveAsBinaryToolStripMenuItem,
|
||||||
this.toolStripSeparator1,
|
this.toolStripSeparator1,
|
||||||
this.exitToolStripMenuItem});
|
this.exitToolStripMenuItem});
|
||||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||||
|
@ -99,22 +101,28 @@
|
||||||
//
|
//
|
||||||
// dumpToFileToolStripMenuItem
|
// dumpToFileToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.dumpToFileToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.SaveAs;
|
|
||||||
this.dumpToFileToolStripMenuItem.Name = "dumpToFileToolStripMenuItem";
|
this.dumpToFileToolStripMenuItem.Name = "dumpToFileToolStripMenuItem";
|
||||||
this.dumpToFileToolStripMenuItem.Size = new System.Drawing.Size(149, 22);
|
this.dumpToFileToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
|
||||||
this.dumpToFileToolStripMenuItem.Text = "&Dump to file...";
|
this.dumpToFileToolStripMenuItem.Text = "Save as text...";
|
||||||
this.dumpToFileToolStripMenuItem.Click += new System.EventHandler(this.dumpToFileToolStripMenuItem_Click);
|
this.dumpToFileToolStripMenuItem.Click += new System.EventHandler(this.dumpToFileToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// saveAsBinaryToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.saveAsBinaryToolStripMenuItem.Name = "saveAsBinaryToolStripMenuItem";
|
||||||
|
this.saveAsBinaryToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
|
||||||
|
this.saveAsBinaryToolStripMenuItem.Text = "Save as binary...";
|
||||||
|
this.saveAsBinaryToolStripMenuItem.Click += new System.EventHandler(this.saveAsBinaryToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// toolStripSeparator1
|
// toolStripSeparator1
|
||||||
//
|
//
|
||||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||||
this.toolStripSeparator1.Size = new System.Drawing.Size(146, 6);
|
this.toolStripSeparator1.Size = new System.Drawing.Size(154, 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(149, 22);
|
this.exitToolStripMenuItem.Size = new System.Drawing.Size(157, 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);
|
||||||
//
|
//
|
||||||
|
@ -131,6 +139,7 @@
|
||||||
//
|
//
|
||||||
// copyToolStripMenuItem
|
// copyToolStripMenuItem
|
||||||
//
|
//
|
||||||
|
this.copyToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Duplicate;
|
||||||
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
|
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
|
||||||
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
|
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
|
||||||
this.copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
this.copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||||
|
@ -139,12 +148,18 @@
|
||||||
//
|
//
|
||||||
// pasteToolStripMenuItem
|
// pasteToolStripMenuItem
|
||||||
//
|
//
|
||||||
|
this.pasteToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Paste;
|
||||||
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
|
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
|
||||||
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
|
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
|
||||||
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||||
this.pasteToolStripMenuItem.Text = "&Paste";
|
this.pasteToolStripMenuItem.Text = "&Paste";
|
||||||
this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click);
|
this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// toolStripSeparator6
|
||||||
|
//
|
||||||
|
this.toolStripSeparator6.Name = "toolStripSeparator6";
|
||||||
|
this.toolStripSeparator6.Size = new System.Drawing.Size(149, 6);
|
||||||
|
//
|
||||||
// findToolStripMenuItem1
|
// findToolStripMenuItem1
|
||||||
//
|
//
|
||||||
this.findToolStripMenuItem1.Name = "findToolStripMenuItem1";
|
this.findToolStripMenuItem1.Name = "findToolStripMenuItem1";
|
||||||
|
@ -411,11 +426,6 @@
|
||||||
this.AddressesLabel.MouseLeave += new System.EventHandler(this.AddressesLabel_MouseLeave);
|
this.AddressesLabel.MouseLeave += new System.EventHandler(this.AddressesLabel_MouseLeave);
|
||||||
this.AddressesLabel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.AddressesLabel_MouseMove);
|
this.AddressesLabel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.AddressesLabel_MouseMove);
|
||||||
//
|
//
|
||||||
// toolStripSeparator6
|
|
||||||
//
|
|
||||||
this.toolStripSeparator6.Name = "toolStripSeparator6";
|
|
||||||
this.toolStripSeparator6.Size = new System.Drawing.Size(149, 6);
|
|
||||||
//
|
|
||||||
// HexEditor
|
// HexEditor
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
@ -485,5 +495,6 @@
|
||||||
private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem1;
|
private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem1;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem saveAsBinaryToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -750,10 +750,10 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private void dumpToFileToolStripMenuItem_Click(object sender, EventArgs e)
|
private void dumpToFileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SaveAs();
|
SaveAsText();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveAs()
|
private void SaveAsText()
|
||||||
{
|
{
|
||||||
var file = GetSaveFileFromUser();
|
var file = GetSaveFileFromUser();
|
||||||
if (file != null)
|
if (file != null)
|
||||||
|
@ -776,6 +776,23 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SaveAsBinary()
|
||||||
|
{
|
||||||
|
var file = GetBinarySaveFileFromUser();
|
||||||
|
if (file != null)
|
||||||
|
{
|
||||||
|
using(BinaryWriter binWriter = new BinaryWriter(File.Open(file.FullName, FileMode.Create)))
|
||||||
|
{
|
||||||
|
byte[] dump = new byte[Domain.Size];
|
||||||
|
|
||||||
|
for (int x = 0; x < Domain.Size; x++)
|
||||||
|
{
|
||||||
|
binWriter.Write(Domain.PeekByte(x));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private FileInfo GetSaveFileFromUser()
|
private FileInfo GetSaveFileFromUser()
|
||||||
{
|
{
|
||||||
var sfd = new SaveFileDialog();
|
var sfd = new SaveFileDialog();
|
||||||
|
@ -799,6 +816,29 @@ namespace BizHawk.MultiClient
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private FileInfo GetBinarySaveFileFromUser()
|
||||||
|
{
|
||||||
|
var sfd = new SaveFileDialog();
|
||||||
|
|
||||||
|
if (!(Global.Emulator is NullEmulator))
|
||||||
|
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
|
||||||
|
else
|
||||||
|
sfd.FileName = "MemoryDump";
|
||||||
|
|
||||||
|
|
||||||
|
sfd.InitialDirectory = PathManager.GetPlatformBase(Global.Emulator.SystemId);
|
||||||
|
|
||||||
|
sfd.Filter = "Binary (*.bin)|*.bin|All Files|*.*";
|
||||||
|
sfd.RestoreDirectory = true;
|
||||||
|
Global.Sound.StopSound();
|
||||||
|
var result = sfd.ShowDialog();
|
||||||
|
Global.Sound.StartSound();
|
||||||
|
if (result != DialogResult.OK)
|
||||||
|
return null;
|
||||||
|
var file = new FileInfo(sfd.FileName);
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
public void ResetScrollBar()
|
public void ResetScrollBar()
|
||||||
{
|
{
|
||||||
vScrollBar1.Value = 0;
|
vScrollBar1.Value = 0;
|
||||||
|
@ -1400,6 +1440,9 @@ namespace BizHawk.MultiClient
|
||||||
Find();
|
Find();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void saveAsBinaryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SaveAsBinary();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue