diff --git a/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs b/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs index c77b841cbb..260e94bc92 100644 --- a/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs @@ -290,7 +290,7 @@ namespace BizHawk.Client.Common return BitConverter.ToSingle(BitConverter.GetBytes(d.PeekUint(addr, _isBigEndian)), 0); } - public void WriteFloat(long addr, double value, string domain = null) + public void WriteFloat(long addr, float value, string domain = null) { var d = NamedDomainOrCurrent(domain); if (!d.Writable) @@ -303,7 +303,7 @@ namespace BizHawk.Client.Common LogCallback($"Warning: Attempted write {addr} outside memory size of {d.Size}"); return; } - d.PokeUint(addr, BitConverter.ToUInt32(BitConverter.GetBytes((float) value), 0), _isBigEndian); + d.PokeUint(addr, BitConverter.ToUInt32(BitConverter.GetBytes(value), 0), _isBigEndian); } public int ReadS8(long addr, string domain = null) => (sbyte) ReadUnsigned(addr, 1, domain); diff --git a/src/BizHawk.Client.Common/Api/Interfaces/IMemoryApi.cs b/src/BizHawk.Client.Common/Api/Interfaces/IMemoryApi.cs index 52134d3cf4..ae644937a0 100644 --- a/src/BizHawk.Client.Common/Api/Interfaces/IMemoryApi.cs +++ b/src/BizHawk.Client.Common/Api/Interfaces/IMemoryApi.cs @@ -31,7 +31,7 @@ namespace BizHawk.Client.Common void WriteByte(long addr, uint value, string domain = null); void WriteByteRange(long addr, IReadOnlyList memoryblock, string domain = null); - void WriteFloat(long addr, double value, string domain = null); + void WriteFloat(long addr, float value, string domain = null); void WriteS8(long addr, int value, string domain = null); void WriteS16(long addr, int value, string domain = null); diff --git a/src/BizHawk.Client.Common/lua/CommonLibs/MemoryLuaLibrary.cs b/src/BizHawk.Client.Common/lua/CommonLibs/MemoryLuaLibrary.cs index a7523c196f..c5f71f63b5 100644 --- a/src/BizHawk.Client.Common/lua/CommonLibs/MemoryLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/CommonLibs/MemoryLuaLibrary.cs @@ -124,7 +124,7 @@ namespace BizHawk.Client.Common [LuaMethodExample("memory.writefloat( 0x100, 10.0, false, mainmemory.getname( ) );")] [LuaMethod("writefloat", "Writes the given 32-bit float value to the given address and endian")] - public void WriteFloat(long addr, double value, bool bigendian, string domain = null) + public void WriteFloat(long addr, float value, bool bigendian, string domain = null) { APIs.Memory.SetBigEndian(bigendian); APIs.Memory.WriteFloat(addr, value, domain); diff --git a/src/BizHawk.Client.Common/lua/LuaHelperLibs/MainMemoryLuaLibrary.cs b/src/BizHawk.Client.Common/lua/LuaHelperLibs/MainMemoryLuaLibrary.cs index c1866470f2..09521cad44 100644 --- a/src/BizHawk.Client.Common/lua/LuaHelperLibs/MainMemoryLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/LuaHelperLibs/MainMemoryLuaLibrary.cs @@ -121,7 +121,7 @@ namespace BizHawk.Client.Common [LuaMethodExample("mainmemory.writefloat( 0x100, 10.0, false );")] [LuaMethod("writefloat", "Writes the given 32-bit float value to the given address and endian")] - public void WriteFloat(long addr, double value, bool bigendian) + public void WriteFloat(long addr, float value, bool bigendian) { APIs.Memory.SetBigEndian(bigendian); APIs.Memory.WriteFloat(addr, value, MainMemName);