diff --git a/BizHawk.Client.Common/tools/Cheat.cs b/BizHawk.Client.Common/tools/Cheat.cs index 315ecf8040..f982fc187d 100644 --- a/BizHawk.Client.Common/tools/Cheat.cs +++ b/BizHawk.Client.Common/tools/Cheat.cs @@ -28,13 +28,13 @@ namespace BizHawk.Client.Common else { _enabled = cheat.Enabled; - _watch = Watch.GenerateWatch(cheat.Domain, + _watch = Watch.GenerateWatch( + cheat.Domain, cheat.Address ?? 0, cheat.Size, cheat.Type, cheat.Name, - cheat.BigEndian ?? false - ); + cheat.BigEndian ?? false); _compare = cheat.Compare; _val = cheat.Value ?? 0; @@ -42,6 +42,8 @@ namespace BizHawk.Client.Common } } + public delegate void CheatEventHandler(object sender); + public static Cheat Separator { get { return new Cheat(SeparatorWatch.Instance, 0, null, false); } @@ -49,10 +51,24 @@ namespace BizHawk.Client.Common #endregion - #region Properties + #region private parts - public delegate void CheatEventHandler(object sender); - public event CheatEventHandler Changed; + private readonly Watch _watch; + private int? _compare; + private int _val; + private bool _enabled; + + private void Changes() + { + if (Changed != null) + { + Changed(this); + } + } + + #endregion + + #region Properties public bool IsSeparator { @@ -61,7 +77,7 @@ namespace BizHawk.Client.Common public bool Enabled { - get { if (IsSeparator) return false; else return _enabled; } + get { return !IsSeparator && _enabled; } } public int? Address @@ -76,12 +92,12 @@ namespace BizHawk.Client.Common public bool? BigEndian { - get { if (IsSeparator) return null; else return _watch.BigEndian; } + get { return IsSeparator ? (bool?)null : _watch.BigEndian; } } public int? Compare { - get { if (_compare.HasValue && !IsSeparator) return _compare; else return null; } + get { return _compare.HasValue && !IsSeparator ? _compare : null; } } public MemoryDomain Domain @@ -111,7 +127,7 @@ namespace BizHawk.Client.Common public string Name { - get { if (IsSeparator) return String.Empty; else return _watch.Notes; } + get { return IsSeparator ? String.Empty : _watch.Notes; } } public string AddressStr @@ -164,6 +180,8 @@ namespace BizHawk.Client.Common } } + public event CheatEventHandler Changed; + #endregion #region Actions @@ -172,7 +190,7 @@ namespace BizHawk.Client.Common { if (!IsSeparator) { - bool wasEnabled = _enabled; + var wasEnabled = _enabled; _enabled = true; if (!wasEnabled) { @@ -185,7 +203,7 @@ namespace BizHawk.Client.Common { if (!IsSeparator) { - bool wasEnabled = _enabled; + var wasEnabled = _enabled; _enabled = false; if (wasEnabled) { @@ -268,22 +286,5 @@ namespace BizHawk.Client.Common } #endregion - - #region private parts - - private readonly Watch _watch; - private int? _compare; - private int _val; - private bool _enabled; - - private void Changes() - { - if (Changed != null) - { - Changed(this); - } - } - - #endregion } } diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexColor.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexColor.cs index 583405a594..ea055f1fb4 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexColor.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexColor.cs @@ -50,7 +50,7 @@ namespace BizHawk.Client.EmuHawk if (colorDialog1.ShowDialog() == DialogResult.OK) { Global.Config.HexMenubarColor = colorDialog1.Color; - GlobalWin.Tools.HexEditor.menuStrip1.BackColor = Global.Config.HexMenubarColor; + GlobalWin.Tools.HexEditor.HexMenuStrip.BackColor = Global.Config.HexMenubarColor; HexMenubar.BackColor = colorDialog1.Color; } } diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.Designer.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.Designer.cs index f83f0185e8..1c0bb3237d 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.Designer.cs @@ -32,7 +32,7 @@ { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HexEditor)); - this.menuStrip1 = new MenuStripEx(); + this.HexMenuStrip = new MenuStripEx(); this.FileSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.SaveMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SaveAsBinaryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -88,24 +88,24 @@ this.HexScrollBar = new System.Windows.Forms.VScrollBar(); this.AddressesLabel = new System.Windows.Forms.Label(); this.Header = new System.Windows.Forms.Label(); - this.menuStrip1.SuspendLayout(); + this.HexMenuStrip.SuspendLayout(); this.ViewerContextMenuStrip.SuspendLayout(); this.MemoryViewerBox.SuspendLayout(); this.SuspendLayout(); // // menuStrip1 // - this.menuStrip1.ClickThrough = true; - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.HexMenuStrip.ClickThrough = true; + this.HexMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.FileSubMenu, this.EditMenuItem, this.OptionsSubMenu, this.SettingsSubMenu}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(584, 24); - this.menuStrip1.TabIndex = 1; - this.menuStrip1.Text = "menuStrip1"; + this.HexMenuStrip.Location = new System.Drawing.Point(0, 0); + this.HexMenuStrip.Name = "HexMenuStrip"; + this.HexMenuStrip.Size = new System.Drawing.Size(584, 24); + this.HexMenuStrip.TabIndex = 1; + this.HexMenuStrip.Text = "menuStrip1"; // // FileSubMenu // @@ -594,9 +594,9 @@ this.ClientSize = new System.Drawing.Size(584, 301); this.Controls.Add(this.Header); this.Controls.Add(this.MemoryViewerBox); - this.Controls.Add(this.menuStrip1); + this.Controls.Add(this.HexMenuStrip); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MainMenuStrip = this.menuStrip1; + this.MainMenuStrip = this.HexMenuStrip; this.MinimumSize = new System.Drawing.Size(360, 180); this.Name = "HexEditor"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; @@ -607,8 +607,8 @@ this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.HexEditor_KeyUp); this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.HexEditor_MouseWheel); this.Resize += new System.EventHandler(this.HexEditor_Resize); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); + this.HexMenuStrip.ResumeLayout(false); + this.HexMenuStrip.PerformLayout(); this.ViewerContextMenuStrip.ResumeLayout(false); this.MemoryViewerBox.ResumeLayout(false); this.MemoryViewerBox.PerformLayout(); @@ -619,7 +619,7 @@ #endregion - public MenuStripEx menuStrip1; + public MenuStripEx HexMenuStrip; private System.Windows.Forms.ToolStripMenuItem FileSubMenu; private System.Windows.Forms.ToolStripMenuItem SaveAsTextMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index d95330015f..af174965e1 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -2,37 +2,44 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing; +using System.Globalization; +using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; -using System.Globalization; -using System.IO; -using BizHawk.Common; using BizHawk.Client.Common; +using BizHawk.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { + using System.Diagnostics.CodeAnalysis; + public partial class HexEditor : Form, IToolForm { + private const int FontWidth = 7; // Width of 1 digits + + private readonly List _domainMenuItems = new List(); + private readonly char[] _nibbles = { 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G' }; // G = off 0-9 & A-F are acceptable values + private readonly List _secondaryHighlightedAddresses = new List(); + private int _defaultWidth; private int _defaultHeight; - private readonly List _domainMenuItems = new List(); private int _rowsVisible; private int _numDigits = 4; private string _numDigitsStr = "{0:X4}"; private string _digitFormatString = "{0:X2}"; - private readonly char[] _nibbles = { 'G', 'G', 'G', 'G', 'G', 'G', 'G', 'G' }; //G = off 0-9 & A-F are acceptable values private int _addressHighlighted = -1; - private readonly List _secondaryHighlightedAddresses = new List(); private int _addressOver = -1; + private int _maxRow; - private MemoryDomain _domain = new MemoryDomain("NULL", 1024, MemoryDomain.Endian.Little, addr => 0, - delegate(int a, byte v) { v = 0; }); + + private MemoryDomain _domain = new MemoryDomain( + "NULL", 1024, MemoryDomain.Endian.Little, addr => 0, delegate(int a, byte v) { v = 0; }); + private int _row; private int _addr; - private const int FontWidth = 7; //Width of 1 digits private string _findStr = String.Empty; private bool _loaded; private bool _mouseIsDown; @@ -48,12 +55,6 @@ namespace BizHawk.Client.EmuHawk private bool _bigEndian; private int _dataSize; - #region API - - public bool AskSave() { return true; } - - public bool UpdateBefore { get { return false; } } - public HexEditor() { InitializeComponent(); @@ -67,9 +68,50 @@ namespace BizHawk.Client.EmuHawk TopMost = Global.Config.HexEditorAlwaysOnTop; } + private int? HighlightedAddress + { + get + { + if (_addressHighlighted >= 0) + { + return _addressHighlighted; + } + else + { + return null; // Negative = no address highlighted + } + } + } + + private Watch.WatchSize WatchSize + { + get + { + return (Watch.WatchSize)_dataSize; + } + } + + #region API + + public bool UpdateBefore + { + get + { + return false; + } + } + + public bool AskSave() + { + return true; + } + public void UpdateValues() { - if (!IsHandleCreated || IsDisposed) return; + if (!IsHandleCreated || IsDisposed) + { + return; + } AddressesLabel.Text = GenerateMemoryViewString(); AddressLabel.Text = GenerateAddressString(); @@ -77,11 +119,14 @@ namespace BizHawk.Client.EmuHawk public void Restart() { - if (!IsHandleCreated || IsDisposed) return; + if (!IsHandleCreated || IsDisposed) + { + return; + } var theDomain = _domain.Name.ToLower() == "rom file" ? 999 : GetDomainInt(_domain.Name); - SetMemoryDomainMenu(); //Calls update routines + SetMemoryDomainMenu(); // Calls update routines, TODO: refactor, that is confusing! if (theDomain.HasValue) { @@ -115,7 +160,7 @@ namespace BizHawk.Client.EmuHawk { var found = -1; - var search = value.Replace(" ", "").ToUpper(); + var search = value.Replace(" ", String.Empty).ToUpper(); if (String.IsNullOrEmpty(search)) { return; @@ -144,6 +189,7 @@ namespace BizHawk.Client.EmuHawk { ramblock.Append(String.Format("{0:X2}", (int)_domain.PeekByte(i + j))); } + var block = ramblock.ToString().ToUpper(); if (search == block) { @@ -159,9 +205,9 @@ namespace BizHawk.Client.EmuHawk _findStr = search; MemoryViewerBox.Focus(); } - else if (wrap == false) // Search the opposite direction if not found + else if (wrap == false) { - FindPrev(value, true); + FindPrev(value, true); // Search the opposite direction if not found } } @@ -169,7 +215,7 @@ namespace BizHawk.Client.EmuHawk { var found = -1; - var search = value.Replace(" ", "").ToUpper(); + var search = value.Replace(" ", string.Empty).ToUpper(); if (!String.IsNullOrEmpty(search)) { return; @@ -194,6 +240,7 @@ namespace BizHawk.Client.EmuHawk { ramblock.Append(String.Format("{0:X2}", (int)_domain.PeekByte(i + j))); } + var block = ramblock.ToString().ToUpper(); if (search == block) { @@ -209,187 +256,27 @@ namespace BizHawk.Client.EmuHawk _findStr = search; MemoryViewerBox.Focus(); } - else if (wrap == false) // Search the opposite direction if not found + else if (wrap == false) { - FindPrev(value, true); + FindPrev(value, true); // Search the opposite direction if not found } } #endregion - private void HexEditor_Load(object sender, EventArgs e) - { - _defaultWidth = Size.Width; //Save these first so that the user can restore to its original size - _defaultHeight = Size.Height; - if (Global.Config.SaveWindowPosition) - { - if (_wndx >= 0 && _wndy >= 0) - { - Location = new Point(_wndx, _wndy); - } - - if (_width >= 0 && _height >= 0) - { - Size = new Size(_width, _height); - } - } - SetMemoryDomainMenu(); - SetDataSize(_dataSize); - UpdateValues(); - _loaded = true; - } - - private void LoadConfigSettings() - { - _wndx = Global.Config.HexEditorWndx; - _wndy = Global.Config.HexEditorWndy; - _width = Global.Config.HexEditorWidth; - _height = Global.Config.HexEditorHeight; - _bigEndian = Global.Config.HexEditorBigEndian; - _dataSize = Global.Config.HexEditorDataSize; - //Colors - menuStrip1.BackColor = Global.Config.HexMenubarColor; - MemoryViewerBox.BackColor = Global.Config.HexBackgrndColor; - MemoryViewerBox.ForeColor = Global.Config.HexForegrndColor; - Header.BackColor = Global.Config.HexBackgrndColor; - Header.ForeColor = Global.Config.HexForegrndColor; - - } - - private void SaveConfigSettings() - { - if (_hexFind.IsHandleCreated || !_hexFind.IsDisposed) - { - _hexFind.Close(); - } - - if (Global.Config.SaveWindowPosition) - { - Global.Config.HexEditorWndx = _loaded ? Location.X : _wndx; - Global.Config.HexEditorWndy = _loaded ? Location.Y : _wndy; - Global.Config.HexEditorWidth = _loaded ? Right - Left : _width; - Global.Config.HexEditorHeight = _loaded ? Bottom - Top : _height; - } - Global.Config.HexEditorBigEndian = _bigEndian; - Global.Config.HexEditorDataSize = _dataSize; - } - - private string GenerateAddressString() - { - var addrStr = new StringBuilder(); - - for (var i = 0; i < _rowsVisible; i++) - { - _row = i + HexScrollBar.Value; - _addr = (_row << 4); - if (_addr >= _domain.Size) - { - break; - } - - if (_numDigits == 4) - { - addrStr.Append(" "); //Hack to line things up better between 4 and 6 - } - else if (_numDigits == 6) - { - addrStr.Append(" "); - } - addrStr.AppendLine(_addr.ToHexString(_numDigits)); - } - - return addrStr.ToString(); - } - - private string GenerateMemoryViewString() - { - var rowStr = new StringBuilder(); - - for (var i = 0; i < _rowsVisible; i++) - { - _row = i + HexScrollBar.Value; - _addr = (_row << 4); - if (_addr >= _domain.Size) - break; - - for (var j = 0; j < 16; j += _dataSize) - { - if (_addr + j + _dataSize <= _domain.Size) - { - rowStr.AppendFormat(_digitFormatString, MakeValue(_addr + j)); - } - else - { - for (var t = 0; t < _dataSize; t++) - { - rowStr.Append(" "); - } - rowStr.Append(' '); - } - } - rowStr.Append(" | "); - for (var k = 0; k < 16; k++) - { - if (_addr + k < _domain.Size) - { - rowStr.Append(Remap(_domain.PeekByte(_addr + k))); - } - } - rowStr.AppendLine(); - - } - return rowStr.ToString(); - } - private static char Remap(byte val) { - if (val < ' ') return '.'; - else if (val >= 0x80) return '.'; - else return (char)val; - } - - private int MakeValue(int address) - { - - switch (_dataSize) + if (val < ' ') { - default: - case 1: - return _domain.PeekByte(address); - case 2: - if (_bigEndian) - { - var value = 0; - value |= _domain.PeekByte(address) << 8; - value |= _domain.PeekByte(address + 1); - return value; - } - else - { - var value = 0; - value |= _domain.PeekByte(address); - value |= _domain.PeekByte(address + 1) << 8; - return value; - } - case 4: - if (_bigEndian) - { - var value = 0; - value |= _domain.PeekByte(address) << 24; - value |= _domain.PeekByte(address + 1) << 16; - value |= _domain.PeekByte(address + 2) << 8; - value |= _domain.PeekByte(address + 3) << 0; - return value; - } - else - { - var value = 0; - value |= _domain.PeekByte(address) << 0; - value |= _domain.PeekByte(address + 1) << 8; - value |= _domain.PeekByte(address + 2) << 16; - value |= _domain.PeekByte(address + 3) << 24; - return value; - } + return '.'; + } + else if (val >= 0x80) + { + return '.'; + } + else + { + return (char)val; } } @@ -406,25 +293,6 @@ namespace BizHawk.Client.EmuHawk return null; } - private void SetMemoryDomain(MemoryDomain d) - { - _domain = d; - _bigEndian = d.EndianType == MemoryDomain.Endian.Big; - _maxRow = _domain.Size / 2; - SetUpScrollBar(); - if (0 >= HexScrollBar.Minimum && 0 <= HexScrollBar.Maximum) - { - HexScrollBar.Value = 0; - } - Refresh(); - } - - private void SetDomain(MemoryDomain domain) - { - SetMemoryDomain(GetDomainInt(domain.Name) ?? 0); - SetHeader(); - } - private static bool CurrentRomIsArchive() { var path = GlobalWin.MainForm.CurrentlyOpenRom; @@ -451,7 +319,7 @@ namespace BizHawk.Client.EmuHawk var path = GlobalWin.MainForm.CurrentlyOpenRom; if (path == null) { - return null; + return new byte[] { 0xFF }; } using (var file = new HawkFile()) @@ -475,26 +343,259 @@ namespace BizHawk.Client.EmuHawk } } + private static int GetNumDigits(Int32 i) + { + if (i <= 0x10000) + { + return 4; + } + + return i <= 0x1000000 ? 6 : 8; + } + + // Winform key events suck at the numberpad, so this is necessary + private static char ForceCorrectKeyString(Keys keycode) + { + if ((int)keycode >= 96 && (int)keycode <= 106) + { + return (char)((int)keycode - 48); + } + else + { + return (char)keycode; + } + } + + private static string GetSaveFileFromUser() + { + 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 = "Text (*.txt)|*.txt|All Files|*.*"; + sfd.RestoreDirectory = true; + GlobalWin.Sound.StopSound(); + var result = sfd.ShowDialog(); + GlobalWin.Sound.StartSound(); + + return result == DialogResult.OK ? sfd.FileName : String.Empty; + } + + private static bool IsHexKeyCode(char key) + { + if (key >= 48 && key <= 57) // 0-9 + { + return true; + } + else if (key >= 65 && key <= 70) // A-F + { + return true; + } + else if (key >= 96 && key <= 106) // 0-9 Numpad + { + return true; + } + else + { + return false; + } + } + + private void HexEditor_Load(object sender, EventArgs e) + { + _defaultWidth = Size.Width; // Save these first so that the user can restore to its original size + _defaultHeight = Size.Height; + if (Global.Config.SaveWindowPosition) + { + if (_wndx >= 0 && _wndy >= 0) + { + Location = new Point(_wndx, _wndy); + } + + if (_width >= 0 && _height >= 0) + { + Size = new Size(_width, _height); + } + } + + SetMemoryDomainMenu(); + SetDataSize(_dataSize); + UpdateValues(); + _loaded = true; + } + + private void LoadConfigSettings() + { + _wndx = Global.Config.HexEditorWndx; + _wndy = Global.Config.HexEditorWndy; + _width = Global.Config.HexEditorWidth; + _height = Global.Config.HexEditorHeight; + _bigEndian = Global.Config.HexEditorBigEndian; + _dataSize = Global.Config.HexEditorDataSize; + + HexMenuStrip.BackColor = Global.Config.HexMenubarColor; + MemoryViewerBox.BackColor = Global.Config.HexBackgrndColor; + MemoryViewerBox.ForeColor = Global.Config.HexForegrndColor; + Header.BackColor = Global.Config.HexBackgrndColor; + Header.ForeColor = Global.Config.HexForegrndColor; + } + + private void SaveConfigSettings() + { + if (_hexFind.IsHandleCreated || !_hexFind.IsDisposed) + { + _hexFind.Close(); + } + + if (Global.Config.SaveWindowPosition) + { + Global.Config.HexEditorWndx = _loaded ? Location.X : _wndx; + Global.Config.HexEditorWndy = _loaded ? Location.Y : _wndy; + Global.Config.HexEditorWidth = _loaded ? Right - Left : _width; + Global.Config.HexEditorHeight = _loaded ? Bottom - Top : _height; + } + + Global.Config.HexEditorBigEndian = _bigEndian; + Global.Config.HexEditorDataSize = _dataSize; + } + + private string GenerateAddressString() + { + var addrStr = new StringBuilder(); + + for (var i = 0; i < _rowsVisible; i++) + { + _row = i + HexScrollBar.Value; + _addr = _row << 4; + if (_addr >= _domain.Size) + { + break; + } + + if (_numDigits == 4) + { + addrStr.Append(" "); // Hack to line things up better between 4 and 6 + } + else if (_numDigits == 6) + { + addrStr.Append(" "); + } + + addrStr.AppendLine(_addr.ToHexString(_numDigits)); + } + + return addrStr.ToString(); + } + + private string GenerateMemoryViewString() + { + var rowStr = new StringBuilder(); + + for (var i = 0; i < _rowsVisible; i++) + { + _row = i + HexScrollBar.Value; + _addr = _row << 4; + if (_addr >= _domain.Size) + { + break; + } + + for (var j = 0; j < 16; j += _dataSize) + { + if (_addr + j + _dataSize <= _domain.Size) + { + rowStr.AppendFormat(_digitFormatString, MakeValue(_addr + j)); + } + else + { + for (var t = 0; t < _dataSize; t++) + { + rowStr.Append(" "); + } + + rowStr.Append(' '); + } + } + + rowStr.Append(" | "); + for (var k = 0; k < 16; k++) + { + if (_addr + k < _domain.Size) + { + rowStr.Append(Remap(_domain.PeekByte(_addr + k))); + } + } + + rowStr.AppendLine(); + } + + return rowStr.ToString(); + } + + private int MakeValue(int address) + { + switch (_dataSize) + { + default: + case 1: + return _domain.PeekByte(address); + case 2: + return _domain.PeekWord(address, _bigEndian); + case 4: + return (int)_domain.PeekDWord(address, _bigEndian); + } + } + + private void SetMemoryDomain(MemoryDomain d) + { + _domain = d; + _bigEndian = d.EndianType == MemoryDomain.Endian.Big; + _maxRow = _domain.Size / 2; + SetUpScrollBar(); + if (0 >= HexScrollBar.Minimum && 0 <= HexScrollBar.Maximum) + { + HexScrollBar.Value = 0; + } + + Refresh(); + } + + private void SetDomain(MemoryDomain domain) + { + SetMemoryDomain(GetDomainInt(domain.Name) ?? 0); + SetHeader(); + } + + // TODO: this should be removable or at least refactorable private void SetMemoryDomain(int pos) { - // THIS IS HORRIBLE. - if (pos == 999) + // THIS IS HORRIBLE. + if (pos == 999) { - // THIS IS HORRIBLE. - _rom = GetRomBytes() ?? new byte[] { 0xFF }; + // THIS IS HORRIBLE. + _rom = GetRomBytes(); - // THIS IS HORRIBLE. - _romDomain = new MemoryDomain("ROM File", _rom.Length, MemoryDomain.Endian.Little, - i => _rom[i], - (i, value) => _rom[i] = value); + // THIS IS HORRIBLE. + _romDomain = new MemoryDomain( + "ROM File", _rom.Length, MemoryDomain.Endian.Little, i => _rom[i], (i, value) => _rom[i] = value); - // THIS IS HORRIBLE. + // THIS IS HORRIBLE. _domain = _romDomain; } - else if (pos < Global.Emulator.MemoryDomains.Count) //Sanity check + else if (pos < Global.Emulator.MemoryDomains.Count) { SetMemoryDomain(Global.Emulator.MemoryDomains[pos]); } + SetHeader(); UpdateGroupBoxTitle(); ResetScrollBar(); @@ -525,30 +626,25 @@ namespace BizHawk.Client.EmuHawk var temp = i; item.Click += (o, ev) => SetMemoryDomain(temp); } + if (i == 0) { SetMemoryDomain(i); } + MemoryDomainsMenuItem.DropDownItems.Add(item); _domainMenuItems.Add(item); } } - //Add ROM File memory domain - // THIS IS HORRIBLE. + // Add ROM File memory domain + // THIS IS HORRIBLE. var rom_item = new ToolStripMenuItem { Text = "ROM File" }; - rom_item.Click += (o, ev) => SetMemoryDomain(999); //999 will denote ROM file + rom_item.Click += (o, ev) => SetMemoryDomain(999); // 999 will denote ROM file MemoryDomainsMenuItem.DropDownItems.Add(rom_item); _domainMenuItems.Add(rom_item); } - private static int GetNumDigits(Int32 i) - { - if (i <= 0x10000) return 4; - if (i <= 0x1000000) return 6; - else return 8; - } - private Point GetPromptPoint() { return PointToScreen( @@ -583,7 +679,7 @@ namespace BizHawk.Client.EmuHawk AddressLabel.Text = GenerateAddressString(); } - public void SetHighlighted(int address) + private void SetHighlighted(int address) { if (address < 0) { @@ -602,8 +698,10 @@ namespace BizHawk.Client.EmuHawk { value = 0; } + HexScrollBar.Value = value; } + _addressHighlighted = address; _addressOver = address; ClearNibbles(); @@ -613,12 +711,16 @@ namespace BizHawk.Client.EmuHawk private void UpdateFormText() { if (_addressHighlighted >= 0) + { Text = "Hex Editor - Editing Address 0x" + String.Format(_numDigitsStr, _addressHighlighted); + } else + { Text = "Hex Editor"; + } } - public bool IsVisible(int address) + private bool IsVisible(int address) { var i = address >> 4; return i >= HexScrollBar.Value && i < (_rowsVisible + HexScrollBar.Value); @@ -638,11 +740,12 @@ namespace BizHawk.Client.EmuHawk Header.Text = " 0 4 8 C"; break; } + _numDigits = GetNumDigits(_domain.Size); _numDigitsStr = "{0:X" + _numDigits + "} "; } - public void SetDataSize(int size) + private void SetDataSize(int size) { if (size == 1 || size == 2 || size == 4) { @@ -668,53 +771,6 @@ namespace BizHawk.Client.EmuHawk } } - public int GetPointedAddress() - { - if (_addressOver >= 0) - { - return _addressOver; - } - else - { - return -1; //Negative = no address pointed - } - } - - public void PokeHighlighted(int value) - { - if (_addressHighlighted >= 0) - { - switch (_dataSize) - { - default: - case 1: - _domain.PokeByte(_addressHighlighted, (byte)value); - break; - case 2: - _domain.PokeWord(_addressHighlighted, (ushort)value, _bigEndian); - break; - case 4: - _domain.PokeDWord(_addressHighlighted, (uint)value, _bigEndian); - break; - } - } - } - - private int? HighlightedAddress - { - get - { - if (_addressHighlighted >= 0) - { - return _addressHighlighted; - } - else - { - return null; //Negative = no address highlighted - } - } - } - private bool IsFrozen(int address) { return Global.CheatList.IsActive(_domain, address); @@ -722,21 +778,15 @@ namespace BizHawk.Client.EmuHawk private void UnFreezeAddress(int address) { - if (address >= 0) //TODO: can't unfreeze address 0?? + if (address >= 0) { + // TODO: can't unfreeze address 0?? Global.CheatList.RemoveRange( Global.CheatList.Where(x => x.Contains(address)) ); } - MemoryViewerBox.Refresh(); - } - private Watch.WatchSize WatchSize - { - get - { - return (Watch.WatchSize) _dataSize; - } + MemoryViewerBox.Refresh(); } private void UpdateRelatedDialogs() @@ -748,7 +798,8 @@ namespace BizHawk.Client.EmuHawk UpdateValues(); } - private void FreezeAddress(int address) //TODO refactor to int? + // TODO refactor to int? + private void FreezeAddress(int address) { if (address >= 0) { @@ -781,30 +832,6 @@ namespace BizHawk.Client.EmuHawk } } - private static string GetSaveFileFromUser() - { - 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 = "Text (*.txt)|*.txt|All Files|*.*"; - sfd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); - - return result == DialogResult.OK ? sfd.FileName : String.Empty; - } - private string GetSaveFileFilter() { if (_domain.Name == "ROM File") @@ -851,7 +878,7 @@ namespace BizHawk.Client.EmuHawk private void SetUpScrollBar() { - _rowsVisible = ((MemoryViewerBox.Height - (fontHeight * 2) - (fontHeight / 2)) / fontHeight); + _rowsVisible = (MemoryViewerBox.Height - (fontHeight * 2) - (fontHeight / 2)) / fontHeight; var totalRows = _domain.Size / 16; HexScrollBar.Maximum = totalRows - 1; @@ -861,11 +888,12 @@ namespace BizHawk.Client.EmuHawk AddressLabel.Text = GenerateAddressString(); } + [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1407:ArithmeticExpressionsMustDeclarePrecedence", Justification = "Reviewed. Suppression is OK here.")] private int GetPointedAddress(int x, int y) { - int address; - //Scroll value determines the first row + + // Scroll value determines the first row var i = HexScrollBar.Value; var rowoffset = y / fontHeight; i += rowoffset; @@ -883,7 +911,8 @@ namespace BizHawk.Client.EmuHawk colWidth = 9; break; } - var column = (x /*- 43*/) / (FontWidth * colWidth); + + var column = x / (FontWidth * colWidth); var start = GetTextOffset() - 50; if (x > start) @@ -899,6 +928,7 @@ namespace BizHawk.Client.EmuHawk { address = -1; } + return address; } @@ -961,7 +991,8 @@ namespace BizHawk.Client.EmuHawk start = ((16 / _dataSize) * (FontWidth * 9)) + 67; break; } - start += (FontWidth * 4); + + start += FontWidth * 4; return start; } @@ -989,6 +1020,7 @@ namespace BizHawk.Client.EmuHawk break; } } + return str; } @@ -1000,40 +1032,7 @@ namespace BizHawk.Client.EmuHawk } } - private static bool IsHexKeyCode(char key) - { - if (key >= 48 && key <= 57) //0-9 - { - return true; - } - else if (key >= 65 && key <= 70) //A-F - { - return true; - } - else if (key >= 96 && key <= 106) //0-9 Numpad - { - return true; - } - else - { - return false; - } - } - - //Winform key events suck at the numberpad, so this is necessary - private static char ForceCorrectKeyString(Keys keycode) - { - if ((int)keycode >= 96 && (int)keycode <= 106) - { - return (char)((int)keycode - 48); - } - else - { - return (char)keycode; - } - } - - //TODO: obsolete me + // TODO: obsolete me private void PokeWord(int address, byte _1, byte _2) { if (_bigEndian) @@ -1052,7 +1051,7 @@ namespace BizHawk.Client.EmuHawk { if (Global.CheatList.IsActive(_domain, address)) { - //TODO: Increment should be intelligent since IsActive is. If this address is part of a multi-byte cheat it should intelligently increment just that byte + // TODO: Increment should be intelligent since IsActive is. If this address is part of a multi-byte cheat it should intelligently increment just that byte Global.CheatList.FirstOrDefault(x => x.Domain == _domain && x.Address == address).Increment(); } else @@ -1088,7 +1087,7 @@ namespace BizHawk.Client.EmuHawk { if (Global.CheatList.IsActive(_domain, address)) { - //TODO: Increment should be intelligent since IsActive is. If this address is part of a multi-byte cheat it should intelligently increment just that byte + // TODO: Increment should be intelligent since IsActive is. If this address is part of a multi-byte cheat it should intelligently increment just that byte Global.CheatList.FirstOrDefault(x => x.Domain == _domain && x.Address == address).Decrement(); } else @@ -1122,7 +1121,7 @@ namespace BizHawk.Client.EmuHawk private void ViewerContextMenuStrip_Opening(object sender, CancelEventArgs e) { - var iData = Clipboard.GetDataObject(); + var data = Clipboard.GetDataObject(); CopyContextItem.Visible = FreezeContextItem.Visible = @@ -1134,12 +1133,12 @@ namespace BizHawk.Client.EmuHawk HighlightedAddress.HasValue || _secondaryHighlightedAddresses.Any(); UnfreezeAllContextItem.Visible = Global.CheatList.ActiveCount > 0; - PasteContextItem.Visible = (iData != null && iData.GetDataPresent(DataFormats.Text)); + PasteContextItem.Visible = data != null && data.GetDataPresent(DataFormats.Text); ContextSeparator1.Visible = HighlightedAddress.HasValue || _secondaryHighlightedAddresses.Any() || - (iData != null && iData.GetDataPresent(DataFormats.Text)); + (data != null && data.GetDataPresent(DataFormats.Text)); if (HighlightedAddress.HasValue && IsFrozen(HighlightedAddress.Value)) { @@ -1180,7 +1179,7 @@ namespace BizHawk.Client.EmuHawk private void HighlightSecondaries(string value, int found) { - //This function assumes that the primary highlighted value has been set and sets the remaining characters in this string + // This function assumes that the primary highlighted value has been set and sets the remaining characters in this string _secondaryHighlightedAddresses.Clear(); var addrLength = _dataSize * 2; @@ -1188,7 +1187,8 @@ namespace BizHawk.Client.EmuHawk { return; } - var numToHighlight = ((value.Length / addrLength)) - 1; + + var numToHighlight = (value.Length / addrLength) - 1; for (var i = 0; i < numToHighlight; i++) { @@ -1208,11 +1208,11 @@ namespace BizHawk.Client.EmuHawk private void Paste() { - var iData = Clipboard.GetDataObject(); + var data = Clipboard.GetDataObject(); - if (iData != null && iData.GetDataPresent(DataFormats.Text)) + if (data != null && data.GetDataPresent(DataFormats.Text)) { - var clipboardRaw = (String)iData.GetData(DataFormats.Text); + var clipboardRaw = (String)data.GetData(DataFormats.Text); var hex = InputValidate.DoHexString(clipboardRaw); var numBytes = hex.Length / 2; @@ -1227,7 +1227,7 @@ namespace BizHawk.Client.EmuHawk } else { - //Do nothing + // Do nothing } } @@ -1277,6 +1277,7 @@ namespace BizHawk.Client.EmuHawk { sb.Append(String.Format("{0:X2} ", _domain.PeekByte((i * 16) + j))); } + sb.AppendLine(); } @@ -1358,7 +1359,6 @@ namespace BizHawk.Client.EmuHawk FreezeAddressMenuItem.Text = "&Freeze Address"; } - AddToRamWatchMenuItem.Enabled = FreezeAddressMenuItem.Enabled = HighlightedAddress.HasValue; @@ -1405,6 +1405,7 @@ namespace BizHawk.Client.EmuHawk { GoToAddress(int.Parse(inputPrompt.UserText, NumberStyles.HexNumber)); } + AddressLabel.Text = GenerateAddressString(); } @@ -1479,16 +1480,17 @@ namespace BizHawk.Client.EmuHawk InitialLocation = GetAddressCoordinates(addresses[0]) }; - var Watches = addresses.Select(address => - Watch.GenerateWatch( - _domain, address, + var watches = addresses.Select( + address => Watch.GenerateWatch( + _domain, + address, (Watch.WatchSize)_dataSize, Watch.DisplayType.Hex, String.Empty, _bigEndian )); - poke.SetWatch(Watches); + poke.SetWatch(watches); GlobalWin.Sound.StopSound(); poke.ShowDialog(); @@ -1519,7 +1521,7 @@ namespace BizHawk.Client.EmuHawk { MemoryViewerBox.BackColor = Color.FromName("Control"); MemoryViewerBox.ForeColor = Color.FromName("ControlText"); - menuStrip1.BackColor = Color.FromName("Control"); + this.HexMenuStrip.BackColor = Color.FromName("Control"); Header.BackColor = Color.FromName("Control"); Header.ForeColor = Color.FromName("ControlText"); Global.Config.HexMenubarColor = Color.FromName("Control"); @@ -1578,6 +1580,7 @@ namespace BizHawk.Client.EmuHawk GoToAddressMenuItem_Click(sender, e); return; } + if (e.Control && e.KeyCode == Keys.P) { PokeAddressMenuItem_Click(sender, e); @@ -1595,6 +1598,7 @@ namespace BizHawk.Client.EmuHawk { AddToSecondaryHighlights(i); } + GoToAddress(newHighlighted); } else @@ -1602,6 +1606,7 @@ namespace BizHawk.Client.EmuHawk _secondaryHighlightedAddresses.Clear(); GoToAddress(newHighlighted); } + break; case Keys.Down: newHighlighted = _addressHighlighted + 16; @@ -1611,6 +1616,7 @@ namespace BizHawk.Client.EmuHawk { AddToSecondaryHighlights(i); } + GoToAddress(newHighlighted); } else @@ -1618,6 +1624,7 @@ namespace BizHawk.Client.EmuHawk _secondaryHighlightedAddresses.Clear(); GoToAddress(newHighlighted); } + break; case Keys.Left: newHighlighted = _addressHighlighted - (1 * _dataSize); @@ -1631,6 +1638,7 @@ namespace BizHawk.Client.EmuHawk _secondaryHighlightedAddresses.Clear(); GoToAddress(newHighlighted); } + break; case Keys.Right: newHighlighted = _addressHighlighted + (1 * _dataSize); @@ -1644,6 +1652,7 @@ namespace BizHawk.Client.EmuHawk _secondaryHighlightedAddresses.Clear(); GoToAddress(newHighlighted); } + break; case Keys.PageUp: newHighlighted = _addressHighlighted - (_rowsVisible * 16); @@ -1653,6 +1662,7 @@ namespace BizHawk.Client.EmuHawk { AddToSecondaryHighlights(i); } + GoToAddress(newHighlighted); } else @@ -1660,6 +1670,7 @@ namespace BizHawk.Client.EmuHawk _secondaryHighlightedAddresses.Clear(); GoToAddress(newHighlighted); } + break; case Keys.PageDown: newHighlighted = _addressHighlighted + (_rowsVisible * 16); @@ -1669,6 +1680,7 @@ namespace BizHawk.Client.EmuHawk { AddToSecondaryHighlights(i); } + GoToAddress(newHighlighted); } else @@ -1676,13 +1688,19 @@ namespace BizHawk.Client.EmuHawk _secondaryHighlightedAddresses.Clear(); GoToAddress(newHighlighted); } + break; case Keys.Tab: _secondaryHighlightedAddresses.Clear(); if (e.Modifiers == Keys.Shift) + { GoToAddress(_addressHighlighted - 8); + } else + { GoToAddress(_addressHighlighted + 8); + } + break; case Keys.Home: if (e.Modifiers == Keys.Shift) @@ -1691,6 +1709,7 @@ namespace BizHawk.Client.EmuHawk { AddToSecondaryHighlights(i); } + GoToAddress(0); } else @@ -1698,15 +1717,17 @@ namespace BizHawk.Client.EmuHawk _secondaryHighlightedAddresses.Clear(); GoToAddress(0); } + break; case Keys.End: - newHighlighted = _domain.Size - (_dataSize); + newHighlighted = _domain.Size - _dataSize; if (e.Modifiers == Keys.Shift) { for (var i = _addressHighlighted; i < newHighlighted; i++) { AddToSecondaryHighlights(i); } + GoToAddress(newHighlighted); } else @@ -1714,6 +1735,7 @@ namespace BizHawk.Client.EmuHawk _secondaryHighlightedAddresses.Clear(); GoToAddress(newHighlighted); } + break; case Keys.Add: IncrementContextItem_Click(sender, e); @@ -1736,12 +1758,14 @@ namespace BizHawk.Client.EmuHawk UnFreezeAddress(HighlightedAddress.Value); } } + break; case Keys.W: if (e.Modifiers == Keys.Control) { AddToRamWatchMenuItem_Click(sender, e); } + break; case Keys.Escape: _secondaryHighlightedAddresses.Clear(); @@ -1758,7 +1782,7 @@ namespace BizHawk.Client.EmuHawk return; } - if (e.Control || e.Shift || e.Alt) //If user is pressing one of these, don't type into the hex editor + if (e.Control || e.Shift || e.Alt) { return; } @@ -1780,6 +1804,7 @@ namespace BizHawk.Client.EmuHawk SetHighlighted(_addressHighlighted + 1); UpdateValues(); } + break; case 2: if (_nibbles[0] == 'G') @@ -1807,6 +1832,7 @@ namespace BizHawk.Client.EmuHawk SetHighlighted(_addressHighlighted + 2); UpdateValues(); } + break; case 4: if (_nibbles[0] == 'G') @@ -1857,8 +1883,10 @@ namespace BizHawk.Client.EmuHawk SetHighlighted(_addressHighlighted + 4); UpdateValues(); } + break; } + UpdateValues(); } @@ -1880,6 +1908,7 @@ namespace BizHawk.Client.EmuHawk { DecrementAddress(HighlightedAddress.Value); } + _secondaryHighlightedAddresses.ForEach(DecrementAddress); UpdateValues(); @@ -1902,8 +1931,16 @@ namespace BizHawk.Client.EmuHawk } var newValue = HexScrollBar.Value + delta; - if (newValue < HexScrollBar.Minimum) newValue = HexScrollBar.Minimum; - if (newValue > HexScrollBar.Maximum - HexScrollBar.LargeChange + 1) newValue = HexScrollBar.Maximum - HexScrollBar.LargeChange + 1; + if (newValue < HexScrollBar.Minimum) + { + newValue = HexScrollBar.Minimum; + } + + if (newValue > HexScrollBar.Maximum - HexScrollBar.LargeChange + 1) + { + newValue = HexScrollBar.Maximum - HexScrollBar.LargeChange + 1; + } + if (newValue != HexScrollBar.Value) { HexScrollBar.Value = newValue; @@ -1936,7 +1973,7 @@ namespace BizHawk.Client.EmuHawk var rect = new Rectangle(point, new Size(15 * _dataSize, fontHeight)); e.Graphics.DrawRectangle(new Pen(Brushes.Black), rect); - var textrect = new Rectangle(textpoint, new Size((8 * _dataSize), fontHeight)); + var textrect = new Rectangle(textpoint, new Size(8 * _dataSize, fontHeight)); if (Global.CheatList.IsActive(_domain, _addressHighlighted)) { @@ -1949,6 +1986,7 @@ namespace BizHawk.Client.EmuHawk e.Graphics.FillRectangle(new SolidBrush(Global.Config.HexHighlightColor), textrect); } } + foreach (var address in _secondaryHighlightedAddresses) { var point = GetAddressCoordinates(address); @@ -1971,6 +2009,7 @@ namespace BizHawk.Client.EmuHawk e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(0x77FFD4D4)), textrect); } } + if (HasNibbles()) { e.Graphics.DrawString(MakeNibbles(), new Font("Courier New", 8, FontStyle.Italic), Brushes.Black, new Point(158, 4)); diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.resx b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.resx index eb62784c2c..600cfa9279 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.resx +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.resx @@ -117,7 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs index c026190a64..bcc1ccb65b 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; @@ -24,7 +23,6 @@ namespace BizHawk.Client.EmuHawk public void SetLocation(Point p) { _location = p; - } private void HexFind_Load(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs b/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs index 0c8a3a4018..80428bc47d 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs @@ -9,7 +9,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { - class ToolHelpers + public static class ToolHelpers { public static FileInfo GetWatchFileFromUser(string currentFile) { @@ -18,6 +18,7 @@ namespace BizHawk.Client.EmuHawk { ofd.FileName = Path.GetFileNameWithoutExtension(currentFile); } + ofd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.WatchPath, null); ofd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; ofd.RestoreDirectory = true; @@ -26,9 +27,11 @@ namespace BizHawk.Client.EmuHawk var result = ofd.ShowDialog(); GlobalWin.Sound.StartSound(); if (result != DialogResult.OK) + { return null; - var file = new FileInfo(ofd.FileName); - return file; + } + + return new FileInfo(ofd.FileName); } public static FileInfo GetWatchSaveFileFromUser(string currentFile) @@ -49,15 +52,18 @@ namespace BizHawk.Client.EmuHawk sfd.FileName = "NULL"; sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.WatchPath, null); } + sfd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; sfd.RestoreDirectory = true; GlobalWin.Sound.StopSound(); var result = sfd.ShowDialog(); GlobalWin.Sound.StartSound(); if (result != DialogResult.OK) + { return null; - var file = new FileInfo(sfd.FileName); - return file; + } + + return new FileInfo(sfd.FileName); } public static FileInfo GetCheatFileFromUser(string currentFile) @@ -67,6 +73,7 @@ namespace BizHawk.Client.EmuHawk { ofd.FileName = Path.GetFileNameWithoutExtension(currentFile); } + ofd.InitialDirectory = PathManager.GetCheatsPath(Global.Game); ofd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*"; ofd.RestoreDirectory = true; @@ -75,9 +82,11 @@ namespace BizHawk.Client.EmuHawk var result = ofd.ShowDialog(); GlobalWin.Sound.StartSound(); if (result != DialogResult.OK) + { return null; - var file = new FileInfo(ofd.FileName); - return file; + } + + return new FileInfo(ofd.FileName); } public static FileInfo GetCheatSaveFileFromUser(string currentFile) @@ -91,6 +100,7 @@ namespace BizHawk.Client.EmuHawk { sfd.FileName = PathManager.FilesystemSafeName(Global.Game); } + sfd.InitialDirectory = PathManager.GetCheatsPath(Global.Game); sfd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*"; sfd.RestoreDirectory = true; @@ -155,7 +165,7 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Sound.StartSound(); } - public static IEnumerable GenerateMemoryDomainMenuItems(Action setCallback, string selectedDomain = "", int? maxSize = null) + public static IEnumerable GenerateMemoryDomainMenuItems(Action setCallback, string selectedDomain = "", int? maxSize = null) { var items = new List(); @@ -206,9 +216,7 @@ namespace BizHawk.Client.EmuHawk { foreach (var watch in watches.Where(watch => !watch.IsSeparator)) { - Global.CheatList.Add( - new Cheat(watch, watch.Value ?? 0) - ); + Global.CheatList.Add(new Cheat(watch, watch.Value ?? 0)); } } @@ -235,7 +243,7 @@ namespace BizHawk.Client.EmuHawk var column = new ColumnHeader { Name = columnName, - Text = columnName.Replace("Column", ""), + Text = columnName.Replace("Column", String.Empty), Width = columnWidth, }; diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs index a2e56bf02b..64ede5cb51 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs @@ -28,131 +28,131 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RamWatch)); - this.WatchCountLabel = new System.Windows.Forms.Label(); - this.MessageLabel = new System.Windows.Forms.Label(); - this.MemDomainLabel = new System.Windows.Forms.Label(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.EditContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.RemoveContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.DuplicateContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.PokeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.FreezeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.UnfreezeAllContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ViewInHexEditorContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.Separator6 = new System.Windows.Forms.ToolStripSeparator(); - this.InsertSeperatorContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.MoveUpContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.MoveDownContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.ShowPreviousValueContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ShowChangeCountsContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ShowDiffContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ShowDomainContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStrip1 = new ToolStripEx(); - this.newToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.openToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.saveToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); - this.NewWatchStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.EditWatchToolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.cutToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.ClearChangeCountstoolStripButton = new System.Windows.Forms.ToolStripButton(); - this.DuplicateWatchToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.PoketoolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.FreezetoolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.MoveUpStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.MoveDownStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.menuStrip1 = new MenuStripEx(); - this.filesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.appendFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.recentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.watchesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.memoryDomainsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.Separator2 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); - this.newWatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editWatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeWatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.duplicateWatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pokeAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.freezeAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.insertSeparatorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.clearChangeCountsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.moveUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.definePreviousValueAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.previousFrameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.lastChangeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.originalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.displayWatchesOnScreenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); - this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ShowPreviousMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ShowChangesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ShowDiffMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ShowDomainMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.WatchListView = new BizHawk.Client.EmuHawk.VirtualListView(); - this.AddressColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.ValueColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.PrevColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.ChangesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.DiffColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.contextMenuStrip1.SuspendLayout(); - this.toolStrip1.SuspendLayout(); - this.menuStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // WatchCountLabel - // - this.WatchCountLabel.AutoSize = true; - this.WatchCountLabel.Location = new System.Drawing.Point(16, 57); - this.WatchCountLabel.Name = "WatchCountLabel"; - this.WatchCountLabel.Size = new System.Drawing.Size(56, 13); - this.WatchCountLabel.TabIndex = 5; - this.WatchCountLabel.Text = "0 watches"; - // - // MessageLabel - // - this.MessageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.MessageLabel.AutoSize = true; - this.MessageLabel.Location = new System.Drawing.Point(18, 362); - this.MessageLabel.Name = "MessageLabel"; - this.MessageLabel.Size = new System.Drawing.Size(187, 13); - this.MessageLabel.TabIndex = 6; - this.MessageLabel.Text = " "; - // - // MemDomainLabel - // - this.MemDomainLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.MemDomainLabel.AutoSize = true; - this.MemDomainLabel.Location = new System.Drawing.Point(216, 57); - this.MemDomainLabel.Name = "MemDomainLabel"; - this.MemDomainLabel.Size = new System.Drawing.Size(127, 13); - this.MemDomainLabel.TabIndex = 7; - this.MemDomainLabel.Text = " "; - // - // contextMenuStrip1 - // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RamWatch)); + this.WatchCountLabel = new System.Windows.Forms.Label(); + this.MessageLabel = new System.Windows.Forms.Label(); + this.MemDomainLabel = new System.Windows.Forms.Label(); + this.ListViewContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.EditContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RemoveContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.DuplicateContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.PokeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.FreezeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.UnfreezeAllContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ViewInHexEditorContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.Separator6 = new System.Windows.Forms.ToolStripSeparator(); + this.InsertSeperatorContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.MoveUpContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.MoveDownContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.ShowPreviousValueContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ShowChangeCountsContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ShowDiffContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ShowDomainContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStrip1 = new ToolStripEx(); + this.newToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.openToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.saveToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); + this.NewWatchStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.EditWatchToolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.cutToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.ClearChangeCountstoolStripButton = new System.Windows.Forms.ToolStripButton(); + this.DuplicateWatchToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.PoketoolStripButton2 = new System.Windows.Forms.ToolStripButton(); + this.FreezetoolStripButton2 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.MoveUpStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.MoveDownStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.menuStrip1 = new MenuStripEx(); + this.FileSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.NewListMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OpenMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveAsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AppendMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RecentSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.WatchesSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.MemoryDomainsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.Separator2 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); + this.NewWatchMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.EditWatchMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RemoveWatchMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.DuplicateWatchMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.PokeAddressMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.FreezeAddressMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.InsertSeparatorMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ClearChangeCountsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.MoveUpMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.MoveDownMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SelectAllMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OptionsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.DefinePreviousValueSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.PreviousFrameMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.LastChangeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OriginalMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.WatchesOnScreenMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveWindowPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); + this.RestoreWindowSizeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ColumnsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.ShowPreviousMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ShowChangesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ShowDiffMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ShowDomainMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.WatchListView = new BizHawk.Client.EmuHawk.VirtualListView(); + this.AddressColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.ValueColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.PrevColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.ChangesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.DiffColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.ListViewContextMenu.SuspendLayout(); + this.toolStrip1.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // WatchCountLabel + // + this.WatchCountLabel.AutoSize = true; + this.WatchCountLabel.Location = new System.Drawing.Point(16, 57); + this.WatchCountLabel.Name = "WatchCountLabel"; + this.WatchCountLabel.Size = new System.Drawing.Size(56, 13); + this.WatchCountLabel.TabIndex = 5; + this.WatchCountLabel.Text = "0 watches"; + // + // MessageLabel + // + this.MessageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.MessageLabel.AutoSize = true; + this.MessageLabel.Location = new System.Drawing.Point(18, 362); + this.MessageLabel.Name = "MessageLabel"; + this.MessageLabel.Size = new System.Drawing.Size(187, 13); + this.MessageLabel.TabIndex = 6; + this.MessageLabel.Text = " "; + // + // MemDomainLabel + // + this.MemDomainLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.MemDomainLabel.AutoSize = true; + this.MemDomainLabel.Location = new System.Drawing.Point(216, 57); + this.MemDomainLabel.Name = "MemDomainLabel"; + this.MemDomainLabel.Size = new System.Drawing.Size(127, 13); + this.MemDomainLabel.TabIndex = 7; + this.MemDomainLabel.Text = " "; + // + // ListViewContextMenu + // + this.ListViewContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.EditContextMenuItem, this.RemoveContextMenuItem, this.DuplicateContextMenuItem, @@ -169,139 +169,139 @@ this.ShowChangeCountsContextMenuItem, this.ShowDiffContextMenuItem, this.ShowDomainContextMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(204, 324); - this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); - // - // EditContextMenuItem - // - this.EditContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; - this.EditContextMenuItem.Name = "EditContextMenuItem"; - this.EditContextMenuItem.ShortcutKeyDisplayString = "Ctrl+E"; - this.EditContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.EditContextMenuItem.Text = "&Edit"; - this.EditContextMenuItem.Click += new System.EventHandler(this.editWatchToolStripMenuItem_Click); - // - // RemoveContextMenuItem - // - this.RemoveContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; - this.RemoveContextMenuItem.Name = "RemoveContextMenuItem"; - this.RemoveContextMenuItem.ShortcutKeyDisplayString = "Ctrl+R"; - this.RemoveContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.RemoveContextMenuItem.Text = "&Remove"; - this.RemoveContextMenuItem.Click += new System.EventHandler(this.removeWatchToolStripMenuItem_Click); - // - // DuplicateContextMenuItem - // - this.DuplicateContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate; - this.DuplicateContextMenuItem.Name = "DuplicateContextMenuItem"; - this.DuplicateContextMenuItem.ShortcutKeyDisplayString = "Ctrl+D"; - this.DuplicateContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.DuplicateContextMenuItem.Text = "&Duplicate"; - this.DuplicateContextMenuItem.Click += new System.EventHandler(this.duplicateWatchToolStripMenuItem_Click); - // - // PokeContextMenuItem - // - this.PokeContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke; - this.PokeContextMenuItem.Name = "PokeContextMenuItem"; - this.PokeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+P"; - this.PokeContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.PokeContextMenuItem.Text = "&Poke"; - this.PokeContextMenuItem.Click += new System.EventHandler(this.pokeAddressToolStripMenuItem_Click); - // - // FreezeContextMenuItem - // - this.FreezeContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze; - this.FreezeContextMenuItem.Name = "FreezeContextMenuItem"; - this.FreezeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+F"; - this.FreezeContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.FreezeContextMenuItem.Text = "&Freeze"; - this.FreezeContextMenuItem.Click += new System.EventHandler(this.freezeAddressToolStripMenuItem_Click); - // - // UnfreezeAllContextMenuItem - // - this.UnfreezeAllContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Unfreeze; - this.UnfreezeAllContextMenuItem.Name = "UnfreezeAllContextMenuItem"; - this.UnfreezeAllContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.UnfreezeAllContextMenuItem.Text = "Unfreeze &All"; - this.UnfreezeAllContextMenuItem.Click += new System.EventHandler(this.UnfreezeAllContextMenuItem_Click); - // - // ViewInHexEditorContextMenuItem - // - this.ViewInHexEditorContextMenuItem.Name = "ViewInHexEditorContextMenuItem"; - this.ViewInHexEditorContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.ViewInHexEditorContextMenuItem.Text = "View in Hex Editor"; - this.ViewInHexEditorContextMenuItem.Click += new System.EventHandler(this.ViewInHexEditorContextMenuItem_Click); - // - // Separator6 - // - this.Separator6.Name = "Separator6"; - this.Separator6.Size = new System.Drawing.Size(200, 6); - // - // InsertSeperatorContextMenuItem - // - this.InsertSeperatorContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; - this.InsertSeperatorContextMenuItem.Name = "InsertSeperatorContextMenuItem"; - this.InsertSeperatorContextMenuItem.ShortcutKeyDisplayString = "Ctrl+I"; - this.InsertSeperatorContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.InsertSeperatorContextMenuItem.Text = "&Insert Separator"; - this.InsertSeperatorContextMenuItem.Click += new System.EventHandler(this.insertSeparatorToolStripMenuItem_Click); - // - // MoveUpContextMenuItem - // - this.MoveUpContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; - this.MoveUpContextMenuItem.Name = "MoveUpContextMenuItem"; - this.MoveUpContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Up"; - this.MoveUpContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.MoveUpContextMenuItem.Text = "Move &Up"; - this.MoveUpContextMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click); - // - // MoveDownContextMenuItem - // - this.MoveDownContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown; - this.MoveDownContextMenuItem.Name = "MoveDownContextMenuItem"; - this.MoveDownContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Down"; - this.MoveDownContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.MoveDownContextMenuItem.Text = "Move &Down"; - this.MoveDownContextMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(200, 6); - // - // ShowPreviousValueContextMenuItem - // - this.ShowPreviousValueContextMenuItem.Name = "ShowPreviousValueContextMenuItem"; - this.ShowPreviousValueContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.ShowPreviousValueContextMenuItem.Text = "Show Previous Value"; - this.ShowPreviousValueContextMenuItem.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click); - // - // ShowChangeCountsContextMenuItem - // - this.ShowChangeCountsContextMenuItem.Name = "ShowChangeCountsContextMenuItem"; - this.ShowChangeCountsContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.ShowChangeCountsContextMenuItem.Text = "Show Change Counts"; - this.ShowChangeCountsContextMenuItem.Click += new System.EventHandler(this.showChangeCountsToolStripMenuItem_Click); - // - // ShowDiffContextMenuItem - // - this.ShowDiffContextMenuItem.Name = "ShowDiffContextMenuItem"; - this.ShowDiffContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.ShowDiffContextMenuItem.Text = "Show Difference"; - this.ShowDiffContextMenuItem.Click += new System.EventHandler(this.diffToolStripMenuItem_Click); - // - // ShowDomainContextMenuItem - // - this.ShowDomainContextMenuItem.Name = "ShowDomainContextMenuItem"; - this.ShowDomainContextMenuItem.Size = new System.Drawing.Size(203, 22); - this.ShowDomainContextMenuItem.Text = "Show Domain"; - this.ShowDomainContextMenuItem.Click += new System.EventHandler(this.domainToolStripMenuItem_Click); - // - // toolStrip1 - // - this.toolStrip1.ClickThrough = true; - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ListViewContextMenu.Name = "contextMenuStrip1"; + this.ListViewContextMenu.Size = new System.Drawing.Size(204, 346); + this.ListViewContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ListViewContextMenu_Opening); + // + // EditContextMenuItem + // + this.EditContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; + this.EditContextMenuItem.Name = "EditContextMenuItem"; + this.EditContextMenuItem.ShortcutKeyDisplayString = "Ctrl+E"; + this.EditContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.EditContextMenuItem.Text = "&Edit"; + this.EditContextMenuItem.Click += new System.EventHandler(this.EditWatchMenuItem_Click); + // + // RemoveContextMenuItem + // + this.RemoveContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; + this.RemoveContextMenuItem.Name = "RemoveContextMenuItem"; + this.RemoveContextMenuItem.ShortcutKeyDisplayString = "Ctrl+R"; + this.RemoveContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.RemoveContextMenuItem.Text = "&Remove"; + this.RemoveContextMenuItem.Click += new System.EventHandler(this.RemoveWatchMenuItem_Click); + // + // DuplicateContextMenuItem + // + this.DuplicateContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate; + this.DuplicateContextMenuItem.Name = "DuplicateContextMenuItem"; + this.DuplicateContextMenuItem.ShortcutKeyDisplayString = "Ctrl+D"; + this.DuplicateContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.DuplicateContextMenuItem.Text = "&Duplicate"; + this.DuplicateContextMenuItem.Click += new System.EventHandler(this.DuplicateWatchMenuItem_Click); + // + // PokeContextMenuItem + // + this.PokeContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke; + this.PokeContextMenuItem.Name = "PokeContextMenuItem"; + this.PokeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+P"; + this.PokeContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.PokeContextMenuItem.Text = "&Poke"; + this.PokeContextMenuItem.Click += new System.EventHandler(this.PokeAddressMenuItem_Click); + // + // FreezeContextMenuItem + // + this.FreezeContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze; + this.FreezeContextMenuItem.Name = "FreezeContextMenuItem"; + this.FreezeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+F"; + this.FreezeContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.FreezeContextMenuItem.Text = "&Freeze"; + this.FreezeContextMenuItem.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click); + // + // UnfreezeAllContextMenuItem + // + this.UnfreezeAllContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Unfreeze; + this.UnfreezeAllContextMenuItem.Name = "UnfreezeAllContextMenuItem"; + this.UnfreezeAllContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.UnfreezeAllContextMenuItem.Text = "Unfreeze &All"; + this.UnfreezeAllContextMenuItem.Click += new System.EventHandler(this.UnfreezeAllContextMenuItem_Click); + // + // ViewInHexEditorContextMenuItem + // + this.ViewInHexEditorContextMenuItem.Name = "ViewInHexEditorContextMenuItem"; + this.ViewInHexEditorContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.ViewInHexEditorContextMenuItem.Text = "View in Hex Editor"; + this.ViewInHexEditorContextMenuItem.Click += new System.EventHandler(this.ViewInHexEditorContextMenuItem_Click); + // + // Separator6 + // + this.Separator6.Name = "Separator6"; + this.Separator6.Size = new System.Drawing.Size(200, 6); + // + // InsertSeperatorContextMenuItem + // + this.InsertSeperatorContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; + this.InsertSeperatorContextMenuItem.Name = "InsertSeperatorContextMenuItem"; + this.InsertSeperatorContextMenuItem.ShortcutKeyDisplayString = "Ctrl+I"; + this.InsertSeperatorContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.InsertSeperatorContextMenuItem.Text = "&Insert Separator"; + this.InsertSeperatorContextMenuItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click); + // + // MoveUpContextMenuItem + // + this.MoveUpContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; + this.MoveUpContextMenuItem.Name = "MoveUpContextMenuItem"; + this.MoveUpContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Up"; + this.MoveUpContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.MoveUpContextMenuItem.Text = "Move &Up"; + this.MoveUpContextMenuItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click); + // + // MoveDownContextMenuItem + // + this.MoveDownContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown; + this.MoveDownContextMenuItem.Name = "MoveDownContextMenuItem"; + this.MoveDownContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Down"; + this.MoveDownContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.MoveDownContextMenuItem.Text = "Move &Down"; + this.MoveDownContextMenuItem.Click += new System.EventHandler(this.MoveDownMenuItem_Click); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(200, 6); + // + // ShowPreviousValueContextMenuItem + // + this.ShowPreviousValueContextMenuItem.Name = "ShowPreviousValueContextMenuItem"; + this.ShowPreviousValueContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.ShowPreviousValueContextMenuItem.Text = "Show Previous Value"; + this.ShowPreviousValueContextMenuItem.Click += new System.EventHandler(this.ShowPreviousMenuItem_Click); + // + // ShowChangeCountsContextMenuItem + // + this.ShowChangeCountsContextMenuItem.Name = "ShowChangeCountsContextMenuItem"; + this.ShowChangeCountsContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.ShowChangeCountsContextMenuItem.Text = "Show Change Counts"; + this.ShowChangeCountsContextMenuItem.Click += new System.EventHandler(this.ShowChangesMenuItem_Click); + // + // ShowDiffContextMenuItem + // + this.ShowDiffContextMenuItem.Name = "ShowDiffContextMenuItem"; + this.ShowDiffContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.ShowDiffContextMenuItem.Text = "Show Difference"; + this.ShowDiffContextMenuItem.Click += new System.EventHandler(this.ShowDiffMenuItem_Click); + // + // ShowDomainContextMenuItem + // + this.ShowDomainContextMenuItem.Name = "ShowDomainContextMenuItem"; + this.ShowDomainContextMenuItem.Size = new System.Drawing.Size(203, 22); + this.ShowDomainContextMenuItem.Text = "Show Domain"; + this.ShowDomainContextMenuItem.Click += new System.EventHandler(this.ShowDomainMenuItem_Click); + // + // toolStrip1 + // + this.toolStrip1.ClickThrough = true; + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.newToolStripButton, this.openToolStripButton, this.saveToolStripButton, @@ -317,533 +317,533 @@ this.toolStripSeparator5, this.MoveUpStripButton1, this.MoveDownStripButton1}); - this.toolStrip1.Location = new System.Drawing.Point(0, 24); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(359, 25); - this.toolStrip1.TabIndex = 4; - this.toolStrip1.TabStop = true; - this.toolStrip1.Text = "toolStrip1"; - // - // newToolStripButton - // - this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image"))); - this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.newToolStripButton.Name = "newToolStripButton"; - this.newToolStripButton.Size = new System.Drawing.Size(23, 22); - this.newToolStripButton.Text = "&New"; - this.newToolStripButton.Click += new System.EventHandler(this.newListToolStripMenuItem_Click); - // - // openToolStripButton - // - this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image"))); - this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.openToolStripButton.Name = "openToolStripButton"; - this.openToolStripButton.Size = new System.Drawing.Size(23, 22); - this.openToolStripButton.Text = "&Open"; - this.openToolStripButton.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - // - // saveToolStripButton - // - this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripButton.Image"))); - this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.saveToolStripButton.Name = "saveToolStripButton"; - this.saveToolStripButton.Size = new System.Drawing.Size(23, 22); - this.saveToolStripButton.Text = "&Save"; - this.saveToolStripButton.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); - // - // toolStripSeparator - // - this.toolStripSeparator.Name = "toolStripSeparator"; - this.toolStripSeparator.Size = new System.Drawing.Size(6, 25); - // - // NewWatchStripButton1 - // - this.NewWatchStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.NewWatchStripButton1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.addWatch; - this.NewWatchStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.NewWatchStripButton1.Name = "NewWatchStripButton1"; - this.NewWatchStripButton1.Size = new System.Drawing.Size(23, 22); - this.NewWatchStripButton1.Text = "New Watch"; - this.NewWatchStripButton1.ToolTipText = "New Watch"; - this.NewWatchStripButton1.Click += new System.EventHandler(this.newWatchToolStripMenuItem_Click); - // - // EditWatchToolStripButton1 - // - this.EditWatchToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.EditWatchToolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("EditWatchToolStripButton1.Image"))); - this.EditWatchToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.EditWatchToolStripButton1.Name = "EditWatchToolStripButton1"; - this.EditWatchToolStripButton1.Size = new System.Drawing.Size(23, 22); - this.EditWatchToolStripButton1.Text = "Edit Watch"; - this.EditWatchToolStripButton1.Click += new System.EventHandler(this.editWatchToolStripMenuItem_Click); - // - // cutToolStripButton - // - this.cutToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.cutToolStripButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; - this.cutToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.cutToolStripButton.Name = "cutToolStripButton"; - this.cutToolStripButton.Size = new System.Drawing.Size(23, 22); - this.cutToolStripButton.Text = "C&ut"; - this.cutToolStripButton.ToolTipText = "Remove Watch"; - this.cutToolStripButton.Click += new System.EventHandler(this.removeWatchToolStripMenuItem_Click); - // - // ClearChangeCountstoolStripButton - // - this.ClearChangeCountstoolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.ClearChangeCountstoolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("ClearChangeCountstoolStripButton.Image"))); - this.ClearChangeCountstoolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.ClearChangeCountstoolStripButton.Name = "ClearChangeCountstoolStripButton"; - this.ClearChangeCountstoolStripButton.Size = new System.Drawing.Size(23, 22); - this.ClearChangeCountstoolStripButton.Text = "C"; - this.ClearChangeCountstoolStripButton.ToolTipText = "Clear Change Counts"; - this.ClearChangeCountstoolStripButton.Click += new System.EventHandler(this.clearChangeCountsToolStripMenuItem_Click); - // - // DuplicateWatchToolStripButton - // - this.DuplicateWatchToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.DuplicateWatchToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("DuplicateWatchToolStripButton.Image"))); - this.DuplicateWatchToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.DuplicateWatchToolStripButton.Name = "DuplicateWatchToolStripButton"; - this.DuplicateWatchToolStripButton.Size = new System.Drawing.Size(23, 22); - this.DuplicateWatchToolStripButton.Text = "Duplicate Watch"; - this.DuplicateWatchToolStripButton.Click += new System.EventHandler(this.duplicateWatchToolStripMenuItem_Click); - // - // PoketoolStripButton2 - // - this.PoketoolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.PoketoolStripButton2.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke; - this.PoketoolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.PoketoolStripButton2.Name = "PoketoolStripButton2"; - this.PoketoolStripButton2.Size = new System.Drawing.Size(23, 22); - this.PoketoolStripButton2.Text = "toolStripButton2"; - this.PoketoolStripButton2.ToolTipText = "Poke address"; - this.PoketoolStripButton2.Click += new System.EventHandler(this.pokeAddressToolStripMenuItem_Click); - // - // FreezetoolStripButton2 - // - this.FreezetoolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.FreezetoolStripButton2.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze; - this.FreezetoolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.FreezetoolStripButton2.Name = "FreezetoolStripButton2"; - this.FreezetoolStripButton2.Size = new System.Drawing.Size(23, 22); - this.FreezetoolStripButton2.Text = "Freeze Address"; - this.FreezetoolStripButton2.Click += new System.EventHandler(this.freezeAddressToolStripMenuItem_Click); - // - // toolStripButton1 - // - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(23, 22); - this.toolStripButton1.Text = "-"; - this.toolStripButton1.ToolTipText = "Insert Separator"; - this.toolStripButton1.Click += new System.EventHandler(this.insertSeparatorToolStripMenuItem_Click); - // - // toolStripSeparator5 - // - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25); - // - // MoveUpStripButton1 - // - this.MoveUpStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.MoveUpStripButton1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; - this.MoveUpStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.MoveUpStripButton1.Name = "MoveUpStripButton1"; - this.MoveUpStripButton1.Size = new System.Drawing.Size(23, 22); - this.MoveUpStripButton1.Text = "Move Up"; - this.MoveUpStripButton1.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click); - // - // MoveDownStripButton1 - // - this.MoveDownStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.MoveDownStripButton1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown; - this.MoveDownStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.MoveDownStripButton1.Name = "MoveDownStripButton1"; - this.MoveDownStripButton1.Size = new System.Drawing.Size(23, 22); - this.MoveDownStripButton1.Text = "Move Down"; - this.MoveDownStripButton1.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click); - // - // menuStrip1 - // - this.menuStrip1.ClickThrough = true; - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.filesToolStripMenuItem, - this.watchesToolStripMenuItem, - this.optionsToolStripMenuItem, - this.viewToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(359, 24); - this.menuStrip1.TabIndex = 3; - this.menuStrip1.Text = "menuStrip1"; - // - // filesToolStripMenuItem - // - this.filesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newListToolStripMenuItem, - this.openToolStripMenuItem, - this.saveToolStripMenuItem, - this.saveAsToolStripMenuItem, - this.appendFileToolStripMenuItem, - this.recentToolStripMenuItem, + this.toolStrip1.Location = new System.Drawing.Point(0, 24); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Size = new System.Drawing.Size(359, 25); + this.toolStrip1.TabIndex = 4; + this.toolStrip1.TabStop = true; + this.toolStrip1.Text = "toolStrip1"; + // + // newToolStripButton + // + this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image"))); + this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.newToolStripButton.Name = "newToolStripButton"; + this.newToolStripButton.Size = new System.Drawing.Size(23, 22); + this.newToolStripButton.Text = "&New"; + this.newToolStripButton.Click += new System.EventHandler(this.NewListMenuItem_Click); + // + // openToolStripButton + // + this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image"))); + this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.openToolStripButton.Name = "openToolStripButton"; + this.openToolStripButton.Size = new System.Drawing.Size(23, 22); + this.openToolStripButton.Text = "&Open"; + this.openToolStripButton.Click += new System.EventHandler(this.OpenMenuItem_Click); + // + // saveToolStripButton + // + this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripButton.Image"))); + this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.saveToolStripButton.Name = "saveToolStripButton"; + this.saveToolStripButton.Size = new System.Drawing.Size(23, 22); + this.saveToolStripButton.Text = "&Save"; + this.saveToolStripButton.Click += new System.EventHandler(this.SaveMenuItem_Click); + // + // toolStripSeparator + // + this.toolStripSeparator.Name = "toolStripSeparator"; + this.toolStripSeparator.Size = new System.Drawing.Size(6, 25); + // + // NewWatchStripButton1 + // + this.NewWatchStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.NewWatchStripButton1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.addWatch; + this.NewWatchStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.NewWatchStripButton1.Name = "NewWatchStripButton1"; + this.NewWatchStripButton1.Size = new System.Drawing.Size(23, 22); + this.NewWatchStripButton1.Text = "New Watch"; + this.NewWatchStripButton1.ToolTipText = "New Watch"; + this.NewWatchStripButton1.Click += new System.EventHandler(this.NewWatchMenuItem_Click); + // + // EditWatchToolStripButton1 + // + this.EditWatchToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.EditWatchToolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("EditWatchToolStripButton1.Image"))); + this.EditWatchToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.EditWatchToolStripButton1.Name = "EditWatchToolStripButton1"; + this.EditWatchToolStripButton1.Size = new System.Drawing.Size(23, 22); + this.EditWatchToolStripButton1.Text = "Edit Watch"; + this.EditWatchToolStripButton1.Click += new System.EventHandler(this.EditWatchMenuItem_Click); + // + // cutToolStripButton + // + this.cutToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.cutToolStripButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; + this.cutToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.cutToolStripButton.Name = "cutToolStripButton"; + this.cutToolStripButton.Size = new System.Drawing.Size(23, 22); + this.cutToolStripButton.Text = "C&ut"; + this.cutToolStripButton.ToolTipText = "Remove Watch"; + this.cutToolStripButton.Click += new System.EventHandler(this.RemoveWatchMenuItem_Click); + // + // ClearChangeCountstoolStripButton + // + this.ClearChangeCountstoolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.ClearChangeCountstoolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("ClearChangeCountstoolStripButton.Image"))); + this.ClearChangeCountstoolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ClearChangeCountstoolStripButton.Name = "ClearChangeCountstoolStripButton"; + this.ClearChangeCountstoolStripButton.Size = new System.Drawing.Size(23, 22); + this.ClearChangeCountstoolStripButton.Text = "C"; + this.ClearChangeCountstoolStripButton.ToolTipText = "Clear Change Counts"; + this.ClearChangeCountstoolStripButton.Click += new System.EventHandler(this.ClearChangeCountsMenuItem_Click); + // + // DuplicateWatchToolStripButton + // + this.DuplicateWatchToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.DuplicateWatchToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("DuplicateWatchToolStripButton.Image"))); + this.DuplicateWatchToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.DuplicateWatchToolStripButton.Name = "DuplicateWatchToolStripButton"; + this.DuplicateWatchToolStripButton.Size = new System.Drawing.Size(23, 22); + this.DuplicateWatchToolStripButton.Text = "Duplicate Watch"; + this.DuplicateWatchToolStripButton.Click += new System.EventHandler(this.DuplicateWatchMenuItem_Click); + // + // PoketoolStripButton2 + // + this.PoketoolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.PoketoolStripButton2.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke; + this.PoketoolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; + this.PoketoolStripButton2.Name = "PoketoolStripButton2"; + this.PoketoolStripButton2.Size = new System.Drawing.Size(23, 22); + this.PoketoolStripButton2.Text = "toolStripButton2"; + this.PoketoolStripButton2.ToolTipText = "Poke address"; + this.PoketoolStripButton2.Click += new System.EventHandler(this.PokeAddressMenuItem_Click); + // + // FreezetoolStripButton2 + // + this.FreezetoolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.FreezetoolStripButton2.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze; + this.FreezetoolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; + this.FreezetoolStripButton2.Name = "FreezetoolStripButton2"; + this.FreezetoolStripButton2.Size = new System.Drawing.Size(23, 22); + this.FreezetoolStripButton2.Text = "Freeze Address"; + this.FreezetoolStripButton2.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click); + // + // toolStripButton1 + // + this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; + this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Size = new System.Drawing.Size(23, 22); + this.toolStripButton1.Text = "-"; + this.toolStripButton1.ToolTipText = "Insert Separator"; + this.toolStripButton1.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click); + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25); + // + // MoveUpStripButton1 + // + this.MoveUpStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.MoveUpStripButton1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; + this.MoveUpStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.MoveUpStripButton1.Name = "MoveUpStripButton1"; + this.MoveUpStripButton1.Size = new System.Drawing.Size(23, 22); + this.MoveUpStripButton1.Text = "Move Up"; + this.MoveUpStripButton1.Click += new System.EventHandler(this.MoveUpMenuItem_Click); + // + // MoveDownStripButton1 + // + this.MoveDownStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.MoveDownStripButton1.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown; + this.MoveDownStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.MoveDownStripButton1.Name = "MoveDownStripButton1"; + this.MoveDownStripButton1.Size = new System.Drawing.Size(23, 22); + this.MoveDownStripButton1.Text = "Move Down"; + this.MoveDownStripButton1.Click += new System.EventHandler(this.MoveDownMenuItem_Click); + // + // menuStrip1 + // + this.menuStrip1.ClickThrough = true; + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.FileSubMenu, + this.WatchesSubMenu, + this.OptionsSubMenu, + this.ColumnsSubMenu}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(359, 24); + this.menuStrip1.TabIndex = 3; + this.menuStrip1.Text = "menuStrip1"; + // + // FileSubMenu + // + this.FileSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.NewListMenuItem, + this.OpenMenuItem, + this.SaveMenuItem, + this.SaveAsMenuItem, + this.AppendMenuItem, + this.RecentSubMenu, this.toolStripSeparator1, - this.exitToolStripMenuItem}); - this.filesToolStripMenuItem.Name = "filesToolStripMenuItem"; - this.filesToolStripMenuItem.Size = new System.Drawing.Size(42, 20); - this.filesToolStripMenuItem.Text = "&Files"; - this.filesToolStripMenuItem.DropDownOpened += new System.EventHandler(this.filesToolStripMenuItem_DropDownOpened); - // - // newListToolStripMenuItem - // - this.newListToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile; - this.newListToolStripMenuItem.Name = "newListToolStripMenuItem"; - this.newListToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newListToolStripMenuItem.Size = new System.Drawing.Size(195, 22); - this.newListToolStripMenuItem.Text = "&New List"; - this.newListToolStripMenuItem.Click += new System.EventHandler(this.newListToolStripMenuItem_Click); - // - // openToolStripMenuItem - // - this.openToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(195, 22); - this.openToolStripMenuItem.Text = "&Open..."; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - // - // saveToolStripMenuItem - // - this.saveToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs; - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(195, 22); - this.saveToolStripMenuItem.Text = "&Save"; - this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); - // - // saveAsToolStripMenuItem - // - this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + this.ExitMenuItem}); + this.FileSubMenu.Name = "FileSubMenu"; + this.FileSubMenu.Size = new System.Drawing.Size(42, 20); + this.FileSubMenu.Text = "&Files"; + this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened); + // + // NewListMenuItem + // + this.NewListMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile; + this.NewListMenuItem.Name = "NewListMenuItem"; + this.NewListMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.NewListMenuItem.Size = new System.Drawing.Size(195, 22); + this.NewListMenuItem.Text = "&New List"; + this.NewListMenuItem.Click += new System.EventHandler(this.NewListMenuItem_Click); + // + // OpenMenuItem + // + this.OpenMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; + this.OpenMenuItem.Name = "OpenMenuItem"; + this.OpenMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.OpenMenuItem.Size = new System.Drawing.Size(195, 22); + this.OpenMenuItem.Text = "&Open..."; + this.OpenMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click); + // + // SaveMenuItem + // + this.SaveMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs; + this.SaveMenuItem.Name = "SaveMenuItem"; + this.SaveMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.SaveMenuItem.Size = new System.Drawing.Size(195, 22); + this.SaveMenuItem.Text = "&Save"; + this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click); + // + // SaveAsMenuItem + // + this.SaveAsMenuItem.Name = "SaveAsMenuItem"; + this.SaveAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.S))); - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(195, 22); - this.saveAsToolStripMenuItem.Text = "Save &As..."; - this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); - // - // appendFileToolStripMenuItem - // - this.appendFileToolStripMenuItem.Name = "appendFileToolStripMenuItem"; - this.appendFileToolStripMenuItem.Size = new System.Drawing.Size(195, 22); - this.appendFileToolStripMenuItem.Text = "A&ppend File..."; - this.appendFileToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - // - // recentToolStripMenuItem - // - this.recentToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.SaveAsMenuItem.Size = new System.Drawing.Size(195, 22); + this.SaveAsMenuItem.Text = "Save &As..."; + this.SaveAsMenuItem.Click += new System.EventHandler(this.SaveAsMenuItem_Click); + // + // AppendMenuItem + // + this.AppendMenuItem.Name = "AppendMenuItem"; + this.AppendMenuItem.Size = new System.Drawing.Size(195, 22); + this.AppendMenuItem.Text = "A&ppend File..."; + this.AppendMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click); + // + // RecentSubMenu + // + this.RecentSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.noneToolStripMenuItem}); - this.recentToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent; - this.recentToolStripMenuItem.Name = "recentToolStripMenuItem"; - this.recentToolStripMenuItem.Size = new System.Drawing.Size(195, 22); - this.recentToolStripMenuItem.Text = "Recent"; - this.recentToolStripMenuItem.DropDownOpened += new System.EventHandler(this.recentToolStripMenuItem_DropDownOpened); - // - // noneToolStripMenuItem - // - this.noneToolStripMenuItem.Name = "noneToolStripMenuItem"; - this.noneToolStripMenuItem.Size = new System.Drawing.Size(103, 22); - this.noneToolStripMenuItem.Text = "None"; - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(192, 6); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.exitToolStripMenuItem.Size = new System.Drawing.Size(195, 22); - this.exitToolStripMenuItem.Text = "&Close"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); - // - // watchesToolStripMenuItem - // - this.watchesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.memoryDomainsToolStripMenuItem, + this.RecentSubMenu.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent; + this.RecentSubMenu.Name = "RecentSubMenu"; + this.RecentSubMenu.Size = new System.Drawing.Size(195, 22); + this.RecentSubMenu.Text = "Recent"; + this.RecentSubMenu.DropDownOpened += new System.EventHandler(this.RecentSubMenu_DropDownOpened); + // + // noneToolStripMenuItem + // + this.noneToolStripMenuItem.Name = "noneToolStripMenuItem"; + this.noneToolStripMenuItem.Size = new System.Drawing.Size(103, 22); + this.noneToolStripMenuItem.Text = "None"; + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(192, 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(195, 22); + this.ExitMenuItem.Text = "&Close"; + this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click); + // + // WatchesSubMenu + // + this.WatchesSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.MemoryDomainsSubMenu, this.toolStripSeparator8, - this.newWatchToolStripMenuItem, - this.editWatchToolStripMenuItem, - this.removeWatchToolStripMenuItem, - this.duplicateWatchToolStripMenuItem, - this.pokeAddressToolStripMenuItem, - this.freezeAddressToolStripMenuItem, - this.insertSeparatorToolStripMenuItem, - this.clearChangeCountsToolStripMenuItem, + this.NewWatchMenuItem, + this.EditWatchMenuItem, + this.RemoveWatchMenuItem, + this.DuplicateWatchMenuItem, + this.PokeAddressMenuItem, + this.FreezeAddressMenuItem, + this.InsertSeparatorMenuItem, + this.ClearChangeCountsMenuItem, this.toolStripSeparator3, - this.moveUpToolStripMenuItem, - this.moveDownToolStripMenuItem, - this.selectAllToolStripMenuItem}); - this.watchesToolStripMenuItem.Name = "watchesToolStripMenuItem"; - this.watchesToolStripMenuItem.Size = new System.Drawing.Size(64, 20); - this.watchesToolStripMenuItem.Text = "&Watches"; - this.watchesToolStripMenuItem.DropDownOpened += new System.EventHandler(this.watchesToolStripMenuItem_DropDownOpened); - // - // memoryDomainsToolStripMenuItem - // - this.memoryDomainsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.MoveUpMenuItem, + this.MoveDownMenuItem, + this.SelectAllMenuItem}); + this.WatchesSubMenu.Name = "WatchesSubMenu"; + this.WatchesSubMenu.Size = new System.Drawing.Size(64, 20); + this.WatchesSubMenu.Text = "&Watches"; + this.WatchesSubMenu.DropDownOpened += new System.EventHandler(this.WatchesSubMenu_DropDownOpened); + // + // MemoryDomainsSubMenu + // + this.MemoryDomainsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.Separator2}); - this.memoryDomainsToolStripMenuItem.Name = "memoryDomainsToolStripMenuItem"; - this.memoryDomainsToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.memoryDomainsToolStripMenuItem.Text = "Memory Domains"; - this.memoryDomainsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.memoryDomainsToolStripMenuItem_DropDownOpened); - // - // Separator2 - // - this.Separator2.Name = "Separator2"; - this.Separator2.Size = new System.Drawing.Size(57, 6); - // - // toolStripSeparator8 - // - this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(221, 6); - // - // newWatchToolStripMenuItem - // - this.newWatchToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.FindHS; - this.newWatchToolStripMenuItem.Name = "newWatchToolStripMenuItem"; - this.newWatchToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W))); - this.newWatchToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.newWatchToolStripMenuItem.Text = "&New Watch"; - this.newWatchToolStripMenuItem.Click += new System.EventHandler(this.newWatchToolStripMenuItem_Click); - // - // editWatchToolStripMenuItem - // - this.editWatchToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; - this.editWatchToolStripMenuItem.Name = "editWatchToolStripMenuItem"; - this.editWatchToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); - this.editWatchToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.editWatchToolStripMenuItem.Text = "&Edit Watch"; - this.editWatchToolStripMenuItem.Click += new System.EventHandler(this.editWatchToolStripMenuItem_Click); - // - // removeWatchToolStripMenuItem - // - this.removeWatchToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; - this.removeWatchToolStripMenuItem.Name = "removeWatchToolStripMenuItem"; - this.removeWatchToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); - this.removeWatchToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.removeWatchToolStripMenuItem.Text = "&Remove Watch"; - this.removeWatchToolStripMenuItem.Click += new System.EventHandler(this.removeWatchToolStripMenuItem_Click); - // - // duplicateWatchToolStripMenuItem - // - this.duplicateWatchToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate; - this.duplicateWatchToolStripMenuItem.Name = "duplicateWatchToolStripMenuItem"; - this.duplicateWatchToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D))); - this.duplicateWatchToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.duplicateWatchToolStripMenuItem.Text = "&Duplicate Watch"; - this.duplicateWatchToolStripMenuItem.Click += new System.EventHandler(this.duplicateWatchToolStripMenuItem_Click); - // - // pokeAddressToolStripMenuItem - // - this.pokeAddressToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke; - this.pokeAddressToolStripMenuItem.Name = "pokeAddressToolStripMenuItem"; - this.pokeAddressToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); - this.pokeAddressToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.pokeAddressToolStripMenuItem.Text = "Poke Address"; - this.pokeAddressToolStripMenuItem.Click += new System.EventHandler(this.pokeAddressToolStripMenuItem_Click); - // - // freezeAddressToolStripMenuItem - // - this.freezeAddressToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze; - this.freezeAddressToolStripMenuItem.Name = "freezeAddressToolStripMenuItem"; - this.freezeAddressToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); - this.freezeAddressToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.freezeAddressToolStripMenuItem.Text = "Freeze Address"; - this.freezeAddressToolStripMenuItem.Click += new System.EventHandler(this.freezeAddressToolStripMenuItem_Click); - // - // insertSeparatorToolStripMenuItem - // - this.insertSeparatorToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; - this.insertSeparatorToolStripMenuItem.Name = "insertSeparatorToolStripMenuItem"; - this.insertSeparatorToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I))); - this.insertSeparatorToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.insertSeparatorToolStripMenuItem.Text = "Insert Separator"; - this.insertSeparatorToolStripMenuItem.Click += new System.EventHandler(this.insertSeparatorToolStripMenuItem_Click); - // - // clearChangeCountsToolStripMenuItem - // - this.clearChangeCountsToolStripMenuItem.Name = "clearChangeCountsToolStripMenuItem"; - this.clearChangeCountsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.C))); - this.clearChangeCountsToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.clearChangeCountsToolStripMenuItem.Text = "&Clear Change Counts"; - this.clearChangeCountsToolStripMenuItem.Click += new System.EventHandler(this.clearChangeCountsToolStripMenuItem_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(221, 6); - // - // moveUpToolStripMenuItem - // - this.moveUpToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; - this.moveUpToolStripMenuItem.Name = "moveUpToolStripMenuItem"; - this.moveUpToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Up))); - this.moveUpToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.moveUpToolStripMenuItem.Text = "Move &Up"; - this.moveUpToolStripMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click); - // - // moveDownToolStripMenuItem - // - this.moveDownToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown; - this.moveDownToolStripMenuItem.Name = "moveDownToolStripMenuItem"; - this.moveDownToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Down))); - this.moveDownToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.moveDownToolStripMenuItem.Text = "Move &Down"; - this.moveDownToolStripMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click); - // - // selectAllToolStripMenuItem - // - this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; - this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); - this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(224, 22); - this.selectAllToolStripMenuItem.Text = "Select &All"; - this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); - // - // optionsToolStripMenuItem - // - this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.definePreviousValueAsToolStripMenuItem, - this.displayWatchesOnScreenToolStripMenuItem, - this.saveWindowPositionToolStripMenuItem, + this.MemoryDomainsSubMenu.Name = "MemoryDomainsSubMenu"; + this.MemoryDomainsSubMenu.Size = new System.Drawing.Size(224, 22); + this.MemoryDomainsSubMenu.Text = "Memory Domains"; + this.MemoryDomainsSubMenu.DropDownOpened += new System.EventHandler(this.MemoryDomainsSubMenu_DropDownOpened); + // + // Separator2 + // + this.Separator2.Name = "Separator2"; + this.Separator2.Size = new System.Drawing.Size(57, 6); + // + // toolStripSeparator8 + // + this.toolStripSeparator8.Name = "toolStripSeparator8"; + this.toolStripSeparator8.Size = new System.Drawing.Size(221, 6); + // + // NewWatchMenuItem + // + this.NewWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.FindHS; + this.NewWatchMenuItem.Name = "NewWatchMenuItem"; + this.NewWatchMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W))); + this.NewWatchMenuItem.Size = new System.Drawing.Size(224, 22); + this.NewWatchMenuItem.Text = "&New Watch"; + this.NewWatchMenuItem.Click += new System.EventHandler(this.NewWatchMenuItem_Click); + // + // EditWatchMenuItem + // + this.EditWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS; + this.EditWatchMenuItem.Name = "EditWatchMenuItem"; + this.EditWatchMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); + this.EditWatchMenuItem.Size = new System.Drawing.Size(224, 22); + this.EditWatchMenuItem.Text = "&Edit Watch"; + this.EditWatchMenuItem.Click += new System.EventHandler(this.EditWatchMenuItem_Click); + // + // RemoveWatchMenuItem + // + this.RemoveWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete; + this.RemoveWatchMenuItem.Name = "RemoveWatchMenuItem"; + this.RemoveWatchMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); + this.RemoveWatchMenuItem.Size = new System.Drawing.Size(224, 22); + this.RemoveWatchMenuItem.Text = "&Remove Watch"; + this.RemoveWatchMenuItem.Click += new System.EventHandler(this.RemoveWatchMenuItem_Click); + // + // DuplicateWatchMenuItem + // + this.DuplicateWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate; + this.DuplicateWatchMenuItem.Name = "DuplicateWatchMenuItem"; + this.DuplicateWatchMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D))); + this.DuplicateWatchMenuItem.Size = new System.Drawing.Size(224, 22); + this.DuplicateWatchMenuItem.Text = "&Duplicate Watch"; + this.DuplicateWatchMenuItem.Click += new System.EventHandler(this.DuplicateWatchMenuItem_Click); + // + // PokeAddressMenuItem + // + this.PokeAddressMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke; + this.PokeAddressMenuItem.Name = "PokeAddressMenuItem"; + this.PokeAddressMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.PokeAddressMenuItem.Size = new System.Drawing.Size(224, 22); + this.PokeAddressMenuItem.Text = "Poke Address"; + this.PokeAddressMenuItem.Click += new System.EventHandler(this.PokeAddressMenuItem_Click); + // + // FreezeAddressMenuItem + // + this.FreezeAddressMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze; + this.FreezeAddressMenuItem.Name = "FreezeAddressMenuItem"; + this.FreezeAddressMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); + this.FreezeAddressMenuItem.Size = new System.Drawing.Size(224, 22); + this.FreezeAddressMenuItem.Text = "Freeze Address"; + this.FreezeAddressMenuItem.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click); + // + // InsertSeparatorMenuItem + // + this.InsertSeparatorMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator; + this.InsertSeparatorMenuItem.Name = "InsertSeparatorMenuItem"; + this.InsertSeparatorMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I))); + this.InsertSeparatorMenuItem.Size = new System.Drawing.Size(224, 22); + this.InsertSeparatorMenuItem.Text = "Insert Separator"; + this.InsertSeparatorMenuItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click); + // + // ClearChangeCountsMenuItem + // + this.ClearChangeCountsMenuItem.Name = "ClearChangeCountsMenuItem"; + this.ClearChangeCountsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.C))); + this.ClearChangeCountsMenuItem.Size = new System.Drawing.Size(224, 22); + this.ClearChangeCountsMenuItem.Text = "&Clear Change Counts"; + this.ClearChangeCountsMenuItem.Click += new System.EventHandler(this.ClearChangeCountsMenuItem_Click); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(221, 6); + // + // MoveUpMenuItem + // + this.MoveUpMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp; + this.MoveUpMenuItem.Name = "MoveUpMenuItem"; + this.MoveUpMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Up))); + this.MoveUpMenuItem.Size = new System.Drawing.Size(224, 22); + this.MoveUpMenuItem.Text = "Move &Up"; + this.MoveUpMenuItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click); + // + // MoveDownMenuItem + // + this.MoveDownMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown; + this.MoveDownMenuItem.Name = "MoveDownMenuItem"; + this.MoveDownMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Down))); + this.MoveDownMenuItem.Size = new System.Drawing.Size(224, 22); + this.MoveDownMenuItem.Text = "Move &Down"; + this.MoveDownMenuItem.Click += new System.EventHandler(this.MoveDownMenuItem_Click); + // + // SelectAllMenuItem + // + this.SelectAllMenuItem.Name = "SelectAllMenuItem"; + this.SelectAllMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); + this.SelectAllMenuItem.Size = new System.Drawing.Size(224, 22); + this.SelectAllMenuItem.Text = "Select &All"; + this.SelectAllMenuItem.Click += new System.EventHandler(this.SelectAllMenuItem_Click); + // + // OptionsSubMenu + // + this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.DefinePreviousValueSubMenu, + this.WatchesOnScreenMenuItem, + this.SaveWindowPositionMenuItem, this.AlwaysOnTopMenuItem, this.toolStripSeparator7, - this.restoreWindowSizeToolStripMenuItem}); - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); - this.optionsToolStripMenuItem.Text = "&Options"; - this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened); - // - // definePreviousValueAsToolStripMenuItem - // - this.definePreviousValueAsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.previousFrameToolStripMenuItem, - this.lastChangeToolStripMenuItem, - this.originalToolStripMenuItem}); - this.definePreviousValueAsToolStripMenuItem.Name = "definePreviousValueAsToolStripMenuItem"; - this.definePreviousValueAsToolStripMenuItem.Size = new System.Drawing.Size(217, 22); - this.definePreviousValueAsToolStripMenuItem.Text = "Define Previous Value"; - this.definePreviousValueAsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.definePreviousValueAsToolStripMenuItem_DropDownOpened); - // - // previousFrameToolStripMenuItem - // - this.previousFrameToolStripMenuItem.Name = "previousFrameToolStripMenuItem"; - this.previousFrameToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.previousFrameToolStripMenuItem.Text = "Previous Frame"; - this.previousFrameToolStripMenuItem.Click += new System.EventHandler(this.previousFrameToolStripMenuItem_Click); - // - // lastChangeToolStripMenuItem - // - this.lastChangeToolStripMenuItem.Name = "lastChangeToolStripMenuItem"; - this.lastChangeToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.lastChangeToolStripMenuItem.Text = "Last Change"; - this.lastChangeToolStripMenuItem.Click += new System.EventHandler(this.lastChangeToolStripMenuItem_Click); - // - // originalToolStripMenuItem - // - this.originalToolStripMenuItem.Name = "originalToolStripMenuItem"; - this.originalToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.originalToolStripMenuItem.Text = "&Original"; - this.originalToolStripMenuItem.Click += new System.EventHandler(this.originalToolStripMenuItem_Click); - // - // displayWatchesOnScreenToolStripMenuItem - // - this.displayWatchesOnScreenToolStripMenuItem.Name = "displayWatchesOnScreenToolStripMenuItem"; - this.displayWatchesOnScreenToolStripMenuItem.Size = new System.Drawing.Size(217, 22); - this.displayWatchesOnScreenToolStripMenuItem.Text = "Display Watches On Screen"; - this.displayWatchesOnScreenToolStripMenuItem.Click += new System.EventHandler(this.displayWatchesOnScreenToolStripMenuItem_Click); - // - // saveWindowPositionToolStripMenuItem - // - this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem"; - this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(217, 22); - this.saveWindowPositionToolStripMenuItem.Text = "Save Window Position"; - this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click); - // - // AlwaysOnTopMenuItem - // - this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem"; - this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(217, 22); - this.AlwaysOnTopMenuItem.Text = "&Always On Top"; - this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click); - // - // toolStripSeparator7 - // - this.toolStripSeparator7.Name = "toolStripSeparator7"; - this.toolStripSeparator7.Size = new System.Drawing.Size(214, 6); - // - // restoreWindowSizeToolStripMenuItem - // - this.restoreWindowSizeToolStripMenuItem.Name = "restoreWindowSizeToolStripMenuItem"; - this.restoreWindowSizeToolStripMenuItem.Size = new System.Drawing.Size(217, 22); - this.restoreWindowSizeToolStripMenuItem.Text = "Restore Default Settings"; - this.restoreWindowSizeToolStripMenuItem.Click += new System.EventHandler(this.restoreWindowSizeToolStripMenuItem_Click); - // - // viewToolStripMenuItem - // - this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.RestoreWindowSizeMenuItem}); + 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); + // + // DefinePreviousValueSubMenu + // + this.DefinePreviousValueSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.PreviousFrameMenuItem, + this.LastChangeMenuItem, + this.OriginalMenuItem}); + this.DefinePreviousValueSubMenu.Name = "DefinePreviousValueSubMenu"; + this.DefinePreviousValueSubMenu.Size = new System.Drawing.Size(217, 22); + this.DefinePreviousValueSubMenu.Text = "Define Previous Value"; + this.DefinePreviousValueSubMenu.DropDownOpened += new System.EventHandler(this.DefinePreviousValueSubMenu_DropDownOpened); + // + // PreviousFrameMenuItem + // + this.PreviousFrameMenuItem.Name = "PreviousFrameMenuItem"; + this.PreviousFrameMenuItem.Size = new System.Drawing.Size(155, 22); + this.PreviousFrameMenuItem.Text = "Previous Frame"; + this.PreviousFrameMenuItem.Click += new System.EventHandler(this.PreviousFrameMenuItem_Click); + // + // LastChangeMenuItem + // + this.LastChangeMenuItem.Name = "LastChangeMenuItem"; + this.LastChangeMenuItem.Size = new System.Drawing.Size(155, 22); + this.LastChangeMenuItem.Text = "Last Change"; + this.LastChangeMenuItem.Click += new System.EventHandler(this.LastChangeMenuItem_Click); + // + // OriginalMenuItem + // + this.OriginalMenuItem.Name = "OriginalMenuItem"; + this.OriginalMenuItem.Size = new System.Drawing.Size(155, 22); + this.OriginalMenuItem.Text = "&Original"; + this.OriginalMenuItem.Click += new System.EventHandler(this.OriginalMenuItem_Click); + // + // WatchesOnScreenMenuItem + // + this.WatchesOnScreenMenuItem.Name = "WatchesOnScreenMenuItem"; + this.WatchesOnScreenMenuItem.Size = new System.Drawing.Size(217, 22); + this.WatchesOnScreenMenuItem.Text = "Display Watches On Screen"; + this.WatchesOnScreenMenuItem.Click += new System.EventHandler(this.WatchesOnScreenMenuItem_Click); + // + // SaveWindowPositionMenuItem + // + this.SaveWindowPositionMenuItem.Name = "SaveWindowPositionMenuItem"; + this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(217, 22); + this.SaveWindowPositionMenuItem.Text = "Save Window Position"; + this.SaveWindowPositionMenuItem.Click += new System.EventHandler(this.SaveWindowPositionMenuItem_Click); + // + // AlwaysOnTopMenuItem + // + this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem"; + this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(217, 22); + this.AlwaysOnTopMenuItem.Text = "&Always On Top"; + this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click); + // + // toolStripSeparator7 + // + this.toolStripSeparator7.Name = "toolStripSeparator7"; + this.toolStripSeparator7.Size = new System.Drawing.Size(214, 6); + // + // RestoreWindowSizeMenuItem + // + this.RestoreWindowSizeMenuItem.Name = "RestoreWindowSizeMenuItem"; + this.RestoreWindowSizeMenuItem.Size = new System.Drawing.Size(217, 22); + this.RestoreWindowSizeMenuItem.Text = "Restore Default Settings"; + this.RestoreWindowSizeMenuItem.Click += new System.EventHandler(this.RestoreWindowSizeMenuItem_Click); + // + // ColumnsSubMenu + // + this.ColumnsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ShowPreviousMenuItem, this.ShowChangesMenuItem, this.ShowDiffMenuItem, this.ShowDomainMenuItem}); - this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; - this.viewToolStripMenuItem.Size = new System.Drawing.Size(67, 20); - this.viewToolStripMenuItem.Text = "&Columns"; - this.viewToolStripMenuItem.DropDownOpened += new System.EventHandler(this.ColumnsSubMenu_DropDownOpened); - // - // ShowPreviousMenuItem - // - this.ShowPreviousMenuItem.Name = "ShowPreviousMenuItem"; - this.ShowPreviousMenuItem.Size = new System.Drawing.Size(156, 22); - this.ShowPreviousMenuItem.Text = "Previous Value"; - this.ShowPreviousMenuItem.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click); - // - // ShowChangesMenuItem - // - this.ShowChangesMenuItem.Checked = true; - this.ShowChangesMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.ShowChangesMenuItem.Name = "ShowChangesMenuItem"; - this.ShowChangesMenuItem.Size = new System.Drawing.Size(156, 22); - this.ShowChangesMenuItem.Text = "Change Counts"; - this.ShowChangesMenuItem.Click += new System.EventHandler(this.showChangeCountsToolStripMenuItem_Click); - // - // ShowDiffMenuItem - // - this.ShowDiffMenuItem.Name = "ShowDiffMenuItem"; - this.ShowDiffMenuItem.Size = new System.Drawing.Size(156, 22); - this.ShowDiffMenuItem.Text = "Difference"; - this.ShowDiffMenuItem.Click += new System.EventHandler(this.diffToolStripMenuItem_Click); - // - // ShowDomainMenuItem - // - this.ShowDomainMenuItem.Name = "ShowDomainMenuItem"; - this.ShowDomainMenuItem.Size = new System.Drawing.Size(156, 22); - this.ShowDomainMenuItem.Text = "Domain"; - this.ShowDomainMenuItem.Click += new System.EventHandler(this.domainToolStripMenuItem_Click); - // - // WatchListView - // - this.WatchListView.AllowColumnReorder = true; - this.WatchListView.AllowDrop = true; - this.WatchListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.ColumnsSubMenu.Name = "ColumnsSubMenu"; + this.ColumnsSubMenu.Size = new System.Drawing.Size(67, 20); + this.ColumnsSubMenu.Text = "&Columns"; + this.ColumnsSubMenu.DropDownOpened += new System.EventHandler(this.ColumnsSubMenu_DropDownOpened); + // + // ShowPreviousMenuItem + // + this.ShowPreviousMenuItem.Name = "ShowPreviousMenuItem"; + this.ShowPreviousMenuItem.Size = new System.Drawing.Size(156, 22); + this.ShowPreviousMenuItem.Text = "Previous Value"; + this.ShowPreviousMenuItem.Click += new System.EventHandler(this.ShowPreviousMenuItem_Click); + // + // ShowChangesMenuItem + // + this.ShowChangesMenuItem.Checked = true; + this.ShowChangesMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.ShowChangesMenuItem.Name = "ShowChangesMenuItem"; + this.ShowChangesMenuItem.Size = new System.Drawing.Size(156, 22); + this.ShowChangesMenuItem.Text = "Change Counts"; + this.ShowChangesMenuItem.Click += new System.EventHandler(this.ShowChangesMenuItem_Click); + // + // ShowDiffMenuItem + // + this.ShowDiffMenuItem.Name = "ShowDiffMenuItem"; + this.ShowDiffMenuItem.Size = new System.Drawing.Size(156, 22); + this.ShowDiffMenuItem.Text = "Difference"; + this.ShowDiffMenuItem.Click += new System.EventHandler(this.ShowDiffMenuItem_Click); + // + // ShowDomainMenuItem + // + this.ShowDomainMenuItem.Name = "ShowDomainMenuItem"; + this.ShowDomainMenuItem.Size = new System.Drawing.Size(156, 22); + this.ShowDomainMenuItem.Text = "Domain"; + this.ShowDomainMenuItem.Click += new System.EventHandler(this.ShowDomainMenuItem_Click); + // + // WatchListView + // + this.WatchListView.AllowColumnReorder = true; + this.WatchListView.AllowDrop = true; + this.WatchListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.WatchListView.AutoArrange = false; - this.WatchListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.WatchListView.AutoArrange = false; + this.WatchListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.AddressColumn, this.ValueColumn, this.PrevColumn, @@ -851,97 +851,97 @@ this.DiffColumn, this.DomainColumn, this.NotesColumn}); - this.WatchListView.ContextMenuStrip = this.contextMenuStrip1; - this.WatchListView.FullRowSelect = true; - this.WatchListView.GridLines = true; - this.WatchListView.HideSelection = false; - this.WatchListView.ItemCount = 0; - this.WatchListView.Location = new System.Drawing.Point(16, 76); - this.WatchListView.Name = "WatchListView"; - this.WatchListView.selectedItem = -1; - this.WatchListView.Size = new System.Drawing.Size(327, 281); - this.WatchListView.TabIndex = 2; - this.WatchListView.UseCompatibleStateImageBehavior = false; - this.WatchListView.View = System.Windows.Forms.View.Details; - this.WatchListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.WatchListView_ColumnClick); - this.WatchListView.ColumnReordered += new System.Windows.Forms.ColumnReorderedEventHandler(this.WatchListView_ColumnReordered); - this.WatchListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop); - this.WatchListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragEnter); - this.WatchListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.WatchListView_KeyDown); - this.WatchListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.WatchListView_MouseDoubleClick); - // - // AddressColumn - // - this.AddressColumn.Name = "AddressColumn"; - this.AddressColumn.Text = "Address"; - // - // ValueColumn - // - this.ValueColumn.Name = "ValueColumn"; - this.ValueColumn.Text = "Value"; - this.ValueColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.ValueColumn.Width = 59; - // - // PrevColumn - // - this.PrevColumn.Name = "PrevColumn"; - this.PrevColumn.Text = "Prev"; - this.PrevColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.PrevColumn.Width = 59; - // - // ChangesColumn - // - this.ChangesColumn.Name = "ChangesColumn"; - this.ChangesColumn.Text = "Changes"; - this.ChangesColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.ChangesColumn.Width = 54; - // - // DiffColumn - // - this.DiffColumn.Name = "DiffColumn"; - this.DiffColumn.Text = "Diff"; - this.DiffColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.DiffColumn.Width = 59; - // - // DomainColumn - // - this.DomainColumn.Name = "DomainColumn"; - this.DomainColumn.Text = "Domain"; - this.DomainColumn.Width = 55; - // - // NotesColumn - // - this.NotesColumn.Name = "NotesColumn"; - this.NotesColumn.Text = "Notes"; - this.NotesColumn.Width = 128; - // - // RamWatch - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(359, 378); - this.Controls.Add(this.MemDomainLabel); - this.Controls.Add(this.MessageLabel); - this.Controls.Add(this.WatchCountLabel); - this.Controls.Add(this.toolStrip1); - this.Controls.Add(this.menuStrip1); - this.Controls.Add(this.WatchListView); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "RamWatch"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Ram Watch"; - this.Activated += new System.EventHandler(this.NewRamWatch_Activated); - this.Load += new System.EventHandler(this.NewRamWatch_Load); - this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop); - this.DragEnter += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragEnter); - this.Enter += new System.EventHandler(this.NewRamWatch_Enter); - this.contextMenuStrip1.ResumeLayout(false); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.WatchListView.ContextMenuStrip = this.ListViewContextMenu; + this.WatchListView.FullRowSelect = true; + this.WatchListView.GridLines = true; + this.WatchListView.HideSelection = false; + this.WatchListView.ItemCount = 0; + this.WatchListView.Location = new System.Drawing.Point(16, 76); + this.WatchListView.Name = "WatchListView"; + this.WatchListView.selectedItem = -1; + this.WatchListView.Size = new System.Drawing.Size(327, 281); + this.WatchListView.TabIndex = 2; + this.WatchListView.UseCompatibleStateImageBehavior = false; + this.WatchListView.View = System.Windows.Forms.View.Details; + this.WatchListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.WatchListView_ColumnClick); + this.WatchListView.ColumnReordered += new System.Windows.Forms.ColumnReorderedEventHandler(this.WatchListView_ColumnReordered); + this.WatchListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop); + this.WatchListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragEnter); + this.WatchListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.WatchListView_KeyDown); + this.WatchListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.WatchListView_MouseDoubleClick); + // + // AddressColumn + // + this.AddressColumn.Name = "AddressColumn"; + this.AddressColumn.Text = "Address"; + // + // ValueColumn + // + this.ValueColumn.Name = "ValueColumn"; + this.ValueColumn.Text = "Value"; + this.ValueColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.ValueColumn.Width = 59; + // + // PrevColumn + // + this.PrevColumn.Name = "PrevColumn"; + this.PrevColumn.Text = "Prev"; + this.PrevColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.PrevColumn.Width = 59; + // + // ChangesColumn + // + this.ChangesColumn.Name = "ChangesColumn"; + this.ChangesColumn.Text = "Changes"; + this.ChangesColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.ChangesColumn.Width = 54; + // + // DiffColumn + // + this.DiffColumn.Name = "DiffColumn"; + this.DiffColumn.Text = "Diff"; + this.DiffColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.DiffColumn.Width = 59; + // + // DomainColumn + // + this.DomainColumn.Name = "DomainColumn"; + this.DomainColumn.Text = "Domain"; + this.DomainColumn.Width = 55; + // + // NotesColumn + // + this.NotesColumn.Name = "NotesColumn"; + this.NotesColumn.Text = "Notes"; + this.NotesColumn.Width = 128; + // + // RamWatch + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(359, 378); + this.Controls.Add(this.MemDomainLabel); + this.Controls.Add(this.MessageLabel); + this.Controls.Add(this.WatchCountLabel); + this.Controls.Add(this.toolStrip1); + this.Controls.Add(this.menuStrip1); + this.Controls.Add(this.WatchListView); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "RamWatch"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Ram Watch"; + this.Activated += new System.EventHandler(this.NewRamWatch_Activated); + this.Load += new System.EventHandler(this.NewRamWatch_Load); + this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop); + this.DragEnter += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragEnter); + this.Enter += new System.EventHandler(this.NewRamWatch_Enter); + this.ListViewContextMenu.ResumeLayout(false); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -956,44 +956,44 @@ private System.Windows.Forms.ColumnHeader DomainColumn; private System.Windows.Forms.ColumnHeader NotesColumn; private MenuStripEx menuStrip1; - private System.Windows.Forms.ToolStripMenuItem filesToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem newListToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem appendFileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem recentToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem FileSubMenu; + private System.Windows.Forms.ToolStripMenuItem NewListMenuItem; + private System.Windows.Forms.ToolStripMenuItem OpenMenuItem; + private System.Windows.Forms.ToolStripMenuItem SaveMenuItem; + private System.Windows.Forms.ToolStripMenuItem SaveAsMenuItem; + private System.Windows.Forms.ToolStripMenuItem AppendMenuItem; + private System.Windows.Forms.ToolStripMenuItem RecentSubMenu; private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem watchesToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem memoryDomainsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem ExitMenuItem; + private System.Windows.Forms.ToolStripMenuItem WatchesSubMenu; + private System.Windows.Forms.ToolStripMenuItem MemoryDomainsSubMenu; private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; - private System.Windows.Forms.ToolStripMenuItem newWatchToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem editWatchToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem removeWatchToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem duplicateWatchToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem pokeAddressToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem freezeAddressToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem insertSeparatorToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem clearChangeCountsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem NewWatchMenuItem; + private System.Windows.Forms.ToolStripMenuItem EditWatchMenuItem; + private System.Windows.Forms.ToolStripMenuItem RemoveWatchMenuItem; + private System.Windows.Forms.ToolStripMenuItem DuplicateWatchMenuItem; + private System.Windows.Forms.ToolStripMenuItem PokeAddressMenuItem; + private System.Windows.Forms.ToolStripMenuItem FreezeAddressMenuItem; + private System.Windows.Forms.ToolStripMenuItem InsertSeparatorMenuItem; + private System.Windows.Forms.ToolStripMenuItem ClearChangeCountsMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.ToolStripMenuItem moveUpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem moveDownToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem MoveUpMenuItem; + private System.Windows.Forms.ToolStripMenuItem MoveDownMenuItem; + private System.Windows.Forms.ToolStripMenuItem SelectAllMenuItem; + private System.Windows.Forms.ToolStripMenuItem ColumnsSubMenu; private System.Windows.Forms.ToolStripMenuItem ShowPreviousMenuItem; private System.Windows.Forms.ToolStripMenuItem ShowChangesMenuItem; private System.Windows.Forms.ToolStripMenuItem ShowDiffMenuItem; private System.Windows.Forms.ToolStripMenuItem ShowDomainMenuItem; - private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem definePreviousValueAsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem previousFrameToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem lastChangeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem displayWatchesOnScreenToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveWindowPositionToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem OptionsSubMenu; + private System.Windows.Forms.ToolStripMenuItem DefinePreviousValueSubMenu; + private System.Windows.Forms.ToolStripMenuItem PreviousFrameMenuItem; + private System.Windows.Forms.ToolStripMenuItem LastChangeMenuItem; + private System.Windows.Forms.ToolStripMenuItem WatchesOnScreenMenuItem; + private System.Windows.Forms.ToolStripMenuItem SaveWindowPositionMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; - private System.Windows.Forms.ToolStripMenuItem restoreWindowSizeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem RestoreWindowSizeMenuItem; private ToolStripEx toolStrip1; private System.Windows.Forms.ToolStripButton newToolStripButton; private System.Windows.Forms.ToolStripButton openToolStripButton; @@ -1014,8 +1014,8 @@ private System.Windows.Forms.Label MessageLabel; private System.Windows.Forms.Label MemDomainLabel; private System.Windows.Forms.ToolStripSeparator Separator2; - private System.Windows.Forms.ToolStripMenuItem originalToolStripMenuItem; - private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem OriginalMenuItem; + private System.Windows.Forms.ContextMenuStrip ListViewContextMenu; private System.Windows.Forms.ToolStripMenuItem EditContextMenuItem; private System.Windows.Forms.ToolStripMenuItem RemoveContextMenuItem; private System.Windows.Forms.ToolStripMenuItem DuplicateContextMenuItem; diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index 2188bbb0d8..e13b4ccf03 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -2,10 +2,10 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing; +using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; -using System.IO; using BizHawk.Client.Common; @@ -24,12 +24,67 @@ namespace BizHawk.Client.EmuHawk { WatchList.NOTES, 128 }, }; + private readonly WatchList _watches = new WatchList(Global.Emulator.MemoryDomains.MainMemory); + private int _defaultWidth; private int _defaultHeight; private string _sortedColumn = String.Empty; private bool _sortReverse; - private readonly WatchList _watches = new WatchList(Global.Emulator.MemoryDomains.MainMemory); + public RamWatch() + { + InitializeComponent(); + WatchListView.QueryItemText += WatchListView_QueryItemText; + WatchListView.QueryItemBkColor += WatchListView_QueryItemBkColor; + WatchListView.VirtualMode = true; + Closing += (o, e) => + { + if (AskSave()) + { + SaveConfigSettings(); + } + else + { + e.Cancel = true; + } + }; + _sortedColumn = String.Empty; + _sortReverse = false; + + TopMost = Global.Config.RamWatchAlwaysOnTop; + } + + private IEnumerable SelectedIndices + { + get { return WatchListView.SelectedIndices.Cast(); } + } + + private IEnumerable SelectedItems + { + get { return SelectedIndices.Select(index => _watches[index]); } + } + + private IEnumerable SelectedWatches + { + get { return SelectedItems.Where(x => !x.IsSeparator); } + } + + #region Properties + + public IEnumerable AddressList + { + get + { + return _watches.Where(x => !x.IsSeparator).Select(x => x.Address ?? 0); + } + } + + public bool UpdateBefore + { + get { return true; } + } + + #endregion #region API @@ -44,7 +99,7 @@ namespace BizHawk.Client.EmuHawk public bool AskSave() { - if (Global.Config.SupressAskSave) //User has elected to not be nagged + if (Global.Config.SupressAskSave) // User has elected to not be nagged { return true; } @@ -72,14 +127,6 @@ namespace BizHawk.Client.EmuHawk return true; } - public IEnumerable AddressList - { - get - { - return _watches.Where(x => !x.IsSeparator).Select(x => x.Address ?? 0).ToList(); - } - } - public void LoadFileFromRecent(string path) { var ask_result = true; @@ -128,29 +175,6 @@ namespace BizHawk.Client.EmuHawk } } - public RamWatch() - { - InitializeComponent(); - WatchListView.QueryItemText += WatchListView_QueryItemText; - WatchListView.QueryItemBkColor += WatchListView_QueryItemBkColor; - WatchListView.VirtualMode = true; - Closing += (o, e) => - { - if (AskSave()) - { - SaveConfigSettings(); - } - else - { - e.Cancel = true; - } - }; - _sortedColumn = String.Empty; - _sortReverse = false; - - TopMost = Global.Config.RamWatchAlwaysOnTop; - } - public void Restart() { if ((!IsHandleCreated || IsDisposed) && !Global.Config.DisplayRamWatch) @@ -168,8 +192,6 @@ namespace BizHawk.Client.EmuHawk } } - public bool UpdateBefore { get { return true; } } - public void UpdateValues() { if ((!IsHandleCreated || IsDisposed) && !Global.Config.DisplayRamWatch) @@ -185,11 +207,11 @@ namespace BizHawk.Client.EmuHawk { for (var x = 0; x < _watches.Count; x++) { - var alert = !_watches[x].IsSeparator && Global.CheatList.IsActive(_watches[x].Domain, (_watches[x].Address ?? 0)); + var alert = !_watches[x].IsSeparator && Global.CheatList.IsActive(_watches[x].Domain, _watches[x].Address ?? 0); GlobalWin.OSD.AddGUIText( _watches[x].ToString(), Global.Config.DispRamWatchx, - (Global.Config.DispRamWatchy + (x * 14)), + Global.Config.DispRamWatchy + (x * 14), alert, Color.Black, Color.White, @@ -198,8 +220,10 @@ namespace BizHawk.Client.EmuHawk } } - - if (!IsHandleCreated || IsDisposed) return; + if (!IsHandleCreated || IsDisposed) + { + return; + } WatchListView.BlazingFast = true; WatchListView.Refresh(); @@ -211,27 +235,6 @@ namespace BizHawk.Client.EmuHawk #region Private Methods - private void AddNewWatch() - { - var we = new WatchEditor - { - InitialLocation = GetPromptPoint() - }; - we.SetWatch(_watches.Domain); - GlobalWin.Sound.StopSound(); - we.ShowDialog(); - GlobalWin.Sound.StartSound(); - - if (we.DialogResult == DialogResult.OK) - { - _watches.Add(we.Watches[0]); - Changes(); - UpdateWatchCount(); - WatchListView.ItemCount = _watches.ItemCount; - UpdateValues(); - } - } - private void Changes() { _watches.Changes = true; @@ -240,15 +243,16 @@ namespace BizHawk.Client.EmuHawk private void ColumnPositions() { - var Columns = Global.Config.RamWatchColumnIndexes + var columns = Global.Config.RamWatchColumnIndexes .Where(x => WatchListView.Columns.ContainsKey(x.Key)) - .OrderBy(x => x.Value).ToList(); + .OrderBy(x => x.Value) + .ToList(); - for (var i = 0; i < Columns.Count; i++) + for (var i = 0; i < columns.Count; i++) { - if (WatchListView.Columns.ContainsKey(Columns[i].Key)) + if (WatchListView.Columns.ContainsKey(columns[i].Key)) { - WatchListView.Columns[Columns[i].Key].DisplayIndex = i; + WatchListView.Columns[columns[i].Key].DisplayIndex = i; } } } @@ -266,6 +270,7 @@ namespace BizHawk.Client.EmuHawk { sb.Append(GetColumnValue(column.Name, index)).Append('\t'); } + sb.Remove(sb.Length - 1, 1); sb.AppendLine(); } @@ -288,9 +293,7 @@ namespace BizHawk.Client.EmuHawk InitialLocation = GetPromptPoint(), }; - we.SetWatch(_watches.Domain, - SelectedWatches, duplicate ? WatchEditor.Mode.Duplicate : WatchEditor.Mode.Edit - ); + we.SetWatch(_watches.Domain, SelectedWatches, duplicate ? WatchEditor.Mode.Duplicate : WatchEditor.Mode.Edit); GlobalWin.Sound.StopSound(); var result = we.ShowDialog(); @@ -355,22 +358,6 @@ namespace BizHawk.Client.EmuHawk return PointToScreen(new Point(WatchListView.Location.X, WatchListView.Location.Y)); } - private void InsertSeparator() - { - var indexes = SelectedIndices.ToList(); - if (indexes.Any()) - { - _watches.Insert(indexes[0], SeparatorWatch.Instance); - } - else - { - _watches.Add(SeparatorWatch.Instance); - } - WatchListView.ItemCount = _watches.ItemCount; - Changes(); - UpdateWatchCount(); - } - private void LoadColumnInfo() { WatchListView.Columns.Clear(); @@ -387,8 +374,8 @@ namespace BizHawk.Client.EmuHawk private void LoadConfigSettings() { - //Size and Positioning - _defaultWidth = Size.Width; //Save these first so that the user can restore to its original size + // Size and Positioning + _defaultWidth = Size.Width; // Save these first so that the user can restore to its original size _defaultHeight = Size.Height; if (Global.Config.RamWatchSaveWindowPosition && Global.Config.RamWatchWndx >= 0 && Global.Config.RamWatchWndy >= 0) @@ -404,61 +391,6 @@ namespace BizHawk.Client.EmuHawk LoadColumnInfo(); } - private void MoveDown() - { - var indices = SelectedIndices.ToList(); - if (indices.Count == 0 || indices.Last() == _watches.Count - 1) - { - return; - } - - for (var i = indices.Count - 1; i >= 0; i--) - { - var watch = _watches[indices[i]]; - _watches.Remove(watch); - _watches.Insert(indices[i] + 1, watch); - } - - var newindices = indices.Select(t => t + 1).ToList(); - - WatchListView.SelectedIndices.Clear(); - foreach (var t in newindices) - { - WatchListView.SelectItem(t, true); - } - - Changes(); - WatchListView.ItemCount = _watches.ItemCount; - } - - private void MoveUp() - { - var indexes = SelectedIndices.ToList(); - if (!indexes.Any() || indexes[0] == 0) - { - return; - } - - foreach (var index in indexes) - { - var watch = _watches[index]; - _watches.Remove(watch); - _watches.Insert(index - 1, watch); - } - - Changes(); - - var indices = indexes.Select(t => t - 1).ToList(); - - WatchListView.SelectedIndices.Clear(); - foreach (var t in indices) - { - WatchListView.SelectItem(t, true); - } - - WatchListView.ItemCount = _watches.ItemCount; - } - private void NewWatchList(bool suppressAsk) { var result = true; @@ -493,46 +425,6 @@ namespace BizHawk.Client.EmuHawk WatchListView.Refresh(); } - private void PokeAddress() - { - if (SelectedWatches.Any()) - { - var poke = new RamPoke - { - InitialLocation = GetPromptPoint() - }; - - if (SelectedWatches.Any()) - { - poke.SetWatch(SelectedWatches); - } - - GlobalWin.Sound.StopSound(); - var result = poke.ShowDialog(); - if (result == DialogResult.OK) - { - UpdateValues(); - } - GlobalWin.Sound.StartSound(); - } - } - - private void RemoveWatch() - { - var items = SelectedItems.ToList(); - if (items.Any()) - { - foreach (var item in items) - { - _watches.Remove(item); - } - - WatchListView.ItemCount = _watches.ItemCount; - UpdateValues(); - UpdateWatchCount(); - } - } - private void SaveAs() { var result = _watches.SaveAs(ToolHelpers.GetWatchSaveFileFromUser(_watches.CurrentFileName)); @@ -597,29 +489,6 @@ namespace BizHawk.Client.EmuHawk Global.Config.RamWatchHeight = Bottom - Top; } - private void SelectAll() - { - for (var i = 0; i < _watches.Count; i++) - { - WatchListView.SelectItem(i, true); - } - } - - private IEnumerable SelectedIndices - { - get { return WatchListView.SelectedIndices.Cast(); } - } - - private IEnumerable SelectedItems - { - get { return SelectedIndices.Select(index => _watches[index]); } - } - - private IEnumerable SelectedWatches - { - get { return SelectedItems.Where(x => !x.IsSeparator); } - } - private void SetMemoryDomain(string name) { _watches.Domain = Global.Emulator.MemoryDomains[name]; @@ -683,6 +552,7 @@ namespace BizHawk.Client.EmuHawk { return; } + var columnName = WatchListView.Columns[column].Name; switch (columnName) @@ -701,6 +571,7 @@ namespace BizHawk.Client.EmuHawk { text = _watches[index].ChangeCount.ToString(); } + break; case WatchList.DIFF: text = _watches[index].Diff; @@ -718,54 +589,25 @@ namespace BizHawk.Client.EmuHawk #region Winform Events - private void NewRamWatch_Load(object sender, EventArgs e) + #region File Menu + + private void FileSubMenu_DropDownOpened(object sender, EventArgs e) { - LoadConfigSettings(); + SaveMenuItem.Enabled = _watches.Changes; } - private void NewRamWatch_Activated(object sender, EventArgs e) - { - WatchListView.Refresh(); - } - - private void NewRamWatch_DragEnter(object sender, DragEventArgs e) - { - e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None; - } - - private void NewRamWatch_DragDrop(object sender, DragEventArgs e) - { - var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); - if (Path.GetExtension(filePaths[0]) == (".wch")) - { - _watches.Load(filePaths[0], append:false); - WatchListView.ItemCount = _watches.ItemCount; - } - } - - private void NewRamWatch_Enter(object sender, EventArgs e) - { - WatchListView.Focus(); - } - - /*************File***********************/ - private void filesToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - saveToolStripMenuItem.Enabled = _watches.Changes; - } - - private void newListToolStripMenuItem_Click(object sender, EventArgs e) + private void NewListMenuItem_Click(object sender, EventArgs e) { NewWatchList(false); } - private void openToolStripMenuItem_Click(object sender, EventArgs e) + private void OpenMenuItem_Click(object sender, EventArgs e) { - var append = sender == appendFileToolStripMenuItem; + var append = sender == AppendMenuItem; LoadWatchFile(ToolHelpers.GetWatchFileFromUser(_watches.CurrentFileName), append); } - private void saveToolStripMenuItem_Click(object sender, EventArgs e) + private void SaveMenuItem_Click(object sender, EventArgs e) { if (!String.IsNullOrWhiteSpace(_watches.CurrentFileName)) { @@ -780,79 +622,121 @@ namespace BizHawk.Client.EmuHawk } } - private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) + private void SaveAsMenuItem_Click(object sender, EventArgs e) { SaveAs(); } - private void recentToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + private void RecentSubMenu_DropDownOpened(object sender, EventArgs e) { - recentToolStripMenuItem.DropDownItems.Clear(); - recentToolStripMenuItem.DropDownItems.AddRange( + RecentSubMenu.DropDownItems.Clear(); + RecentSubMenu.DropDownItems.AddRange( ToolHelpers.GenerateRecentMenu(Global.Config.RecentWatches, LoadFileFromRecent) ); - recentToolStripMenuItem.DropDownItems.Add( + RecentSubMenu.DropDownItems.Add( ToolHelpers.GenerateAutoLoadItem(Global.Config.RecentWatches) ); } - private void exitToolStripMenuItem_Click(object sender, EventArgs e) + private void ExitMenuItem_Click(object sender, EventArgs e) { - if (!AskSave()) - { - return; - } - else - { - Close(); - } + Close(); } - /*************Watches***********************/ - private void watchesToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + #endregion + + #region Watch + + private void WatchesSubMenu_DropDownOpened(object sender, EventArgs e) { - editWatchToolStripMenuItem.Enabled = - duplicateWatchToolStripMenuItem.Enabled = - removeWatchToolStripMenuItem.Enabled = - moveUpToolStripMenuItem.Enabled = - moveDownToolStripMenuItem.Enabled = - pokeAddressToolStripMenuItem.Enabled = - freezeAddressToolStripMenuItem.Enabled = + EditWatchMenuItem.Enabled = + DuplicateWatchMenuItem.Enabled = + RemoveWatchMenuItem.Enabled = + MoveUpMenuItem.Enabled = + MoveDownMenuItem.Enabled = + PokeAddressMenuItem.Enabled = + FreezeAddressMenuItem.Enabled = SelectedIndices.Any(); } - private void memoryDomainsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + private void MemoryDomainsSubMenu_DropDownOpened(object sender, EventArgs e) { - memoryDomainsToolStripMenuItem.DropDownItems.Clear(); - memoryDomainsToolStripMenuItem.DropDownItems.AddRange(ToolHelpers.GenerateMemoryDomainMenuItems(SetMemoryDomain, _watches.Domain.Name).ToArray()); + MemoryDomainsSubMenu.DropDownItems.Clear(); + MemoryDomainsSubMenu.DropDownItems.AddRange(ToolHelpers.GenerateMemoryDomainMenuItems(SetMemoryDomain, _watches.Domain.Name).ToArray()); } - private void newWatchToolStripMenuItem_Click(object sender, EventArgs e) + private void NewWatchMenuItem_Click(object sender, EventArgs e) { - AddNewWatch(); + var we = new WatchEditor + { + InitialLocation = GetPromptPoint() + }; + we.SetWatch(_watches.Domain); + GlobalWin.Sound.StopSound(); + we.ShowDialog(); + GlobalWin.Sound.StartSound(); + + if (we.DialogResult == DialogResult.OK) + { + _watches.Add(we.Watches[0]); + Changes(); + UpdateWatchCount(); + WatchListView.ItemCount = _watches.ItemCount; + UpdateValues(); + } } - private void editWatchToolStripMenuItem_Click(object sender, EventArgs e) + private void EditWatchMenuItem_Click(object sender, EventArgs e) { EditWatch(); } - private void removeWatchToolStripMenuItem_Click(object sender, EventArgs e) + private void RemoveWatchMenuItem_Click(object sender, EventArgs e) { - RemoveWatch(); + var items = SelectedItems.ToList(); + if (items.Any()) + { + foreach (var item in items) + { + _watches.Remove(item); + } + + WatchListView.ItemCount = _watches.ItemCount; + UpdateValues(); + UpdateWatchCount(); + } } - private void duplicateWatchToolStripMenuItem_Click(object sender, EventArgs e) + private void DuplicateWatchMenuItem_Click(object sender, EventArgs e) { EditWatch(duplicate: true); } - private void pokeAddressToolStripMenuItem_Click(object sender, EventArgs e) + private void PokeAddressMenuItem_Click(object sender, EventArgs e) { - PokeAddress(); + if (SelectedWatches.Any()) + { + var poke = new RamPoke + { + InitialLocation = GetPromptPoint() + }; + + if (SelectedWatches.Any()) + { + poke.SetWatch(SelectedWatches); + } + + GlobalWin.Sound.StopSound(); + if (poke.ShowDialog() == DialogResult.OK) + { + UpdateValues(); + } + + GlobalWin.Sound.StartSound(); + } } - private void freezeAddressToolStripMenuItem_Click(object sender, EventArgs e) + private void FreezeAddressMenuItem_Click(object sender, EventArgs e) { var allCheats = SelectedWatches.All(watch => !Global.CheatList.IsActive(watch.Domain, watch.Address ?? 0)); if (allCheats) @@ -865,116 +749,125 @@ namespace BizHawk.Client.EmuHawk } } - private void insertSeparatorToolStripMenuItem_Click(object sender, EventArgs e) + private void InsertSeparatorMenuItem_Click(object sender, EventArgs e) { - InsertSeparator(); + var indexes = SelectedIndices.ToList(); + if (indexes.Any()) + { + _watches.Insert(indexes[0], SeparatorWatch.Instance); + } + else + { + _watches.Add(SeparatorWatch.Instance); + } + + WatchListView.ItemCount = _watches.ItemCount; + Changes(); + UpdateWatchCount(); } - private void clearChangeCountsToolStripMenuItem_Click(object sender, EventArgs e) + private void ClearChangeCountsMenuItem_Click(object sender, EventArgs e) { _watches.ClearChangeCounts(); } - private void moveUpToolStripMenuItem_Click(object sender, EventArgs e) + private void MoveUpMenuItem_Click(object sender, EventArgs e) { - MoveUp(); - } - - private void moveDownToolStripMenuItem_Click(object sender, EventArgs e) - { - MoveDown(); - } - - private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) - { - SelectAll(); - } - - /*************Columns***********************/ - private void ColumnsSubMenu_DropDownOpened(object sender, EventArgs e) - { - ShowPreviousMenuItem.Checked = Global.Config.RamWatchShowPrevColumn; - ShowChangesMenuItem.Checked = Global.Config.RamWatchShowChangeColumn; - ShowDiffMenuItem.Checked = Global.Config.RamWatchShowDiffColumn; - ShowDomainMenuItem.Checked = Global.Config.RamWatchShowDomainColumn; - } - - private void showPreviousValueToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.RamWatchShowPrevColumn ^= true; - SaveColumnInfo(); - LoadColumnInfo(); - } - - private void showChangeCountsToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.RamWatchShowChangeColumn ^= true; - - SaveColumnInfo(); - LoadColumnInfo(); - } - - private void diffToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.RamWatchShowDiffColumn ^= true; - - SaveColumnInfo(); - LoadColumnInfo(); - } - - private void domainToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.RamWatchShowDomainColumn ^= true; - - SaveColumnInfo(); - LoadColumnInfo(); - } - - /*************Options***********************/ - private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - displayWatchesOnScreenToolStripMenuItem.Checked = Global.Config.DisplayRamWatch; - saveWindowPositionToolStripMenuItem.Checked = Global.Config.RamWatchSaveWindowPosition; - AlwaysOnTopMenuItem.Checked = Global.Config.RamWatchAlwaysOnTop; - } - - private void definePreviousValueAsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - lastChangeToolStripMenuItem.Checked = false; - previousFrameToolStripMenuItem.Checked = false; - originalToolStripMenuItem.Checked = false; - - switch (Global.Config.RamWatchDefinePrevious) + var indexes = SelectedIndices.ToList(); + if (!indexes.Any() || indexes[0] == 0) { - default: - case Watch.PreviousType.LastFrame: - previousFrameToolStripMenuItem.Checked = true; - break; - case Watch.PreviousType.LastChange: - lastChangeToolStripMenuItem.Checked = true; - break; - case Watch.PreviousType.Original: - originalToolStripMenuItem.Checked = true; - break; + return; + } + + foreach (var index in indexes) + { + var watch = _watches[index]; + _watches.Remove(watch); + _watches.Insert(index - 1, watch); + } + + Changes(); + + var indices = indexes.Select(t => t - 1).ToList(); + + WatchListView.SelectedIndices.Clear(); + foreach (var t in indices) + { + WatchListView.SelectItem(t, true); + } + + WatchListView.ItemCount = _watches.ItemCount; + } + + private void MoveDownMenuItem_Click(object sender, EventArgs e) + { + var indices = SelectedIndices.ToList(); + if (indices.Count == 0 || indices.Last() == _watches.Count - 1) + { + return; + } + + for (var i = indices.Count - 1; i >= 0; i--) + { + var watch = _watches[indices[i]]; + _watches.Remove(watch); + _watches.Insert(indices[i] + 1, watch); + } + + var newindices = indices.Select(t => t + 1).ToList(); + + WatchListView.SelectedIndices.Clear(); + foreach (var t in newindices) + { + WatchListView.SelectItem(t, true); + } + + Changes(); + WatchListView.ItemCount = _watches.ItemCount; + } + + private void SelectAllMenuItem_Click(object sender, EventArgs e) + { + for (var i = 0; i < _watches.Count; i++) + { + WatchListView.SelectItem(i, true); } } - private void previousFrameToolStripMenuItem_Click(object sender, EventArgs e) + #endregion + + #region Options + + private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) + { + WatchesOnScreenMenuItem.Checked = Global.Config.DisplayRamWatch; + SaveWindowPositionMenuItem.Checked = Global.Config.RamWatchSaveWindowPosition; + AlwaysOnTopMenuItem.Checked = Global.Config.RamWatchAlwaysOnTop; + } + + private void DefinePreviousValueSubMenu_DropDownOpened(object sender, EventArgs e) + { + PreviousFrameMenuItem.Checked = Global.Config.RamWatchDefinePrevious == Watch.PreviousType.LastFrame; + LastChangeMenuItem.Checked = Global.Config.RamWatchDefinePrevious == Watch.PreviousType.LastChange; + OriginalMenuItem.Checked = Global.Config.RamWatchDefinePrevious == Watch.PreviousType.Original; + } + + private void PreviousFrameMenuItem_Click(object sender, EventArgs e) { Global.Config.RamWatchDefinePrevious = Watch.PreviousType.LastFrame; } - private void lastChangeToolStripMenuItem_Click(object sender, EventArgs e) + private void LastChangeMenuItem_Click(object sender, EventArgs e) { Global.Config.RamWatchDefinePrevious = Watch.PreviousType.LastChange; } - private void originalToolStripMenuItem_Click(object sender, EventArgs e) + private void OriginalMenuItem_Click(object sender, EventArgs e) { Global.Config.RamWatchDefinePrevious = Watch.PreviousType.Original; } - private void displayWatchesOnScreenToolStripMenuItem_Click(object sender, EventArgs e) + private void WatchesOnScreenMenuItem_Click(object sender, EventArgs e) { Global.Config.DisplayRamWatch ^= true; @@ -988,7 +881,7 @@ namespace BizHawk.Client.EmuHawk } } - private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e) + private void SaveWindowPositionMenuItem_Click(object sender, EventArgs e) { Global.Config.RamWatchSaveWindowPosition ^= true; } @@ -999,7 +892,7 @@ namespace BizHawk.Client.EmuHawk TopMost = Global.Config.RamWatchAlwaysOnTop; } - private void restoreWindowSizeToolStripMenuItem_Click(object sender, EventArgs e) + private void RestoreWindowSizeMenuItem_Click(object sender, EventArgs e) { Size = new Size(_defaultWidth, _defaultHeight); @@ -1023,9 +916,9 @@ namespace BizHawk.Client.EmuHawk WatchListView.Columns[WatchList.ADDRESS].Width = _defaultColumnWidths[WatchList.ADDRESS]; WatchListView.Columns[WatchList.VALUE].Width = _defaultColumnWidths[WatchList.VALUE]; - //WatchListView.Columns[WatchList.PREV].Width = DefaultColumnWidths[WatchList.PREV]; + // WatchListView.Columns[WatchList.PREV].Width = DefaultColumnWidths[WatchList.PREV]; WatchListView.Columns[WatchList.CHANGES].Width = _defaultColumnWidths[WatchList.CHANGES]; - //WatchListView.Columns[WatchList.DIFF].Width = DefaultColumnWidths[WatchList.DIFF]; + // WatchListView.Columns[WatchList.DIFF].Width = DefaultColumnWidths[WatchList.DIFF]; WatchListView.Columns[WatchList.DOMAIN].Width = _defaultColumnWidths[WatchList.DOMAIN]; WatchListView.Columns[WatchList.NOTES].Width = _defaultColumnWidths[WatchList.NOTES]; @@ -1036,8 +929,84 @@ namespace BizHawk.Client.EmuHawk LoadColumnInfo(); } - /*************Context Menu***********************/ - private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) + #endregion + + #region Columns + + private void ColumnsSubMenu_DropDownOpened(object sender, EventArgs e) + { + ShowPreviousMenuItem.Checked = Global.Config.RamWatchShowPrevColumn; + ShowChangesMenuItem.Checked = Global.Config.RamWatchShowChangeColumn; + ShowDiffMenuItem.Checked = Global.Config.RamWatchShowDiffColumn; + ShowDomainMenuItem.Checked = Global.Config.RamWatchShowDomainColumn; + } + + private void ShowPreviousMenuItem_Click(object sender, EventArgs e) + { + Global.Config.RamWatchShowPrevColumn ^= true; + SaveColumnInfo(); + LoadColumnInfo(); + } + + private void ShowChangesMenuItem_Click(object sender, EventArgs e) + { + Global.Config.RamWatchShowChangeColumn ^= true; + + SaveColumnInfo(); + LoadColumnInfo(); + } + + private void ShowDiffMenuItem_Click(object sender, EventArgs e) + { + Global.Config.RamWatchShowDiffColumn ^= true; + + SaveColumnInfo(); + LoadColumnInfo(); + } + + private void ShowDomainMenuItem_Click(object sender, EventArgs e) + { + Global.Config.RamWatchShowDomainColumn ^= true; + + SaveColumnInfo(); + LoadColumnInfo(); + } + + #endregion + + #region Dialog, Context Menu, and ListView Events + + private void NewRamWatch_Load(object sender, EventArgs e) + { + LoadConfigSettings(); + } + + private void NewRamWatch_Activated(object sender, EventArgs e) + { + WatchListView.Refresh(); + } + + private void NewRamWatch_DragEnter(object sender, DragEventArgs e) + { + e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None; + } + + private void NewRamWatch_DragDrop(object sender, DragEventArgs e) + { + var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop); + if (Path.GetExtension(filePaths[0]) == ".wch") + { + _watches.Load(filePaths[0], append: false); + WatchListView.ItemCount = _watches.ItemCount; + } + } + + private void NewRamWatch_Enter(object sender, EventArgs e) + { + WatchListView.Focus(); + } + + private void ListViewContextMenu_Opening(object sender, CancelEventArgs e) { var indexes = WatchListView.SelectedIndices; @@ -1054,7 +1023,6 @@ namespace BizHawk.Client.EmuHawk toolStripSeparator4.Visible = indexes.Count > 0; - var allCheats = _watches.All(x => Global.CheatList.IsActive(x.Domain, x.Address ?? 0)); if (allCheats) @@ -1101,26 +1069,24 @@ namespace BizHawk.Client.EmuHawk } } - /*************ListView Events***********************/ - private void WatchListView_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && !e.Control && !e.Alt && !e.Shift) { - RemoveWatch(); + RemoveWatchMenuItem_Click(sender, e); } - else if (e.KeyCode == Keys.A && e.Control && !e.Alt && !e.Shift) //Select All + else if (e.KeyCode == Keys.A && e.Control && !e.Alt && !e.Shift) // Select All { for (var x = 0; x < _watches.Count; x++) { WatchListView.SelectItem(x, true); } } - else if (e.KeyCode == Keys.C && e.Control && !e.Alt && !e.Shift) //Copy + else if (e.KeyCode == Keys.C && e.Control && !e.Alt && !e.Shift) // Copy { CopyWatchesToClipBoard(); } - else if (e.KeyCode == Keys.Enter && !e.Control && !e.Alt && !e.Shift) //Enter + else if (e.KeyCode == Keys.Enter && !e.Control && !e.Alt && !e.Shift) // Enter { EditWatch(); } @@ -1148,5 +1114,7 @@ namespace BizHawk.Client.EmuHawk } #endregion + + #endregion } } diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.resx b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.resx index 6026cb63ff..8aa260f851 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.resx +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.resx @@ -117,7 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 336, 17 diff --git a/BizHawk.Common/Buffer.cs b/BizHawk.Common/Buffer.cs index 6103add9eb..d153c8ec54 100644 --- a/BizHawk.Common/Buffer.cs +++ b/BizHawk.Common/Buffer.cs @@ -8,53 +8,53 @@ namespace BizHawk.Common /// public unsafe class CBuffer : IDisposable { - public GCHandle hnd; - public T[] arr; - public void* ptr; - public byte* byteptr; - public int len; - public int itemsize; + public GCHandle Hnd; + public T[] Arr; + public void* Ptr; + public byte* Byteptr; + public int Len; + public int Itemsize; public static CBuffer malloc(int amt, int itemsize) { return new CBuffer(amt, itemsize); } - public void Write08(uint addr, byte val) { byteptr[addr] = val; } - public void Write16(uint addr, ushort val) { *(ushort*)(byteptr + addr) = val; } - public void Write32(uint addr, uint val) { *(uint*)(byteptr + addr) = val; } - public void Write64(uint addr, ulong val) { *(ulong*)(byteptr + addr) = val; } - public byte Read08(uint addr) { return byteptr[addr]; } - public ushort Read16(uint addr) { return *(ushort*)(byteptr + addr); } - public uint Read32(uint addr) { return *(uint*)(byteptr + addr); } - public ulong Read64(uint addr) { return *(ulong*)(byteptr + addr); } - public void Write08(int addr, byte val) { byteptr[addr] = val; } - public void Write16(int addr, ushort val) { *(ushort*)(byteptr + addr) = val; } - public void Write32(int addr, uint val) { *(uint*)(byteptr + addr) = val; } - public void Write64(int addr, ulong val) { *(ulong*)(byteptr + addr) = val; } - public byte Read08(int addr) { return byteptr[addr]; } - public ushort Read16(int addr) { return *(ushort*)(byteptr + addr); } - public uint Read32(int addr) { return *(uint*)(byteptr + addr); } - public ulong Read64(int addr) { return *(ulong*)(byteptr + addr); } + public void Write08(uint addr, byte val) { this.Byteptr[addr] = val; } + public void Write16(uint addr, ushort val) { *(ushort*)(this.Byteptr + addr) = val; } + public void Write32(uint addr, uint val) { *(uint*)(this.Byteptr + addr) = val; } + public void Write64(uint addr, ulong val) { *(ulong*)(this.Byteptr + addr) = val; } + public byte Read08(uint addr) { return this.Byteptr[addr]; } + public ushort Read16(uint addr) { return *(ushort*)(this.Byteptr + addr); } + public uint Read32(uint addr) { return *(uint*)(this.Byteptr + addr); } + public ulong Read64(uint addr) { return *(ulong*)(this.Byteptr + addr); } + public void Write08(int addr, byte val) { this.Byteptr[addr] = val; } + public void Write16(int addr, ushort val) { *(ushort*)(this.Byteptr + addr) = val; } + public void Write32(int addr, uint val) { *(uint*)(this.Byteptr + addr) = val; } + public void Write64(int addr, ulong val) { *(ulong*)(this.Byteptr + addr) = val; } + public byte Read08(int addr) { return this.Byteptr[addr]; } + public ushort Read16(int addr) { return *(ushort*)(this.Byteptr + addr); } + public uint Read32(int addr) { return *(uint*)(this.Byteptr + addr); } + public ulong Read64(int addr) { return *(ulong*)(this.Byteptr + addr); } public CBuffer(T[] arr, int itemsize) { - this.itemsize = itemsize; - len = arr.Length; - this.arr = arr; - hnd = GCHandle.Alloc(arr, GCHandleType.Pinned); - ptr = hnd.AddrOfPinnedObject().ToPointer(); - byteptr = (byte*)ptr; + this.Itemsize = itemsize; + this.Len = arr.Length; + this.Arr = arr; + this.Hnd = GCHandle.Alloc(arr, GCHandleType.Pinned); + this.Ptr = this.Hnd.AddrOfPinnedObject().ToPointer(); + this.Byteptr = (byte*)this.Ptr; } public CBuffer(int amt, int itemsize) { - this.itemsize = itemsize; - len = amt; - arr = new T[amt]; - hnd = GCHandle.Alloc(arr, GCHandleType.Pinned); - ptr = hnd.AddrOfPinnedObject().ToPointer(); - byteptr = (byte*)ptr; - Util.memset(byteptr, 0, len * itemsize); + this.Itemsize = itemsize; + this.Len = amt; + this.Arr = new T[amt]; + this.Hnd = GCHandle.Alloc(this.Arr, GCHandleType.Pinned); + this.Ptr = this.Hnd.AddrOfPinnedObject().ToPointer(); + this.Byteptr = (byte*)this.Ptr; + Util.memset(this.Byteptr, 0, this.Len * itemsize); } public void Dispose() @@ -67,11 +67,11 @@ namespace BizHawk.Common { if (disposing) { - if (arr != null) + if (this.Arr != null) { - hnd.Free(); + this.Hnd.Free(); } - arr = null; + this.Arr = null; } } @@ -85,8 +85,8 @@ namespace BizHawk.Common public byte this[int index] { #if DEBUG - get { return arr[index]; } - set { arr[index] = value; } + get { return this.Arr[index]; } + set { this.Arr[index] = value; } #else set { Write08(index, value); } get { return Read08(index);} @@ -101,8 +101,8 @@ namespace BizHawk.Common public int this[int index] { #if DEBUG - get { return arr[index]; } - set { arr[index] = value; } + get { return this.Arr[index]; } + set { this.Arr[index] = value; } #else set { Write32(index<<2, (uint) value); } get { return (int)Read32(index<<2);} @@ -117,8 +117,8 @@ namespace BizHawk.Common public short this[int index] { #if DEBUG - get { return arr[index]; } - set { arr[index] = value; } + get { return this.Arr[index]; } + set { this.Arr[index] = value; } #else set { Write32(index << 1, (uint)value); } get { return (short)Read16(index << 1); } diff --git a/BizHawk.Common/Util.cs b/BizHawk.Common/Util.cs index b85fdcb8d6..97c4ffbaf1 100644 --- a/BizHawk.Common/Util.cs +++ b/BizHawk.Common/Util.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using System.Text; using System.Runtime.Serialization; +using System.Text; namespace BizHawk.Common { @@ -98,9 +98,12 @@ namespace BizHawk.Common /// public static string BytesToHexString(byte[] bytes) { - StringBuilder sb = new StringBuilder(); - foreach (byte b in bytes) + var sb = new StringBuilder(); + foreach (var b in bytes) + { sb.AppendFormat("{0:X2}", b); + } + return sb.ToString(); } @@ -524,12 +527,12 @@ namespace BizHawk.Common public void Sync(string name, ref ByteBuffer byteBuf) { - SyncBuffer(name, 1, byteBuf.len, byteBuf.ptr); + SyncBuffer(name, 1, byteBuf.Len, byteBuf.Ptr); } public void Sync(string name, ref IntBuffer byteBuf) { - SyncBuffer(name, 4, byteBuf.len, byteBuf.ptr); + SyncBuffer(name, 4, byteBuf.Len, byteBuf.Ptr); } public void Sync(string name, ref byte[] val, bool use_null) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/SaveState.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/SaveState.cs index 65db8bc4d0..afec4775d0 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/SaveState.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/SaveState.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; using System.Drawing; -using System.Linq; using System.Reflection; -using System.Text; using BizHawk.Common; @@ -79,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 case "Byte[]": refByteBuffer = new ByteBuffer((byte[])currentValue); ser.Sync(member.Name, ref refByteBuffer); - currentValue = refByteBuffer.arr; + currentValue = refByteBuffer.Arr; break; case "ByteBuffer": refByteBuffer = (ByteBuffer)currentValue; @@ -99,7 +95,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 case "Int32[]": refIntBuffer = new IntBuffer((int[])currentValue); ser.Sync(member.Name, ref refIntBuffer); - currentValue = refIntBuffer.arr; + currentValue = refIntBuffer.Arr; break; case "IntBuffer": refIntBuffer = (IntBuffer)currentValue; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/BoardSystem.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/BoardSystem.cs index a9860da941..34a7cdc6e9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/BoardSystem.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/BoardSystem.cs @@ -121,7 +121,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES protected void ApplyMemoryMapMask(int mask, ByteBuffer map) { byte bmask = (byte)mask; - for (int i = 0; i < map.len; i++) + for (int i = 0; i < map.Len; i++) map[i] &= bmask; }