diff --git a/BizHawk.MultiClient/tools/Watch/Watch.cs b/BizHawk.MultiClient/tools/Watch/Watch.cs index afcc3fc00f..105db15dae 100644 --- a/BizHawk.MultiClient/tools/Watch/Watch.cs +++ b/BizHawk.MultiClient/tools/Watch/Watch.cs @@ -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; diff --git a/BizHawk.Util/InputValidate.cs b/BizHawk.Util/InputValidate.cs index 01bd3613fa..3252c880d6 100644 --- a/BizHawk.Util/InputValidate.cs +++ b/BizHawk.Util/InputValidate.cs @@ -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;