diff --git a/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs b/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs index 0d1e2b8c84..78e6abf776 100644 --- a/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs +++ b/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs @@ -37,7 +37,15 @@ namespace BizHawk.Client.EmuHawk DomainDropDown.Items.AddRange(Core.MemoryDomains .Select(d => d.ToString()) .ToArray()); - DomainDropDown.SelectedItem = Core.MemoryDomains.MainMemory.ToString(); + + if (Core.MemoryDomains.HasSystemBus) + { + DomainDropDown.SelectedItem = Core.MemoryDomains.SystemBus.ToString(); + } + else + { + DomainDropDown.SelectedItem = Core.MemoryDomains.MainMemory.ToString(); + } } SetFormToDefault(); diff --git a/BizHawk.Emulation.Common/MemoryDomain.cs b/BizHawk.Emulation.Common/MemoryDomain.cs index ffb978a23d..387933306a 100644 --- a/BizHawk.Emulation.Common/MemoryDomain.cs +++ b/BizHawk.Emulation.Common/MemoryDomain.cs @@ -214,5 +214,21 @@ namespace BizHawk.Emulation.Common return this[_mainMemoryIndex]; } } + + public bool HasSystemBus + { + get + { + return this.Any(x => x.Name == "System Bus" || x.Name == "BUS"); // Have to account for "BUS" because some developers don't like consistency! + } + } + + public MemoryDomain SystemBus + { + get + { + return this.FirstOrDefault(x => x.Name == "System Bus" || x.Name == "BUS"); + } + } } }