Implement Ram Poke - poking of float types, and fix bugs in float validation
This commit is contained in:
parent
ed637998fb
commit
f9ef8a7271
|
@ -874,12 +874,14 @@ namespace BizHawk.MultiClient
|
|||
case DisplayType.Float:
|
||||
if (InputValidate.IsValidDecimalNumber(value))
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
byte[] bytes = BitConverter.GetBytes(float.Parse(value));
|
||||
val = BitConverter.ToUInt32(bytes, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
PokeDWord(val);
|
||||
return true;
|
||||
|
|
|
@ -193,15 +193,15 @@ namespace BizHawk
|
|||
byte[] bc = AE.GetBytes(input[x].ToString());
|
||||
|
||||
// Determine if the ASCII code is within the valid range of numerical values.
|
||||
if (bc[x] > 58)
|
||||
if (bc[0] > 58)
|
||||
return false;
|
||||
|
||||
if (bc[x] == 46)
|
||||
if (bc[0] == 46)
|
||||
continue;
|
||||
|
||||
if (bc[0] < 48)
|
||||
{
|
||||
if (bc[x] == 45 && x == 0)
|
||||
if (bc[0] == 45 && x == 0)
|
||||
continue;
|
||||
else
|
||||
return false;
|
||||
|
@ -242,12 +242,15 @@ namespace BizHawk
|
|||
byte[] bc = AE.GetBytes(input[x].ToString());
|
||||
|
||||
// Determine if the ASCII code is within the valid range of numerical values.
|
||||
if (bc[x] > 58)
|
||||
if (bc[0] > 58)
|
||||
return false;
|
||||
|
||||
if (bc[x] < 48)
|
||||
if (bc[0] == 46)
|
||||
continue;
|
||||
|
||||
if (bc[0] < 48)
|
||||
{
|
||||
if (bc[x] == 45 && x == 0)
|
||||
if (bc[0] == 45 && x == 0)
|
||||
continue;
|
||||
else
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue