Ram Search - implemented Diff By Specific Address (yeah, that one is really pointless, but might as well)

This commit is contained in:
andres.delikat 2011-02-20 20:50:41 +00:00
parent 9c625df425
commit 4ff2e24804
2 changed files with 24 additions and 4 deletions

View File

@ -673,7 +673,6 @@
// 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

@ -474,8 +474,15 @@ namespace BizHawk.MultiClient
bool i = InputValidate.IsValidHexNumber(SpecificAddressBox.Text);
if (!i) return -1;
int x = int.Parse(SpecificAddressBox.Text.ToUpper().Trim(), NumberStyles.HexNumber);
return x;
return int.Parse(SpecificAddressBox.Text.ToUpper().Trim(), NumberStyles.HexNumber);
}
private int GetDifferentBy()
{
bool i = InputValidate.IsValidUnsignedNumber(DifferentByBox.Text);
if (!i) return -1;
return int.Parse(DifferentByBox.Text.ToUpper().Trim());
}
private bool DoSpecificAddress()
@ -533,7 +540,21 @@ namespace BizHawk.MultiClient
}
break;
case SOperator.DIFFBY:
//TODO
{
int diff = GetDifferentBy();
if (diff < 0)
{
MessageBox.Show("Missing or invalid Different By value", "Invalid value", MessageBoxButtons.OK, MessageBoxIcon.Error);
DifferentByBox.Focus();
DifferentByBox.SelectAll();
return false;
}
for (int x = 0; x < searchList.Count; x++)
{
if (searchList[x].address == address + diff || searchList[x].address == address - diff)
weededList.Add(searchList[x]);
}
}
break;
case SOperator.MODULUS:
//TODO