diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Memory.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Memory.cs
index 1972a0b0a1..3dbea092b6 100644
--- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Memory.cs
+++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Memory.cs
@@ -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"