New Ram Search - some fixes
This commit is contained in:
parent
130b83d920
commit
71b654c4b4
|
@ -1122,6 +1122,10 @@ namespace BizHawk.MultiClient
|
|||
private void SpecificValueRadio_Click(object sender, EventArgs e)
|
||||
{
|
||||
SpecificValueBox.Enabled = true;
|
||||
if (String.IsNullOrWhiteSpace(SpecificValueBox.Text))
|
||||
{
|
||||
SpecificValueBox.Text = "0";
|
||||
}
|
||||
SpecificValueBox.Focus();
|
||||
SpecificAddressBox.Enabled = false;
|
||||
NumberOfChangesBox.Enabled = false;
|
||||
|
@ -1133,6 +1137,10 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
SpecificValueBox.Enabled = false;
|
||||
SpecificAddressBox.Enabled = true;
|
||||
if (String.IsNullOrWhiteSpace(SpecificAddressBox.Text))
|
||||
{
|
||||
SpecificAddressBox.Text = "0";
|
||||
}
|
||||
SpecificAddressBox.Focus();
|
||||
NumberOfChangesBox.Enabled = false;
|
||||
DifferenceBox.Enabled = false;
|
||||
|
@ -1144,6 +1152,10 @@ namespace BizHawk.MultiClient
|
|||
SpecificValueBox.Enabled = false;
|
||||
SpecificAddressBox.Enabled = false;
|
||||
NumberOfChangesBox.Enabled = true;
|
||||
if (String.IsNullOrWhiteSpace(NumberOfChangesBox.Text))
|
||||
{
|
||||
NumberOfChangesBox.Text = "0";
|
||||
}
|
||||
NumberOfChangesBox.Focus();
|
||||
DifferenceBox.Enabled = false;
|
||||
SetCompareTo(RamSearchEngine.Compare.Changes);
|
||||
|
@ -1155,6 +1167,10 @@ namespace BizHawk.MultiClient
|
|||
SpecificAddressBox.Enabled = false;
|
||||
NumberOfChangesBox.Enabled = false;
|
||||
DifferenceBox.Enabled = true;
|
||||
if (String.IsNullOrWhiteSpace(DifferenceBox.Text))
|
||||
{
|
||||
DifferenceBox.Text = "0";
|
||||
}
|
||||
DifferenceBox.Focus();
|
||||
SetCompareTo(RamSearchEngine.Compare.Difference);
|
||||
}
|
||||
|
|
|
@ -618,11 +618,14 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
default:
|
||||
case Watch.WatchSize.Byte:
|
||||
return _settings.Domain.PeekByte(addr);
|
||||
var theByte = _settings.Domain.PeekByte(addr);
|
||||
return theByte;
|
||||
case Watch.WatchSize.Word:
|
||||
return _settings.Domain.PeekWord(addr, _settings.BigEndian ? Endian.Big : Endian.Little);
|
||||
var theWord = _settings.Domain.PeekWord(addr, _settings.BigEndian ? Endian.Big : Endian.Little);
|
||||
return theWord;
|
||||
case Watch.WatchSize.DWord:
|
||||
return (int)_settings.Domain.PeekDWord(addr, _settings.BigEndian ? Endian.Big : Endian.Little);
|
||||
var theDWord = _settings.Domain.PeekDWord(addr, _settings.BigEndian ? Endian.Big : Endian.Little);
|
||||
return (int)theDWord;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -177,23 +177,39 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
if (e.KeyCode == Keys.Up)
|
||||
{
|
||||
//if (InputValidate.IsValidHexNumber(Text))
|
||||
//{
|
||||
// int val = ToInt();
|
||||
// val++;
|
||||
// string formatstr = "{0:X" + MaxLength.ToString() + "}";
|
||||
// Text = String.Format(formatstr, val);
|
||||
//}
|
||||
int val = ToInt();
|
||||
val++;
|
||||
|
||||
switch (_type)
|
||||
{
|
||||
default:
|
||||
Text = val.ToString();
|
||||
break;
|
||||
case Watch.DisplayType.Binary:
|
||||
throw new NotImplementedException();
|
||||
case Watch.DisplayType.Hex:
|
||||
string formatstr = "{0:X" + MaxLength.ToString() + "}";
|
||||
Text = String.Format(formatstr, val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (e.KeyCode == Keys.Down)
|
||||
{
|
||||
//if (InputValidate.IsValidHexNumber(Text))
|
||||
//{
|
||||
// int val = ToInt();
|
||||
// val--;
|
||||
// string formatstr = "{0:X" + MaxLength.ToString() + "}";
|
||||
// Text = String.Format(formatstr, val);
|
||||
//}
|
||||
int val = ToInt();
|
||||
val--;
|
||||
|
||||
switch (_type)
|
||||
{
|
||||
default:
|
||||
Text = val.ToString();
|
||||
break;
|
||||
case Watch.DisplayType.Binary:
|
||||
throw new NotImplementedException();
|
||||
case Watch.DisplayType.Hex:
|
||||
string formatstr = "{0:X" + MaxLength.ToString() + "}";
|
||||
Text = String.Format(formatstr, val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -201,16 +217,31 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
protected override void OnTextChanged(EventArgs e)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(Text))
|
||||
{
|
||||
Text = "0";
|
||||
}
|
||||
}
|
||||
|
||||
public int ToInt()
|
||||
{
|
||||
switch (_type)
|
||||
if (String.IsNullOrWhiteSpace(Text))
|
||||
{
|
||||
default:
|
||||
return int.Parse(Text);
|
||||
case Watch.DisplayType.Binary:
|
||||
return Convert.ToInt32(Text, 2);
|
||||
case Watch.DisplayType.Hex:
|
||||
return int.Parse(Text, NumberStyles.HexNumber);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (_type)
|
||||
{
|
||||
default:
|
||||
return int.Parse(Text);
|
||||
case Watch.DisplayType.Binary:
|
||||
return Convert.ToInt32(Text, 2);
|
||||
case Watch.DisplayType.Hex:
|
||||
return int.Parse(Text, NumberStyles.HexNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,9 +56,24 @@ namespace BizHawk
|
|||
}
|
||||
}
|
||||
|
||||
protected override void OnTextChanged(EventArgs e)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(Text))
|
||||
{
|
||||
Text = "0";
|
||||
}
|
||||
}
|
||||
|
||||
public int ToInt()
|
||||
{
|
||||
return int.Parse(Text, NumberStyles.HexNumber);
|
||||
if (String.IsNullOrWhiteSpace(Text))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return int.Parse(Text, NumberStyles.HexNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,9 +122,24 @@ namespace BizHawk
|
|||
}
|
||||
}
|
||||
|
||||
protected override void OnTextChanged(EventArgs e)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(Text))
|
||||
{
|
||||
Text = "0";
|
||||
}
|
||||
}
|
||||
|
||||
public int ToInt()
|
||||
{
|
||||
return int.Parse(Text);
|
||||
if (String.IsNullOrWhiteSpace(Text))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return int.Parse(Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue