Hex Editor: Update Big Endian Effect

This commit is contained in:
alyosha-tas 2017-11-09 08:41:35 -05:00
parent 6b18b3cb57
commit 40658e99cf
2 changed files with 97 additions and 62 deletions

View File

@ -92,6 +92,7 @@
this.AddressLabel = new System.Windows.Forms.Label(); this.AddressLabel = new System.Windows.Forms.Label();
this.AddressesLabel = new System.Windows.Forms.Label(); this.AddressesLabel = new System.Windows.Forms.Label();
this.Header = new System.Windows.Forms.Label(); this.Header = new System.Windows.Forms.Label();
this.swapBytesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.HexMenuStrip.SuspendLayout(); this.HexMenuStrip.SuspendLayout();
this.ViewerContextMenuStrip.SuspendLayout(); this.ViewerContextMenuStrip.SuspendLayout();
this.MemoryViewerBox.SuspendLayout(); this.MemoryViewerBox.SuspendLayout();
@ -126,7 +127,7 @@
this.toolStripSeparator1, this.toolStripSeparator1,
this.ExitMenuItem}); this.ExitMenuItem});
this.FileSubMenu.Name = "FileSubMenu"; this.FileSubMenu.Name = "FileSubMenu";
this.FileSubMenu.Size = new System.Drawing.Size(35, 20); this.FileSubMenu.Size = new System.Drawing.Size(37, 20);
this.FileSubMenu.Text = "&File"; this.FileSubMenu.Text = "&File";
this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened); this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened);
// //
@ -135,7 +136,7 @@
this.SaveMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs; this.SaveMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs;
this.SaveMenuItem.Name = "SaveMenuItem"; this.SaveMenuItem.Name = "SaveMenuItem";
this.SaveMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); this.SaveMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.SaveMenuItem.Size = new System.Drawing.Size(225, 22); this.SaveMenuItem.Size = new System.Drawing.Size(229, 22);
this.SaveMenuItem.Text = "Save"; this.SaveMenuItem.Text = "Save";
this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click); this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click);
// //
@ -144,14 +145,14 @@
this.SaveAsBinaryMenuItem.Name = "SaveAsBinaryMenuItem"; this.SaveAsBinaryMenuItem.Name = "SaveAsBinaryMenuItem";
this.SaveAsBinaryMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) this.SaveAsBinaryMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.S))); | System.Windows.Forms.Keys.S)));
this.SaveAsBinaryMenuItem.Size = new System.Drawing.Size(225, 22); this.SaveAsBinaryMenuItem.Size = new System.Drawing.Size(229, 22);
this.SaveAsBinaryMenuItem.Text = "Save as binary..."; this.SaveAsBinaryMenuItem.Text = "Save as binary...";
this.SaveAsBinaryMenuItem.Click += new System.EventHandler(this.SaveAsBinaryMenuItem_Click); this.SaveAsBinaryMenuItem.Click += new System.EventHandler(this.SaveAsBinaryMenuItem_Click);
// //
// SaveAsTextMenuItem // SaveAsTextMenuItem
// //
this.SaveAsTextMenuItem.Name = "SaveAsTextMenuItem"; this.SaveAsTextMenuItem.Name = "SaveAsTextMenuItem";
this.SaveAsTextMenuItem.Size = new System.Drawing.Size(225, 22); this.SaveAsTextMenuItem.Size = new System.Drawing.Size(229, 22);
this.SaveAsTextMenuItem.Text = "Save as text..."; this.SaveAsTextMenuItem.Text = "Save as text...";
this.SaveAsTextMenuItem.Click += new System.EventHandler(this.SaveAsTextMenuItem_Click); this.SaveAsTextMenuItem.Click += new System.EventHandler(this.SaveAsTextMenuItem_Click);
// //
@ -159,26 +160,26 @@
// //
this.importAsBinaryToolStripMenuItem.Name = "importAsBinaryToolStripMenuItem"; this.importAsBinaryToolStripMenuItem.Name = "importAsBinaryToolStripMenuItem";
this.importAsBinaryToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I))); this.importAsBinaryToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
this.importAsBinaryToolStripMenuItem.Size = new System.Drawing.Size(225, 22); this.importAsBinaryToolStripMenuItem.Size = new System.Drawing.Size(229, 22);
this.importAsBinaryToolStripMenuItem.Text = "Import as binary..."; this.importAsBinaryToolStripMenuItem.Text = "Import as binary...";
this.importAsBinaryToolStripMenuItem.Click += new System.EventHandler(this.importAsBinaryToolStripMenuItem_Click); this.importAsBinaryToolStripMenuItem.Click += new System.EventHandler(this.importAsBinaryToolStripMenuItem_Click);
// //
// toolStripSeparator4 // toolStripSeparator4
// //
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(222, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(226, 6);
// //
// LoadTableFileMenuItem // LoadTableFileMenuItem
// //
this.LoadTableFileMenuItem.Name = "LoadTableFileMenuItem"; this.LoadTableFileMenuItem.Name = "LoadTableFileMenuItem";
this.LoadTableFileMenuItem.Size = new System.Drawing.Size(225, 22); this.LoadTableFileMenuItem.Size = new System.Drawing.Size(229, 22);
this.LoadTableFileMenuItem.Text = "&Load .tbl file"; this.LoadTableFileMenuItem.Text = "&Load .tbl file";
this.LoadTableFileMenuItem.Click += new System.EventHandler(this.LoadTableFileMenuItem_Click); this.LoadTableFileMenuItem.Click += new System.EventHandler(this.LoadTableFileMenuItem_Click);
// //
// CloseTableFileMenuItem // CloseTableFileMenuItem
// //
this.CloseTableFileMenuItem.Name = "CloseTableFileMenuItem"; this.CloseTableFileMenuItem.Name = "CloseTableFileMenuItem";
this.CloseTableFileMenuItem.Size = new System.Drawing.Size(225, 22); this.CloseTableFileMenuItem.Size = new System.Drawing.Size(229, 22);
this.CloseTableFileMenuItem.Text = "Close .tbl file"; this.CloseTableFileMenuItem.Text = "Close .tbl file";
this.CloseTableFileMenuItem.Click += new System.EventHandler(this.CloseTableFileMenuItem_Click); this.CloseTableFileMenuItem.Click += new System.EventHandler(this.CloseTableFileMenuItem_Click);
// //
@ -187,26 +188,26 @@
this.RecentTablesSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.RecentTablesSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.noneToolStripMenuItem}); this.noneToolStripMenuItem});
this.RecentTablesSubMenu.Name = "RecentTablesSubMenu"; this.RecentTablesSubMenu.Name = "RecentTablesSubMenu";
this.RecentTablesSubMenu.Size = new System.Drawing.Size(225, 22); this.RecentTablesSubMenu.Size = new System.Drawing.Size(229, 22);
this.RecentTablesSubMenu.Text = "Recent"; this.RecentTablesSubMenu.Text = "Recent";
this.RecentTablesSubMenu.DropDownOpened += new System.EventHandler(this.RecentTablesSubMenu_DropDownOpened); this.RecentTablesSubMenu.DropDownOpened += new System.EventHandler(this.RecentTablesSubMenu_DropDownOpened);
// //
// noneToolStripMenuItem // noneToolStripMenuItem
// //
this.noneToolStripMenuItem.Name = "noneToolStripMenuItem"; this.noneToolStripMenuItem.Name = "noneToolStripMenuItem";
this.noneToolStripMenuItem.Size = new System.Drawing.Size(99, 22); this.noneToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
this.noneToolStripMenuItem.Text = "None"; this.noneToolStripMenuItem.Text = "None";
// //
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(222, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(226, 6);
// //
// ExitMenuItem // ExitMenuItem
// //
this.ExitMenuItem.Name = "ExitMenuItem"; this.ExitMenuItem.Name = "ExitMenuItem";
this.ExitMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); this.ExitMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
this.ExitMenuItem.Size = new System.Drawing.Size(225, 22); this.ExitMenuItem.Size = new System.Drawing.Size(229, 22);
this.ExitMenuItem.Text = "E&xit"; this.ExitMenuItem.Text = "E&xit";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click); this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
// //
@ -221,7 +222,7 @@
this.FindNextMenuItem, this.FindNextMenuItem,
this.FindPrevMenuItem}); this.FindPrevMenuItem});
this.EditMenuItem.Name = "EditMenuItem"; this.EditMenuItem.Name = "EditMenuItem";
this.EditMenuItem.Size = new System.Drawing.Size(37, 20); this.EditMenuItem.Size = new System.Drawing.Size(39, 20);
this.EditMenuItem.Text = "&Edit"; this.EditMenuItem.Text = "&Edit";
this.EditMenuItem.DropDownOpened += new System.EventHandler(this.EditMenuItem_DropDownOpened); this.EditMenuItem.DropDownOpened += new System.EventHandler(this.EditMenuItem_DropDownOpened);
// //
@ -230,7 +231,7 @@
this.CopyMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate; this.CopyMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate;
this.CopyMenuItem.Name = "CopyMenuItem"; this.CopyMenuItem.Name = "CopyMenuItem";
this.CopyMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); this.CopyMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.CopyMenuItem.Size = new System.Drawing.Size(144, 22); this.CopyMenuItem.Size = new System.Drawing.Size(147, 22);
this.CopyMenuItem.Text = "&Copy"; this.CopyMenuItem.Text = "&Copy";
this.CopyMenuItem.Click += new System.EventHandler(this.CopyMenuItem_Click); this.CopyMenuItem.Click += new System.EventHandler(this.CopyMenuItem_Click);
// //
@ -238,7 +239,7 @@
// //
this.ExportMenuItem.Name = "ExportMenuItem"; this.ExportMenuItem.Name = "ExportMenuItem";
this.ExportMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); this.ExportMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.ExportMenuItem.Size = new System.Drawing.Size(144, 22); this.ExportMenuItem.Size = new System.Drawing.Size(147, 22);
this.ExportMenuItem.Text = "&Export"; this.ExportMenuItem.Text = "&Export";
this.ExportMenuItem.Click += new System.EventHandler(this.ExportMenuItem_Click); this.ExportMenuItem.Click += new System.EventHandler(this.ExportMenuItem_Click);
// //
@ -247,20 +248,20 @@
this.PasteMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Paste; this.PasteMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Paste;
this.PasteMenuItem.Name = "PasteMenuItem"; this.PasteMenuItem.Name = "PasteMenuItem";
this.PasteMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); this.PasteMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.PasteMenuItem.Size = new System.Drawing.Size(144, 22); this.PasteMenuItem.Size = new System.Drawing.Size(147, 22);
this.PasteMenuItem.Text = "&Paste"; this.PasteMenuItem.Text = "&Paste";
this.PasteMenuItem.Click += new System.EventHandler(this.PasteMenuItem_Click); this.PasteMenuItem.Click += new System.EventHandler(this.PasteMenuItem_Click);
// //
// toolStripSeparator6 // toolStripSeparator6
// //
this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(141, 6); this.toolStripSeparator6.Size = new System.Drawing.Size(144, 6);
// //
// FindMenuItem // FindMenuItem
// //
this.FindMenuItem.Name = "FindMenuItem"; this.FindMenuItem.Name = "FindMenuItem";
this.FindMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); this.FindMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.FindMenuItem.Size = new System.Drawing.Size(144, 22); this.FindMenuItem.Size = new System.Drawing.Size(147, 22);
this.FindMenuItem.Text = "&Find..."; this.FindMenuItem.Text = "&Find...";
this.FindMenuItem.Click += new System.EventHandler(this.FindMenuItem_Click); this.FindMenuItem.Click += new System.EventHandler(this.FindMenuItem_Click);
// //
@ -268,7 +269,7 @@
// //
this.FindNextMenuItem.Name = "FindNextMenuItem"; this.FindNextMenuItem.Name = "FindNextMenuItem";
this.FindNextMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F3; this.FindNextMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F3;
this.FindNextMenuItem.Size = new System.Drawing.Size(144, 22); this.FindNextMenuItem.Size = new System.Drawing.Size(147, 22);
this.FindNextMenuItem.Text = "Find Next"; this.FindNextMenuItem.Text = "Find Next";
this.FindNextMenuItem.Click += new System.EventHandler(this.FindNextMenuItem_Click); this.FindNextMenuItem.Click += new System.EventHandler(this.FindNextMenuItem_Click);
// //
@ -276,7 +277,7 @@
// //
this.FindPrevMenuItem.Name = "FindPrevMenuItem"; this.FindPrevMenuItem.Name = "FindPrevMenuItem";
this.FindPrevMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2; this.FindPrevMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2;
this.FindPrevMenuItem.Size = new System.Drawing.Size(144, 22); this.FindPrevMenuItem.Size = new System.Drawing.Size(147, 22);
this.FindPrevMenuItem.Text = "Find Prev"; this.FindPrevMenuItem.Text = "Find Prev";
this.FindPrevMenuItem.Click += new System.EventHandler(this.FindPrevMenuItem_Click); this.FindPrevMenuItem.Click += new System.EventHandler(this.FindPrevMenuItem_Click);
// //
@ -285,6 +286,7 @@
this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.MemoryDomainsMenuItem, this.MemoryDomainsMenuItem,
this.DataSizeSubMenu, this.DataSizeSubMenu,
this.swapBytesToolStripMenuItem,
this.BigEndianMenuItem, this.BigEndianMenuItem,
this.toolStripSeparator2, this.toolStripSeparator2,
this.GoToAddressMenuItem, this.GoToAddressMenuItem,
@ -293,7 +295,7 @@
this.UnfreezeAllMenuItem, this.UnfreezeAllMenuItem,
this.PokeAddressMenuItem}); this.PokeAddressMenuItem});
this.OptionsSubMenu.Name = "OptionsSubMenu"; this.OptionsSubMenu.Name = "OptionsSubMenu";
this.OptionsSubMenu.Size = new System.Drawing.Size(56, 20); this.OptionsSubMenu.Size = new System.Drawing.Size(61, 20);
this.OptionsSubMenu.Text = "&Options"; this.OptionsSubMenu.Text = "&Options";
this.OptionsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened); this.OptionsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened);
// //
@ -302,7 +304,7 @@
this.MemoryDomainsMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.MemoryDomainsMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripSeparator3}); this.toolStripSeparator3});
this.MemoryDomainsMenuItem.Name = "MemoryDomainsMenuItem"; this.MemoryDomainsMenuItem.Name = "MemoryDomainsMenuItem";
this.MemoryDomainsMenuItem.Size = new System.Drawing.Size(207, 22); this.MemoryDomainsMenuItem.Size = new System.Drawing.Size(221, 22);
this.MemoryDomainsMenuItem.Text = "&Memory Domains"; this.MemoryDomainsMenuItem.Text = "&Memory Domains";
this.MemoryDomainsMenuItem.DropDownOpened += new System.EventHandler(this.MemoryDomainsMenuItem_DropDownOpened); this.MemoryDomainsMenuItem.DropDownOpened += new System.EventHandler(this.MemoryDomainsMenuItem_DropDownOpened);
// //
@ -318,47 +320,47 @@
this.DataSizeWordMenuItem, this.DataSizeWordMenuItem,
this.DataSizeDWordMenuItem}); this.DataSizeDWordMenuItem});
this.DataSizeSubMenu.Name = "DataSizeSubMenu"; this.DataSizeSubMenu.Name = "DataSizeSubMenu";
this.DataSizeSubMenu.Size = new System.Drawing.Size(207, 22); this.DataSizeSubMenu.Size = new System.Drawing.Size(221, 22);
this.DataSizeSubMenu.Text = "Data Size"; this.DataSizeSubMenu.Text = "Data Size";
// //
// DataSizeByteMenuItem // DataSizeByteMenuItem
// //
this.DataSizeByteMenuItem.Name = "DataSizeByteMenuItem"; this.DataSizeByteMenuItem.Name = "DataSizeByteMenuItem";
this.DataSizeByteMenuItem.Size = new System.Drawing.Size(105, 22); this.DataSizeByteMenuItem.Size = new System.Drawing.Size(106, 22);
this.DataSizeByteMenuItem.Text = "1 Byte"; this.DataSizeByteMenuItem.Text = "1 Byte";
this.DataSizeByteMenuItem.Click += new System.EventHandler(this.DataSizeByteMenuItem_Click); this.DataSizeByteMenuItem.Click += new System.EventHandler(this.DataSizeByteMenuItem_Click);
// //
// DataSizeWordMenuItem // DataSizeWordMenuItem
// //
this.DataSizeWordMenuItem.Name = "DataSizeWordMenuItem"; this.DataSizeWordMenuItem.Name = "DataSizeWordMenuItem";
this.DataSizeWordMenuItem.Size = new System.Drawing.Size(105, 22); this.DataSizeWordMenuItem.Size = new System.Drawing.Size(106, 22);
this.DataSizeWordMenuItem.Text = "2 Byte"; this.DataSizeWordMenuItem.Text = "2 Byte";
this.DataSizeWordMenuItem.Click += new System.EventHandler(this.DataSizeWordMenuItem_Click); this.DataSizeWordMenuItem.Click += new System.EventHandler(this.DataSizeWordMenuItem_Click);
// //
// DataSizeDWordMenuItem // DataSizeDWordMenuItem
// //
this.DataSizeDWordMenuItem.Name = "DataSizeDWordMenuItem"; this.DataSizeDWordMenuItem.Name = "DataSizeDWordMenuItem";
this.DataSizeDWordMenuItem.Size = new System.Drawing.Size(105, 22); this.DataSizeDWordMenuItem.Size = new System.Drawing.Size(106, 22);
this.DataSizeDWordMenuItem.Text = "4 Byte"; this.DataSizeDWordMenuItem.Text = "4 Byte";
this.DataSizeDWordMenuItem.Click += new System.EventHandler(this.DataSizeDWordMenuItem_Click); this.DataSizeDWordMenuItem.Click += new System.EventHandler(this.DataSizeDWordMenuItem_Click);
// //
// BigEndianMenuItem // BigEndianMenuItem
// //
this.BigEndianMenuItem.Name = "BigEndianMenuItem"; this.BigEndianMenuItem.Name = "BigEndianMenuItem";
this.BigEndianMenuItem.Size = new System.Drawing.Size(207, 22); this.BigEndianMenuItem.Size = new System.Drawing.Size(221, 22);
this.BigEndianMenuItem.Text = "Big Endian"; this.BigEndianMenuItem.Text = "Big Endian";
this.BigEndianMenuItem.Click += new System.EventHandler(this.BigEndianMenuItem_Click); this.BigEndianMenuItem.Click += new System.EventHandler(this.BigEndianMenuItem_Click);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(204, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(218, 6);
// //
// GoToAddressMenuItem // GoToAddressMenuItem
// //
this.GoToAddressMenuItem.Name = "GoToAddressMenuItem"; this.GoToAddressMenuItem.Name = "GoToAddressMenuItem";
this.GoToAddressMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G))); this.GoToAddressMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G)));
this.GoToAddressMenuItem.Size = new System.Drawing.Size(207, 22); this.GoToAddressMenuItem.Size = new System.Drawing.Size(221, 22);
this.GoToAddressMenuItem.Text = "&Go to Address..."; this.GoToAddressMenuItem.Text = "&Go to Address...";
this.GoToAddressMenuItem.Click += new System.EventHandler(this.GoToAddressMenuItem_Click); this.GoToAddressMenuItem.Click += new System.EventHandler(this.GoToAddressMenuItem_Click);
// //
@ -367,7 +369,7 @@
this.AddToRamWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.FindHS; this.AddToRamWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.FindHS;
this.AddToRamWatchMenuItem.Name = "AddToRamWatchMenuItem"; this.AddToRamWatchMenuItem.Name = "AddToRamWatchMenuItem";
this.AddToRamWatchMenuItem.ShortcutKeyDisplayString = "Ctrl+W"; this.AddToRamWatchMenuItem.ShortcutKeyDisplayString = "Ctrl+W";
this.AddToRamWatchMenuItem.Size = new System.Drawing.Size(207, 22); this.AddToRamWatchMenuItem.Size = new System.Drawing.Size(221, 22);
this.AddToRamWatchMenuItem.Text = "Add to RAM Watch"; this.AddToRamWatchMenuItem.Text = "Add to RAM Watch";
this.AddToRamWatchMenuItem.Click += new System.EventHandler(this.AddToRamWatchMenuItem_Click); this.AddToRamWatchMenuItem.Click += new System.EventHandler(this.AddToRamWatchMenuItem_Click);
// //
@ -376,7 +378,7 @@
this.FreezeAddressMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze; this.FreezeAddressMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze;
this.FreezeAddressMenuItem.Name = "FreezeAddressMenuItem"; this.FreezeAddressMenuItem.Name = "FreezeAddressMenuItem";
this.FreezeAddressMenuItem.ShortcutKeyDisplayString = "Space"; this.FreezeAddressMenuItem.ShortcutKeyDisplayString = "Space";
this.FreezeAddressMenuItem.Size = new System.Drawing.Size(207, 22); this.FreezeAddressMenuItem.Size = new System.Drawing.Size(221, 22);
this.FreezeAddressMenuItem.Text = "&Freeze Address"; this.FreezeAddressMenuItem.Text = "&Freeze Address";
this.FreezeAddressMenuItem.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click); this.FreezeAddressMenuItem.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click);
// //
@ -385,7 +387,7 @@
this.UnfreezeAllMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Unfreeze; this.UnfreezeAllMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Unfreeze;
this.UnfreezeAllMenuItem.Name = "UnfreezeAllMenuItem"; this.UnfreezeAllMenuItem.Name = "UnfreezeAllMenuItem";
this.UnfreezeAllMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.Delete))); this.UnfreezeAllMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.Delete)));
this.UnfreezeAllMenuItem.Size = new System.Drawing.Size(207, 22); this.UnfreezeAllMenuItem.Size = new System.Drawing.Size(221, 22);
this.UnfreezeAllMenuItem.Text = "Unfreeze All"; this.UnfreezeAllMenuItem.Text = "Unfreeze All";
this.UnfreezeAllMenuItem.Click += new System.EventHandler(this.UnfreezeAllMenuItem_Click); this.UnfreezeAllMenuItem.Click += new System.EventHandler(this.UnfreezeAllMenuItem_Click);
// //
@ -394,7 +396,7 @@
this.PokeAddressMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke; this.PokeAddressMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke;
this.PokeAddressMenuItem.Name = "PokeAddressMenuItem"; this.PokeAddressMenuItem.Name = "PokeAddressMenuItem";
this.PokeAddressMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); this.PokeAddressMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
this.PokeAddressMenuItem.Size = new System.Drawing.Size(207, 22); this.PokeAddressMenuItem.Size = new System.Drawing.Size(221, 22);
this.PokeAddressMenuItem.Text = "&Poke Address"; this.PokeAddressMenuItem.Text = "&Poke Address";
this.PokeAddressMenuItem.Click += new System.EventHandler(this.PokeAddressMenuItem_Click); this.PokeAddressMenuItem.Click += new System.EventHandler(this.PokeAddressMenuItem_Click);
// //
@ -403,7 +405,7 @@
this.SettingsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.SettingsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.CustomColorsSubMenu}); this.CustomColorsSubMenu});
this.SettingsSubMenu.Name = "SettingsSubMenu"; this.SettingsSubMenu.Name = "SettingsSubMenu";
this.SettingsSubMenu.Size = new System.Drawing.Size(58, 20); this.SettingsSubMenu.Size = new System.Drawing.Size(61, 20);
this.SettingsSubMenu.Text = "&Settings"; this.SettingsSubMenu.Text = "&Settings";
// //
// CustomColorsSubMenu // CustomColorsSubMenu
@ -413,25 +415,25 @@
this.toolStripSeparator8, this.toolStripSeparator8,
this.ResetColorsToDefaultMenuItem}); this.ResetColorsToDefaultMenuItem});
this.CustomColorsSubMenu.Name = "CustomColorsSubMenu"; this.CustomColorsSubMenu.Name = "CustomColorsSubMenu";
this.CustomColorsSubMenu.Size = new System.Drawing.Size(143, 22); this.CustomColorsSubMenu.Size = new System.Drawing.Size(153, 22);
this.CustomColorsSubMenu.Text = "Custom Colors"; this.CustomColorsSubMenu.Text = "Custom Colors";
// //
// SetColorsMenuItem // SetColorsMenuItem
// //
this.SetColorsMenuItem.Name = "SetColorsMenuItem"; this.SetColorsMenuItem.Name = "SetColorsMenuItem";
this.SetColorsMenuItem.Size = new System.Drawing.Size(153, 22); this.SetColorsMenuItem.Size = new System.Drawing.Size(157, 22);
this.SetColorsMenuItem.Text = "Set Colors"; this.SetColorsMenuItem.Text = "Set Colors";
this.SetColorsMenuItem.Click += new System.EventHandler(this.SetColorsMenuItem_Click); this.SetColorsMenuItem.Click += new System.EventHandler(this.SetColorsMenuItem_Click);
// //
// toolStripSeparator8 // toolStripSeparator8
// //
this.toolStripSeparator8.Name = "toolStripSeparator8"; this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(150, 6); this.toolStripSeparator8.Size = new System.Drawing.Size(154, 6);
// //
// ResetColorsToDefaultMenuItem // ResetColorsToDefaultMenuItem
// //
this.ResetColorsToDefaultMenuItem.Name = "ResetColorsToDefaultMenuItem"; this.ResetColorsToDefaultMenuItem.Name = "ResetColorsToDefaultMenuItem";
this.ResetColorsToDefaultMenuItem.Size = new System.Drawing.Size(153, 22); this.ResetColorsToDefaultMenuItem.Size = new System.Drawing.Size(157, 22);
this.ResetColorsToDefaultMenuItem.Text = "Reset to Default"; this.ResetColorsToDefaultMenuItem.Text = "Reset to Default";
this.ResetColorsToDefaultMenuItem.Click += new System.EventHandler(this.ResetColorsToDefaultMenuItem_Click); this.ResetColorsToDefaultMenuItem.Click += new System.EventHandler(this.ResetColorsToDefaultMenuItem_Click);
// //
@ -464,7 +466,7 @@
this.toolStripMenuItem1, this.toolStripMenuItem1,
this.viewN64MatrixToolStripMenuItem}); this.viewN64MatrixToolStripMenuItem});
this.ViewerContextMenuStrip.Name = "ViewerContextMenuStrip"; this.ViewerContextMenuStrip.Name = "ViewerContextMenuStrip";
this.ViewerContextMenuStrip.Size = new System.Drawing.Size(208, 264); this.ViewerContextMenuStrip.Size = new System.Drawing.Size(222, 264);
this.ViewerContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.ViewerContextMenuStrip_Opening); this.ViewerContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.ViewerContextMenuStrip_Opening);
// //
// CopyContextItem // CopyContextItem
@ -472,7 +474,7 @@
this.CopyContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate; this.CopyContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate;
this.CopyContextItem.Name = "CopyContextItem"; this.CopyContextItem.Name = "CopyContextItem";
this.CopyContextItem.ShortcutKeyDisplayString = "Ctrl+C"; this.CopyContextItem.ShortcutKeyDisplayString = "Ctrl+C";
this.CopyContextItem.Size = new System.Drawing.Size(207, 22); this.CopyContextItem.Size = new System.Drawing.Size(221, 22);
this.CopyContextItem.Text = "&Copy"; this.CopyContextItem.Text = "&Copy";
this.CopyContextItem.Click += new System.EventHandler(this.CopyMenuItem_Click); this.CopyContextItem.Click += new System.EventHandler(this.CopyMenuItem_Click);
// //
@ -480,7 +482,7 @@
// //
this.ExportContextItem.Name = "ExportContextItem"; this.ExportContextItem.Name = "ExportContextItem";
this.ExportContextItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); this.ExportContextItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.ExportContextItem.Size = new System.Drawing.Size(207, 22); this.ExportContextItem.Size = new System.Drawing.Size(221, 22);
this.ExportContextItem.Text = "&Export"; this.ExportContextItem.Text = "&Export";
// //
// PasteContextItem // PasteContextItem
@ -488,7 +490,7 @@
this.PasteContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Paste; this.PasteContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Paste;
this.PasteContextItem.Name = "PasteContextItem"; this.PasteContextItem.Name = "PasteContextItem";
this.PasteContextItem.ShortcutKeyDisplayString = "Ctrl+V"; this.PasteContextItem.ShortcutKeyDisplayString = "Ctrl+V";
this.PasteContextItem.Size = new System.Drawing.Size(207, 22); this.PasteContextItem.Size = new System.Drawing.Size(221, 22);
this.PasteContextItem.Text = "&Paste"; this.PasteContextItem.Text = "&Paste";
this.PasteContextItem.Click += new System.EventHandler(this.PasteMenuItem_Click); this.PasteContextItem.Click += new System.EventHandler(this.PasteMenuItem_Click);
// //
@ -497,7 +499,7 @@
this.FreezeContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze; this.FreezeContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze;
this.FreezeContextItem.Name = "FreezeContextItem"; this.FreezeContextItem.Name = "FreezeContextItem";
this.FreezeContextItem.ShortcutKeyDisplayString = "Space"; this.FreezeContextItem.ShortcutKeyDisplayString = "Space";
this.FreezeContextItem.Size = new System.Drawing.Size(207, 22); this.FreezeContextItem.Size = new System.Drawing.Size(221, 22);
this.FreezeContextItem.Text = "&Freeze"; this.FreezeContextItem.Text = "&Freeze";
this.FreezeContextItem.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click); this.FreezeContextItem.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click);
// //
@ -506,7 +508,7 @@
this.AddToRamWatchContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.FindHS; this.AddToRamWatchContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.FindHS;
this.AddToRamWatchContextItem.Name = "AddToRamWatchContextItem"; this.AddToRamWatchContextItem.Name = "AddToRamWatchContextItem";
this.AddToRamWatchContextItem.ShortcutKeyDisplayString = "Ctrl+W"; this.AddToRamWatchContextItem.ShortcutKeyDisplayString = "Ctrl+W";
this.AddToRamWatchContextItem.Size = new System.Drawing.Size(207, 22); this.AddToRamWatchContextItem.Size = new System.Drawing.Size(221, 22);
this.AddToRamWatchContextItem.Text = "&Add to RAM Watch"; this.AddToRamWatchContextItem.Text = "&Add to RAM Watch";
this.AddToRamWatchContextItem.Click += new System.EventHandler(this.AddToRamWatchMenuItem_Click); this.AddToRamWatchContextItem.Click += new System.EventHandler(this.AddToRamWatchMenuItem_Click);
// //
@ -515,7 +517,7 @@
this.UnfreezeAllContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Unfreeze; this.UnfreezeAllContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Unfreeze;
this.UnfreezeAllContextItem.Name = "UnfreezeAllContextItem"; this.UnfreezeAllContextItem.Name = "UnfreezeAllContextItem";
this.UnfreezeAllContextItem.ShortcutKeyDisplayString = "Shift+Del"; this.UnfreezeAllContextItem.ShortcutKeyDisplayString = "Shift+Del";
this.UnfreezeAllContextItem.Size = new System.Drawing.Size(207, 22); this.UnfreezeAllContextItem.Size = new System.Drawing.Size(221, 22);
this.UnfreezeAllContextItem.Text = "&Unfreeze All"; this.UnfreezeAllContextItem.Text = "&Unfreeze All";
this.UnfreezeAllContextItem.Click += new System.EventHandler(this.UnfreezeAllMenuItem_Click); this.UnfreezeAllContextItem.Click += new System.EventHandler(this.UnfreezeAllMenuItem_Click);
// //
@ -524,20 +526,20 @@
this.PokeContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke; this.PokeContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke;
this.PokeContextItem.Name = "PokeContextItem"; this.PokeContextItem.Name = "PokeContextItem";
this.PokeContextItem.ShortcutKeyDisplayString = "Ctrl+P"; this.PokeContextItem.ShortcutKeyDisplayString = "Ctrl+P";
this.PokeContextItem.Size = new System.Drawing.Size(207, 22); this.PokeContextItem.Size = new System.Drawing.Size(221, 22);
this.PokeContextItem.Text = "&Poke Address"; this.PokeContextItem.Text = "&Poke Address";
this.PokeContextItem.Click += new System.EventHandler(this.PokeAddressMenuItem_Click); this.PokeContextItem.Click += new System.EventHandler(this.PokeAddressMenuItem_Click);
// //
// ContextSeparator1 // ContextSeparator1
// //
this.ContextSeparator1.Name = "ContextSeparator1"; this.ContextSeparator1.Name = "ContextSeparator1";
this.ContextSeparator1.Size = new System.Drawing.Size(204, 6); this.ContextSeparator1.Size = new System.Drawing.Size(218, 6);
// //
// IncrementContextItem // IncrementContextItem
// //
this.IncrementContextItem.Name = "IncrementContextItem"; this.IncrementContextItem.Name = "IncrementContextItem";
this.IncrementContextItem.ShortcutKeyDisplayString = "+"; this.IncrementContextItem.ShortcutKeyDisplayString = "+";
this.IncrementContextItem.Size = new System.Drawing.Size(207, 22); this.IncrementContextItem.Size = new System.Drawing.Size(221, 22);
this.IncrementContextItem.Text = "&Increment"; this.IncrementContextItem.Text = "&Increment";
this.IncrementContextItem.Click += new System.EventHandler(this.IncrementContextItem_Click); this.IncrementContextItem.Click += new System.EventHandler(this.IncrementContextItem_Click);
// //
@ -545,32 +547,32 @@
// //
this.DecrementContextItem.Name = "DecrementContextItem"; this.DecrementContextItem.Name = "DecrementContextItem";
this.DecrementContextItem.ShortcutKeyDisplayString = "-"; this.DecrementContextItem.ShortcutKeyDisplayString = "-";
this.DecrementContextItem.Size = new System.Drawing.Size(207, 22); this.DecrementContextItem.Size = new System.Drawing.Size(221, 22);
this.DecrementContextItem.Text = "&Decrement"; this.DecrementContextItem.Text = "&Decrement";
this.DecrementContextItem.Click += new System.EventHandler(this.DecrementContextItem_Click); this.DecrementContextItem.Click += new System.EventHandler(this.DecrementContextItem_Click);
// //
// ContextSeparator2 // ContextSeparator2
// //
this.ContextSeparator2.Name = "ContextSeparator2"; this.ContextSeparator2.Name = "ContextSeparator2";
this.ContextSeparator2.Size = new System.Drawing.Size(204, 6); this.ContextSeparator2.Size = new System.Drawing.Size(218, 6);
// //
// GoToContextItem // GoToContextItem
// //
this.GoToContextItem.Name = "GoToContextItem"; this.GoToContextItem.Name = "GoToContextItem";
this.GoToContextItem.ShortcutKeyDisplayString = "Ctrl+G"; this.GoToContextItem.ShortcutKeyDisplayString = "Ctrl+G";
this.GoToContextItem.Size = new System.Drawing.Size(207, 22); this.GoToContextItem.Size = new System.Drawing.Size(221, 22);
this.GoToContextItem.Text = "&Go to Address..."; this.GoToContextItem.Text = "&Go to Address...";
this.GoToContextItem.Click += new System.EventHandler(this.GoToAddressMenuItem_Click); this.GoToContextItem.Click += new System.EventHandler(this.GoToAddressMenuItem_Click);
// //
// toolStripMenuItem1 // toolStripMenuItem1
// //
this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(204, 6); this.toolStripMenuItem1.Size = new System.Drawing.Size(218, 6);
// //
// viewN64MatrixToolStripMenuItem // viewN64MatrixToolStripMenuItem
// //
this.viewN64MatrixToolStripMenuItem.Name = "viewN64MatrixToolStripMenuItem"; this.viewN64MatrixToolStripMenuItem.Name = "viewN64MatrixToolStripMenuItem";
this.viewN64MatrixToolStripMenuItem.Size = new System.Drawing.Size(207, 22); this.viewN64MatrixToolStripMenuItem.Size = new System.Drawing.Size(221, 22);
this.viewN64MatrixToolStripMenuItem.Text = "View N64 Matrix"; this.viewN64MatrixToolStripMenuItem.Text = "View N64 Matrix";
this.viewN64MatrixToolStripMenuItem.Click += new System.EventHandler(this.viewN64MatrixToolStripMenuItem_Click); this.viewN64MatrixToolStripMenuItem.Click += new System.EventHandler(this.viewN64MatrixToolStripMenuItem_Click);
// //
@ -638,6 +640,14 @@
this.Header.TabIndex = 2; this.Header.TabIndex = 2;
this.Header.Text = "label1"; 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 // HexEditor
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -732,5 +742,6 @@
private System.Windows.Forms.ToolStripMenuItem ExportContextItem; private System.Windows.Forms.ToolStripMenuItem ExportContextItem;
private System.Windows.Forms.ToolStripMenuItem ExportMenuItem; private System.Windows.Forms.ToolStripMenuItem ExportMenuItem;
private System.Windows.Forms.ToolStripMenuItem importAsBinaryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem importAsBinaryToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem swapBytesToolStripMenuItem;
} }
} }

View File

@ -79,6 +79,9 @@ namespace BizHawk.Client.EmuHawk
private MemoryDomain _romDomain; private MemoryDomain _romDomain;
private HexFind _hexFind = new HexFind(); private HexFind _hexFind = new HexFind();
[ConfigPersist]
private bool SwapBytes { get; set; }
[ConfigPersist] [ConfigPersist]
private bool BigEndian { get; set; } private bool BigEndian { get; set; }
@ -179,7 +182,9 @@ namespace BizHawk.Client.EmuHawk
_domain = MemoryDomains.MainMemory; _domain = MemoryDomains.MainMemory;
} }
SwapBytes = false;
BigEndian = _domain.EndianType == MemoryDomain.Endian.Big; BigEndian = _domain.EndianType == MemoryDomain.Endian.Big;
_maxRow = _domain.Size / 2; _maxRow = _domain.Size / 2;
// Don't reset scroll bar if restarting the same rom // Don't reset scroll bar if restarting the same rom
@ -528,11 +533,19 @@ namespace BizHawk.Client.EmuHawk
{ {
int t_val = 0; int t_val = 0;
int t_next = 0; int t_next = 0;
bool is_cht;
for (int k = 0; k < DataSize; k++) for (int k = 0; k < DataSize; k++)
{ {
t_next = MakeValue(1, _addr + j + k); t_next = MakeValue(1, _addr + j + k, out is_cht);
t_val += (t_next << ((DataSize - k - 1) * 8));
if (SwapBytes)
{
t_val += (t_next << (k * 8));
}
else
{
t_val += (t_next << ((DataSize - k - 1) * 8));
}
} }
rowStr.AppendFormat(_digitFormatString, t_val); rowStr.AppendFormat(_digitFormatString, t_val);
@ -574,28 +587,31 @@ namespace BizHawk.Client.EmuHawk
: _domain.PeekByte(address); : _domain.PeekByte(address);
} }
private int MakeValue(int dataSize, long address) private int MakeValue(int dataSize, long address, out bool is_cheat)
{ {
if (Global.CheatList.IsActive(_domain, address)) if (Global.CheatList.IsActive(_domain, address))
{ {
is_cheat = true;
return Global.CheatList.GetCheatValue(_domain, address, (WatchSize)dataSize ).Value; return Global.CheatList.GetCheatValue(_domain, address, (WatchSize)dataSize ).Value;
} }
is_cheat = false;
switch (dataSize) switch (dataSize)
{ {
default: default:
case 1: case 1:
return _domain.PeekByte(address); return _domain.PeekByte(address);
case 2: case 2:
return _domain.PeekUshort(address, BigEndian); return _domain.PeekUshort(address, SwapBytes);
case 4: case 4:
return (int)_domain.PeekUint(address, BigEndian); return (int)_domain.PeekUint(address, SwapBytes);
} }
} }
private int MakeValue(long address) private int MakeValue(long address)
{ {
return MakeValue(DataSize, address); bool temp;
return MakeValue(DataSize, address, out temp);
} }
private void SetMemoryDomain(string name) private void SetMemoryDomain(string name)
@ -609,6 +625,7 @@ namespace BizHawk.Client.EmuHawk
_domain = MemoryDomains[name]; _domain = MemoryDomains[name];
} }
SwapBytes = false;
BigEndian = _domain.EndianType == MemoryDomain.Endian.Big; BigEndian = _domain.EndianType == MemoryDomain.Endian.Big;
_maxRow = _domain.Size / 2; _maxRow = _domain.Size / 2;
SetUpScrollBar(); SetUpScrollBar();
@ -1453,8 +1470,9 @@ namespace BizHawk.Client.EmuHawk
{ {
long start = addresses[i]; long start = addresses[i];
long end = addresses[i] + DataSize -1 ; long end = addresses[i] + DataSize -1 ;
bool temp;
for(long a = start;a<=end;a++) for(long a = start;a<=end;a++)
sb.AppendFormat("{0:X2}", MakeValue(1,a)); sb.AppendFormat("{0:X2}", MakeValue(1,a, out temp));
} }
} }
@ -1607,7 +1625,13 @@ namespace BizHawk.Client.EmuHawk
private void BigEndianMenuItem_Click(object sender, EventArgs e) private void BigEndianMenuItem_Click(object sender, EventArgs e)
{ {
BigEndian ^= true; //BigEndian ^= true;
//UpdateValues();
}
private void SwapBytesMenuItem_Click(object sender, EventArgs e)
{
SwapBytes ^= true;
UpdateValues(); UpdateValues();
} }