lua: memory.GetMemoryDomainSize()

fix #542
This commit is contained in:
feos 2016-02-09 17:38:20 +03:00
parent 72e4760b38
commit 07d4ac846b
1 changed files with 12 additions and 0 deletions

View File

@ -76,6 +76,18 @@ namespace BizHawk.Client.Common
return table;
}
[LuaMethodAttributes(
"getmemorydomainsize",
"Returns the number of bytes of the specified memory domain. If no domain is specified, or the specified domain doesn't exist, returns the current domain size"
)]
public uint GetMemoryDomainSize(string name = "")
{
if (string.IsNullOrEmpty(name))
return (uint)Domain.Size;
else
return (uint)DomainList[VerifyMemoryDomain(name)].Size;
}
[LuaMethodAttributes(
"getcurrentmemorydomain",
"Returns a string name of the current memory domain selected by Lua. The default is Main memory"