Lua - memory domain - if a domain isn't writable, error when attempting to write to it
This commit is contained in:
parent
2c09c10721
commit
0d54298f02
|
@ -109,14 +109,14 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log(string.Format("Unable to find domain: ", domain));
|
Log(string.Format("Unable to find domain: {0}", domain));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch // Just in case
|
catch // Just in case
|
||||||
{
|
{
|
||||||
Log(string.Format("Unable to find domain: ", domain));
|
Log(string.Format("Unable to find domain: {0}", domain));
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -54,6 +54,8 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void WriteUnsignedByte(int addr, uint v)
|
protected void WriteUnsignedByte(int addr, uint v)
|
||||||
|
{
|
||||||
|
if (Domain.CanPoke())
|
||||||
{
|
{
|
||||||
if (addr < Domain.Size)
|
if (addr < Domain.Size)
|
||||||
{
|
{
|
||||||
|
@ -65,6 +67,11 @@ namespace BizHawk.Client.Common
|
||||||
" outside the memory size of " + Domain.Size);
|
" outside the memory size of " + Domain.Size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log(string.Format("Error: the domain {0} is not writable", Domain.Name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected static int U2S(uint u, int size)
|
protected static int U2S(uint u, int size)
|
||||||
{
|
{
|
||||||
|
@ -169,6 +176,8 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void WriteByteRange(LuaTable memoryblock)
|
protected void WriteByteRange(LuaTable memoryblock)
|
||||||
|
{
|
||||||
|
if (Domain.CanPoke())
|
||||||
{
|
{
|
||||||
foreach (var address in memoryblock.Keys)
|
foreach (var address in memoryblock.Keys)
|
||||||
{
|
{
|
||||||
|
@ -184,6 +193,11 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log(string.Format("Error: the domain {0} is not writable", Domain.Name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected float ReadFloat(int addr, bool bigendian)
|
protected float ReadFloat(int addr, bool bigendian)
|
||||||
{
|
{
|
||||||
|
@ -203,6 +217,8 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void WriteFloat(int addr, double value, bool bigendian)
|
protected void WriteFloat(int addr, double value, bool bigendian)
|
||||||
|
{
|
||||||
|
if (Domain.CanPoke())
|
||||||
{
|
{
|
||||||
if (addr < Domain.Size)
|
if (addr < Domain.Size)
|
||||||
{
|
{
|
||||||
|
@ -217,6 +233,11 @@ namespace BizHawk.Client.Common
|
||||||
" outside memory size of " + Domain.Size);
|
" outside memory size of " + Domain.Size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log(string.Format("Error: the domain {0} is not writable", Domain.Name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue