Hex Eidtor - rip out swap bytes crap and re-fix BigEndian functionality. Someone will have to explain why swap is needed. And do a not terrible implementation that leaves a non-funcitonal menu item!

This commit is contained in:
adelikat 2019-11-03 10:58:41 -06:00
parent 9fb8499ffe
commit 2ba579cfdf
2 changed files with 4 additions and 26 deletions

View File

@ -92,7 +92,6 @@
this.AddressLabel = new System.Windows.Forms.Label();
this.AddressesLabel = new System.Windows.Forms.Label();
this.Header = new System.Windows.Forms.Label();
this.swapBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.HexMenuStrip.SuspendLayout();
this.ViewerContextMenuStrip.SuspendLayout();
this.MemoryViewerBox.SuspendLayout();
@ -285,7 +284,6 @@
this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MemoryDomainsMenuItem,
this.DataSizeSubMenu,
this.swapBytesToolStripMenuItem,
this.BigEndianMenuItem,
this.toolStripSeparator2,
this.GoToAddressMenuItem,
@ -639,14 +637,6 @@
this.Header.TabIndex = 2;
this.Header.Text = "label1";
//
// swapBytesToolStripMenuItem
//
this.swapBytesToolStripMenuItem.CheckOnClick = true;
this.swapBytesToolStripMenuItem.Name = "swapBytesToolStripMenuItem";
this.swapBytesToolStripMenuItem.Size = new System.Drawing.Size(221, 22);
this.swapBytesToolStripMenuItem.Text = "Swap Bytes";
this.swapBytesToolStripMenuItem.Click += new System.EventHandler(this.SwapBytesMenuItem_Click);
//
// HexEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -741,6 +731,5 @@
private System.Windows.Forms.ToolStripMenuItem ExportContextItem;
private System.Windows.Forms.ToolStripMenuItem ExportMenuItem;
private System.Windows.Forms.ToolStripMenuItem importAsBinaryToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem swapBytesToolStripMenuItem;
}
}

View File

@ -80,9 +80,6 @@ namespace BizHawk.Client.EmuHawk
[ConfigPersist]
private string LastDomain { get; set; }
[ConfigPersist]
private bool SwapBytes { get; set; }
[ConfigPersist]
private bool BigEndian { get; set; }
@ -174,7 +171,6 @@ namespace BizHawk.Client.EmuHawk
_domain = MemoryDomains.MainMemory;
}
SwapBytes = false;
BigEndian = _domain.EndianType == MemoryDomain.Endian.Big;
_maxRow = _domain.Size / 2;
@ -558,7 +554,7 @@ namespace BizHawk.Client.EmuHawk
for (int k = 0; k < DataSize; k++)
{
int tNext = MakeValue(1, _addr + j + k);
if (SwapBytes)
if (BigEndian)
{
tVal += (tNext << (k * 8));
}
@ -615,9 +611,9 @@ namespace BizHawk.Client.EmuHawk
case 1:
return _domain.PeekByte(address);
case 2:
return _domain.PeekUshort(address, SwapBytes);
return _domain.PeekUshort(address, BigEndian);
case 4:
return (int)_domain.PeekUint(address, SwapBytes);
return (int)_domain.PeekUint(address, BigEndian);
}
}
@ -632,7 +628,6 @@ namespace BizHawk.Client.EmuHawk
? _romDomain
: MemoryDomains[name];
SwapBytes = false;
BigEndian = _domain.EndianType == MemoryDomain.Endian.Big;
_maxRow = _domain.Size / 2;
SetUpScrollBar();
@ -1621,13 +1616,7 @@ namespace BizHawk.Client.EmuHawk
private void BigEndianMenuItem_Click(object sender, EventArgs e)
{
//BigEndian ^= true;
//UpdateValues();
}
private void SwapBytesMenuItem_Click(object sender, EventArgs e)
{
SwapBytes ^= true;
BigEndian ^= true;
UpdateValues();
}