Fix signature of `IMemoryApi.WriteFloat`

This commit is contained in:
YoshiRulz 2024-08-16 22:44:06 +10:00
parent 70b640240e
commit 60366c13b5
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
4 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -31,7 +31,7 @@ namespace BizHawk.Client.Common
void WriteByte(long addr, uint value, string domain = null);
void WriteByteRange(long addr, IReadOnlyList<byte> 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);

View File

@ -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);

View File

@ -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);