Skip to content

Commit 60366c1

Browse files
committed
Fix signature of IMemoryApi.WriteFloat
1 parent 70b6402 commit 60366c1

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/BizHawk.Client.Common/Api/Classes/MemoryApi.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public float ReadFloat(long addr, string domain = null)
290290
return BitConverter.ToSingle(BitConverter.GetBytes(d.PeekUint(addr, _isBigEndian)), 0);
291291
}
292292

293-
public void WriteFloat(long addr, double value, string domain = null)
293+
public void WriteFloat(long addr, float value, string domain = null)
294294
{
295295
var d = NamedDomainOrCurrent(domain);
296296
if (!d.Writable)
@@ -303,7 +303,7 @@ public void WriteFloat(long addr, double value, string domain = null)
303303
LogCallback($"Warning: Attempted write {addr} outside memory size of {d.Size}");
304304
return;
305305
}
306-
d.PokeUint(addr, BitConverter.ToUInt32(BitConverter.GetBytes((float) value), 0), _isBigEndian);
306+
d.PokeUint(addr, BitConverter.ToUInt32(BitConverter.GetBytes(value), 0), _isBigEndian);
307307
}
308308

309309
public int ReadS8(long addr, string domain = null) => (sbyte) ReadUnsigned(addr, 1, domain);

src/BizHawk.Client.Common/Api/Interfaces/IMemoryApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public interface IMemoryApi : IExternalApi
3131

3232
void WriteByte(long addr, uint value, string domain = null);
3333
void WriteByteRange(long addr, IReadOnlyList<byte> memoryblock, string domain = null);
34-
void WriteFloat(long addr, double value, string domain = null);
34+
void WriteFloat(long addr, float value, string domain = null);
3535

3636
void WriteS8(long addr, int value, string domain = null);
3737
void WriteS16(long addr, int value, string domain = null);

src/BizHawk.Client.Common/lua/CommonLibs/MemoryLuaLibrary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public float ReadFloat(long addr, bool bigendian, string domain = null)
124124

125125
[LuaMethodExample("memory.writefloat( 0x100, 10.0, false, mainmemory.getname( ) );")]
126126
[LuaMethod("writefloat", "Writes the given 32-bit float value to the given address and endian")]
127-
public void WriteFloat(long addr, double value, bool bigendian, string domain = null)
127+
public void WriteFloat(long addr, float value, bool bigendian, string domain = null)
128128
{
129129
APIs.Memory.SetBigEndian(bigendian);
130130
APIs.Memory.WriteFloat(addr, value, domain);

src/BizHawk.Client.Common/lua/LuaHelperLibs/MainMemoryLuaLibrary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public float ReadFloat(long addr, bool bigendian)
121121

122122
[LuaMethodExample("mainmemory.writefloat( 0x100, 10.0, false );")]
123123
[LuaMethod("writefloat", "Writes the given 32-bit float value to the given address and endian")]
124-
public void WriteFloat(long addr, double value, bool bigendian)
124+
public void WriteFloat(long addr, float value, bool bigendian)
125125
{
126126
APIs.Memory.SetBigEndian(bigendian);
127127
APIs.Memory.WriteFloat(addr, value, MainMemName);

0 commit comments

Comments
 (0)