diff --git a/BizHawk.MultiClient/tools/RamSearch.Designer.cs b/BizHawk.MultiClient/tools/RamSearch.Designer.cs index 696ac694e2..0141cd3337 100644 --- a/BizHawk.MultiClient/tools/RamSearch.Designer.cs +++ b/BizHawk.MultiClient/tools/RamSearch.Designer.cs @@ -95,6 +95,7 @@ this.LessThanRadio = new System.Windows.Forms.RadioButton(); this.AutoSearchCheckBox = new System.Windows.Forms.CheckBox(); this.MemDomainLabel = new System.Windows.Forms.Label(); + this.OutputLabel = new System.Windows.Forms.Label(); this.SearchtoolStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); @@ -213,7 +214,7 @@ this.SearchListView.Location = new System.Drawing.Point(9, 58); this.SearchListView.Name = "SearchListView"; this.SearchListView.selectedItem = -1; - this.SearchListView.Size = new System.Drawing.Size(223, 391); + this.SearchListView.Size = new System.Drawing.Size(223, 365); this.SearchListView.TabIndex = 3; this.SearchListView.UseCompatibleStateImageBehavior = false; this.SearchListView.View = System.Windows.Forms.View.Details; @@ -434,6 +435,7 @@ this.byteToolStripMenuItem, this.bytesToolStripMenuItem, this.bytesToolStripMenuItem1}); + this.DataSizetoolStripSplitButton1.Enabled = false; this.DataSizetoolStripSplitButton1.Image = ((System.Drawing.Image)(resources.GetObject("DataSizetoolStripSplitButton1.Image"))); this.DataSizetoolStripSplitButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.DataSizetoolStripSplitButton1.Name = "DataSizetoolStripSplitButton1"; @@ -760,11 +762,21 @@ this.MemDomainLabel.TabIndex = 8; this.MemDomainLabel.Text = "Main Memory"; // + // OutputLabel + // + this.OutputLabel.AutoSize = true; + this.OutputLabel.Location = new System.Drawing.Point(9, 436); + this.OutputLabel.Name = "OutputLabel"; + this.OutputLabel.Size = new System.Drawing.Size(85, 13); + this.OutputLabel.TabIndex = 9; + this.OutputLabel.Text = " "; + // // RamSearch // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(472, 461); + this.Controls.Add(this.OutputLabel); this.Controls.Add(this.MemDomainLabel); this.Controls.Add(this.AutoSearchCheckBox); this.Controls.Add(this.ComparisonBox); @@ -869,5 +881,6 @@ private System.Windows.Forms.ToolStripMenuItem saveWindowPositionToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.Label MemDomainLabel; + private System.Windows.Forms.Label OutputLabel; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index 47cc21fe98..2973e5fe9a 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -6,6 +6,8 @@ using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; +using System.IO; +using System.Globalization; namespace BizHawk.MultiClient { @@ -20,7 +22,7 @@ namespace BizHawk.MultiClient string systemID = "NULL"; List searchList = new List(); List undoList = new List(); - List newSearchList = new List(); //When addresses are weeded out, the new list goes here, before going into searchList + List weedOutList = new List(); //When addresses are weeded out, the new list goes here, before going into searchList public enum SCompareTo { PREV, VALUE, ADDRESS, CHANGES }; public enum SOperator { LESS, GREATER, LESSEQUAL, GREATEREQUAL, EQUAL, NOTEQUAL, DIFFBY, MODULUS }; @@ -381,9 +383,21 @@ namespace BizHawk.MultiClient DoUndo(); } + private void ReplaceSearchListWithWeedOutList() + { + //TODO: if weedoutlist = 0, prompt user then reset search? Think about this + searchList = new List(weedOutList); + weedOutList.Clear(); + } + private void toolStripButton1_Click(object sender, EventArgs e) { - GenerateNewSearchList(); + GenerateWeedOutList(); + SaveUndo(); + OutputLabel.Text = (searchList.Count - weedOutList.Count).ToString() + " addresses removed"; //TODO: address if only 1 + ReplaceSearchListWithWeedOutList(); + DisplaySearchList(); + } /// @@ -427,7 +441,7 @@ namespace BizHawk.MultiClient return SOperator.LESS; //Just in case } - private void GenerateNewSearchList() + private void GenerateWeedOutList() { //Switch based on user criteria //Generate search list @@ -459,14 +473,56 @@ namespace BizHawk.MultiClient } + private int GetSpecificAddress() + { + bool i = InputValidate.IsValidHexNumber(SpecificAddressBox.Text); + if (!i) return -1; + + int x = int.Parse(SpecificAddressBox.Text.ToUpper().Trim(), NumberStyles.HexNumber); + if (x < searchList[0].address || x > searchList[searchList.Count - 1].address) return -1; + + return x; + } + private void DoSpecificAddress() { + int address = GetSpecificAddress(); + if (address < 0) + { + MessageBox.Show("Missing or invalid address", "Invalid address", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + switch (GetOperator()) + { + case SOperator.LESS: + break; + case SOperator.GREATER: + break; + case SOperator.LESSEQUAL: + break; + case SOperator.GREATEREQUAL: + break; + case SOperator.EQUAL: + for (int x = 0; x < searchList.Count; x++) + { + if (searchList[x].address == address) + weedOutList.Add(searchList[x]); + } + + break; + case SOperator.NOTEQUAL: + break; + case SOperator.DIFFBY: + break; + case SOperator.MODULUS: + break; + } } private void DoNumberOfChanges() { - + } private void signedToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/BizHawk.MultiClient/tools/RamSearch.resx b/BizHawk.MultiClient/tools/RamSearch.resx index 70c8b2fa77..5597b9c11f 100644 --- a/BizHawk.MultiClient/tools/RamSearch.resx +++ b/BizHawk.MultiClient/tools/RamSearch.resx @@ -171,6 +171,9 @@ 259, 17 + + 358, 17 + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -202,9 +205,6 @@ s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC - - 358, 17 - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8