Ram Search - misc fix ups

This commit is contained in:
andres.delikat 2011-02-20 20:37:50 +00:00
parent 7430a35806
commit 9c625df425
3 changed files with 38 additions and 17 deletions

View File

@ -660,6 +660,7 @@
// ModuloRadio
//
this.ModuloRadio.AutoSize = true;
this.ModuloRadio.Enabled = false;
this.ModuloRadio.Location = new System.Drawing.Point(7, 153);
this.ModuloRadio.Name = "ModuloRadio";
this.ModuloRadio.Size = new System.Drawing.Size(60, 17);
@ -672,6 +673,7 @@
// DifferentByRadio
//
this.DifferentByRadio.AutoSize = true;
this.DifferentByRadio.Enabled = false;
this.DifferentByRadio.Location = new System.Drawing.Point(7, 134);
this.DifferentByRadio.Name = "DifferentByRadio";
this.DifferentByRadio.Size = new System.Drawing.Size(83, 17);

View File

@ -22,7 +22,7 @@ namespace BizHawk.MultiClient
string systemID = "NULL";
List<Watch> searchList = new List<Watch>();
List<Watch> undoList = new List<Watch>();
List<Watch> weedOutList = new List<Watch>(); //When addresses are weeded out, the new list goes here, before going into searchList
List<Watch> weededList = new List<Watch>(); //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 };
@ -238,6 +238,7 @@ namespace BizHawk.MultiClient
searchList[x].address = x + startaddress;
searchList[x].prev = searchList[x].value = Global.Emulator.MainMemory.PeekByte(x);
}
OutputLabel.Text = "New search started";
DisplaySearchList();
}
@ -385,9 +386,8 @@ namespace BizHawk.MultiClient
private void ReplaceSearchListWithWeedOutList()
{
//TODO: if weedoutlist = 0, prompt user then reset search? Think about this
searchList = new List<Watch>(weedOutList);
weedOutList.Clear();
searchList = new List<Watch>(weededList);
weededList.Clear();
}
private void toolStripButton1_Click(object sender, EventArgs e)
@ -395,7 +395,7 @@ namespace BizHawk.MultiClient
if (GenerateWeedOutList())
{
SaveUndo();
OutputLabel.Text = (searchList.Count - weedOutList.Count).ToString() + " addresses removed"; //TODO: address if only 1
OutputLabel.Text = (searchList.Count - weededList.Count).ToString() + " addresses removed"; //TODO: address if only 1
ReplaceSearchListWithWeedOutList();
DisplaySearchList();
}
@ -403,11 +403,6 @@ namespace BizHawk.MultiClient
}
/// <summary>
/// Generates the new search list based on user criteria
/// Does not replace the old list
/// </summary>
private SCompareTo GetCompareTo()
{
if (PreviousValueRadio.Checked)
@ -480,8 +475,6 @@ namespace BizHawk.MultiClient
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;
}
@ -498,26 +491,52 @@ namespace BizHawk.MultiClient
switch (GetOperator())
{
case SOperator.LESS:
for (int x = 0; x < searchList.Count; x++)
{
if (searchList[x].address < address)
weededList.Add(searchList[x]);
}
break;
case SOperator.GREATER:
for (int x = 0; x < searchList.Count; x++)
{
if (searchList[x].address > address)
weededList.Add(searchList[x]);
}
break;
case SOperator.LESSEQUAL:
for (int x = 0; x < searchList.Count; x++)
{
if (searchList[x].address <= address)
weededList.Add(searchList[x]);
}
break;
case SOperator.GREATEREQUAL:
for (int x = 0; x < searchList.Count; x++)
{
if (searchList[x].address >= address)
weededList.Add(searchList[x]);
}
break;
case SOperator.EQUAL:
for (int x = 0; x < searchList.Count; x++)
{
if (searchList[x].address == address)
weedOutList.Add(searchList[x]);
weededList.Add(searchList[x]);
}
break;
case SOperator.NOTEQUAL:
for (int x = 0; x < searchList.Count; x++)
{
if (searchList[x].address != address)
weededList.Add(searchList[x]);
}
break;
case SOperator.DIFFBY:
//TODO
break;
case SOperator.MODULUS:
//TODO
break;
}
return true;

View File

@ -171,9 +171,6 @@
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>259, 17</value>
</metadata>
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>358, 17</value>
</metadata>
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
@ -205,6 +202,9 @@
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
</value>
</data>
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>358, 17</value>
</metadata>
<data name="DataSizetoolStripSplitButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8