Make IMemoryDomains inherit IEmulator and simplify some code slightly as a result

This commit is contained in:
adelikat 2014-11-23 16:03:04 +00:00
parent be00dae474
commit e6e2972e3d
6 changed files with 14 additions and 14 deletions

View File

@ -384,7 +384,7 @@ namespace BizHawk.Client.Common
var sb = new StringBuilder();
sb
.Append("Domain ").AppendLine(_domain.Name)
.Append("SystemID ").AppendLine(Global.Emulator.SystemId);
.Append("SystemID ").AppendLine(_core.SystemId);
foreach (var watch in _watchList)
{

View File

@ -355,7 +355,7 @@ namespace BizHawk.Client.EmuHawk
//can't do this unless we are autoloading a rom too...
if (Global.Config.RecentWatches.AutoLoad
&& Global.Emulator is IMemoryDomains)
&& Global.Emulator.HasMemoryDomains())
{
GlobalWin.Tools.LoadRamWatch(!Global.Config.DisplayRamWatch);
}

View File

@ -76,7 +76,7 @@ namespace BizHawk.Client.EmuHawk
ValueHexIndLabel.Text =
CompareHexIndLabel.Text =
_cheat.Type == Watch.DisplayType.Hex ? HexInd : String.Empty;
_cheat.Type == Watch.DisplayType.Hex ? HexInd : string.Empty;
BigEndianCheckBox.Checked = _cheat.BigEndian.Value;
@ -95,7 +95,7 @@ namespace BizHawk.Client.EmuHawk
SetSizeSelected(Watch.WatchSize.Byte);
PopulateTypeDropdown();
NameBox.Text = String.Empty;
NameBox.Text = string.Empty;
if (Global.Emulator != null)
{

View File

@ -199,11 +199,11 @@ namespace BizHawk.Client.EmuHawk
{
GameGenieToolbarSeparator.Visible =
LoadGameGenieToolbarItem.Visible =
(Global.Emulator.SystemId == "NES")
|| (Global.Emulator.SystemId == "GEN" && VersionInfo.DeveloperBuild)
|| (Global.Emulator.SystemId == "GB")
(Core.SystemId == "NES")
|| (Core.SystemId == "GEN" && VersionInfo.DeveloperBuild)
|| (Core.SystemId == "GB")
|| (Global.Game.System == "GG")
|| (Global.Emulator is LibsnesCore);
|| (Core is LibsnesCore);
}
private void AddCheat()
@ -540,11 +540,11 @@ namespace BizHawk.Client.EmuHawk
GameGenieSeparator.Visible =
OpenGameGenieEncoderDecoderMenuItem.Visible =
(Global.Emulator.SystemId == "NES")
|| (Global.Emulator is Genesis)
|| (Global.Emulator.SystemId == "GB")
(Core.SystemId == "NES")
|| (Core is Genesis)
|| (Core.SystemId == "GB")
|| (Global.Game.System == "GG")
|| (Global.Emulator is LibsnesCore);
|| (Core is LibsnesCore);
}
private void RemoveCheatMenuItem_Click(object sender, EventArgs e)

View File

@ -580,7 +580,7 @@ namespace BizHawk.Client.EmuHawk
private void SetPlatformAndMemoryDomainLabel()
{
MemDomainLabel.Text = Global.Emulator.SystemId + " " + _watches.Domain.Name;
MemDomainLabel.Text = _core.SystemId + " " + _watches.Domain.Name;
}
private void UpdateStatusBar(bool saved = false)

View File

@ -1,6 +1,6 @@
namespace BizHawk.Emulation.Common
{
public interface IMemoryDomains
public interface IMemoryDomains : IEmulator
{
///The list of all avaialble memory domains
/// A memory domain is a byte array that respresents a distinct part of the emulated system.