diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index 9067d21f20..3f677a763c 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -1208,7 +1208,7 @@ namespace BizHawk.MultiClient using (StreamWriter sw = new StreamWriter(path)) { - string str = ""; + string str = "Domain " + Domain.Name + "\n"; for (int x = 0; x < searchList.Count; x++) { @@ -1279,6 +1279,17 @@ namespace BizHawk.MultiClient return count; } + private int GetDomainPos(string name) + { + //Attempts to find the memory domain by name, if it fails, it defaults to index 0 + for (int x = 0; x < Global.Emulator.MemoryDomains.Count; x++) + { + if (Global.Emulator.MemoryDomains[x].Name == name) + return x; + } + return 0; + } + bool LoadSearchFile(string path, bool append, bool truncate, List list) { int y, z; @@ -1305,6 +1316,9 @@ namespace BizHawk.MultiClient //Any properly formatted line couldn't possibly be this short anyway, this also takes care of any garbage lines that might be in a file if (s.Length < 5) continue; + if (s.Substring(0, 6) == "Domain") + SetMemoryDomain(GetDomainPos(s.Substring(7, s.Length - 7))); + z = HowMany(s, '\t'); if (z == 5) { diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index 13dd86c03d..a861c5c16d 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -17,6 +17,7 @@ namespace BizHawk.MultiClient public partial class RamWatch : Form { //TODO: + //Make default .wch filename based on Rom, ditto for Ram Search & Cheat Search //address num digits based on domain size //Restore window size should restore column order as well //When receiving a watch from a different domain, should something be done?