Ram Search - allow specific value to have hexadecimal values if Hex Data type is selected
This commit is contained in:
parent
71c0e8648e
commit
3983c585f9
|
@ -764,10 +764,23 @@ namespace BizHawk.MultiClient
|
||||||
private int GetSpecificValue()
|
private int GetSpecificValue()
|
||||||
{
|
{
|
||||||
if (SpecificValueBox.Text == "") return 0;
|
if (SpecificValueBox.Text == "") return 0;
|
||||||
bool i = InputValidate.IsValidSignedNumber(SpecificValueBox.Text);
|
bool i = false;
|
||||||
if (!i) return -1;
|
switch (GetDataType())
|
||||||
|
{
|
||||||
return int.Parse(SpecificValueBox.Text);
|
case asigned.UNSIGNED:
|
||||||
|
i = InputValidate.IsValidUnsignedNumber(SpecificValueBox.Text);
|
||||||
|
if (!i) return -1;
|
||||||
|
return int.Parse(SpecificValueBox.Text);
|
||||||
|
case asigned.SIGNED:
|
||||||
|
i = InputValidate.IsValidSignedNumber(SpecificValueBox.Text);
|
||||||
|
if (!i) return -1;
|
||||||
|
return int.Parse(SpecificValueBox.Text);
|
||||||
|
case asigned.HEX:
|
||||||
|
i = InputValidate.IsValidHexNumber(SpecificValueBox.Text);
|
||||||
|
if (!i) return -1;
|
||||||
|
return int.Parse(SpecificValueBox.Text, NumberStyles.HexNumber);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int GetSpecificAddress()
|
private int GetSpecificAddress()
|
||||||
|
@ -1412,8 +1425,22 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
if (e.KeyChar == '\b') return;
|
if (e.KeyChar == '\b') return;
|
||||||
|
|
||||||
if (!InputValidate.IsValidUnsignedNumber(e.KeyChar))
|
switch (GetDataType())
|
||||||
e.Handled = true;
|
{
|
||||||
|
case asigned.UNSIGNED:
|
||||||
|
if (!InputValidate.IsValidUnsignedNumber(e.KeyChar))
|
||||||
|
e.Handled = true;
|
||||||
|
break;
|
||||||
|
case asigned.SIGNED:
|
||||||
|
if (!InputValidate.IsValidSignedNumber(e.KeyChar))
|
||||||
|
e.Handled = true;
|
||||||
|
break;
|
||||||
|
case asigned.HEX:
|
||||||
|
if (!InputValidate.IsValidHexNumber(e.KeyChar))
|
||||||
|
e.Handled = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SpecificAddressBox_KeyPress(object sender, KeyPressEventArgs e)
|
private void SpecificAddressBox_KeyPress(object sender, KeyPressEventArgs e)
|
||||||
|
|
|
@ -93,12 +93,18 @@ namespace BizHawk
|
||||||
byte[] bc = AE.GetBytes(input[x].ToString());
|
byte[] bc = AE.GetBytes(input[x].ToString());
|
||||||
|
|
||||||
// Determine if the ASCII code is within the valid range of numerical values.
|
// Determine if the ASCII code is within the valid range of numerical values.
|
||||||
if (bc[0] < 47)
|
if (bc[0] < 47) //0
|
||||||
return false;
|
return false;
|
||||||
if (bc[0] > 58)
|
if (bc[0] > 58) //9
|
||||||
{
|
{
|
||||||
if (bc[0] < 65 || bc[0] > 70) //A-F capital letters only!
|
if (bc[0] < 65) //A
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (bc[0] > 70) //F
|
||||||
|
{
|
||||||
|
if (bc[0] < 97 || bc[0] > 102) //a-f
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue