Change IMemoryDomains to have an IMemoryDomainList instead of a MemoryDomainList, this is an incremental step into eventually having IMemoryDomains take over the properties of IMemoryDomainList, still todo: reduce the amount of needed functionality in IMemoryDomainList from old and not good code
This commit is contained in:
parent
d2b0579609
commit
d62ba4e2b4
|
@ -60,6 +60,7 @@ namespace BizHawk.Client.Common
|
|||
public LuaTable GetMemoryDomainList()
|
||||
{
|
||||
var table = Lua.NewTable();
|
||||
|
||||
for (int i = 0; i < DomainList.Count; i++)
|
||||
{
|
||||
table[i] = DomainList[i].Name;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Client.Common
|
|||
|
||||
protected abstract MemoryDomain Domain { get; }
|
||||
|
||||
protected MemoryDomainList DomainList
|
||||
protected IMemoryDomainList DomainList
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
|
@ -218,7 +218,7 @@ namespace BizHawk.Client.EmuHawk.ToolExtensions
|
|||
Global.CheatList.RemoveRange(watches.Where(watch => !watch.IsSeparator));
|
||||
}
|
||||
|
||||
public static IEnumerable<ToolStripItem> MenuItems(this MemoryDomainList domains, Action<string> setCallback, string selected = "", int? maxSize = null)
|
||||
public static IEnumerable<ToolStripItem> MenuItems(this IMemoryDomainList domains, Action<string> setCallback, string selected = "", int? maxSize = null)
|
||||
{
|
||||
foreach (var domain in domains)
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
|
|||
public IDebuggable Core { get; set; }
|
||||
public IMemoryCallbackSystem MCS { get; set; }
|
||||
public GenericDebugger ParentDebugger { get; set; }
|
||||
public MemoryDomainList MemoryDomains { get; set; }
|
||||
public IMemoryDomainList MemoryDomains { get; set; }
|
||||
private readonly BreakpointList Breakpoints = new BreakpointList();
|
||||
|
||||
public BreakpointControl()
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private IMemoryCallbackSystem MemoryCallbacks { get { return Debuggable.MemoryCallbacks; } }
|
||||
|
||||
private MemoryDomainList MemoryDomains { get { return MemoryDomainSource.MemoryDomains; } }
|
||||
private IMemoryDomainList MemoryDomains { get { return MemoryDomainSource.MemoryDomains; } }
|
||||
|
||||
private uint PC
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[RequiredService]
|
||||
private IMemoryDomains MemoryDomainSource { get; set; }
|
||||
|
||||
private MemoryDomainList MemoryDomains { get { return MemoryDomainSource.MemoryDomains; } }
|
||||
private IMemoryDomainList MemoryDomains { get { return MemoryDomainSource.MemoryDomains; } }
|
||||
|
||||
private readonly Dictionary<char, int> _gameGenieTable = new Dictionary<char, int>();
|
||||
private bool _processing;
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
[RequiredService]
|
||||
private IMemoryDomains MemoryDomainService { get; set; }
|
||||
private MemoryDomainList MemoryDomains { get { return MemoryDomainService.MemoryDomains; } }
|
||||
private IMemoryDomainList MemoryDomains { get { return MemoryDomainService.MemoryDomains; } }
|
||||
|
||||
private readonly Dictionary<char, int> _gameGenieTable = new Dictionary<char, int>
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
[RequiredService]
|
||||
private IMemoryDomains MemoryDomainSource { get; set; }
|
||||
private MemoryDomainList MemoryDomains { get { return MemoryDomainSource.MemoryDomains; } }
|
||||
private IMemoryDomainList MemoryDomains { get { return MemoryDomainSource.MemoryDomains; } }
|
||||
|
||||
[RequiredService]
|
||||
private IEmulator Emulator { get; set; }
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
[RequiredService]
|
||||
private IMemoryDomains MemoryDomainService { get; set; }
|
||||
private MemoryDomainList MemoryDomains { get { return MemoryDomainService.MemoryDomains; } }
|
||||
private IMemoryDomainList MemoryDomains { get { return MemoryDomainService.MemoryDomains; } }
|
||||
|
||||
private readonly Dictionary<char, int> _gameGenieTable = new Dictionary<char, int>
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private MemoryDomainList MemoryDomains { get { return _emu.MemoryDomains; } }
|
||||
private IMemoryDomainList MemoryDomains { get { return _emu.MemoryDomains; } }
|
||||
|
||||
private string _currentFileName = string.Empty;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[RequiredService]
|
||||
public LibsnesCore Emulator { get; set; }
|
||||
|
||||
private MemoryDomainList MemoryDomains { get { return Emulator.MemoryDomains; } }
|
||||
private IMemoryDomainList MemoryDomains { get { return Emulator.MemoryDomains; } }
|
||||
|
||||
// including transposition
|
||||
// Code: D F 4 7 0 9 1 5 6 B C 8 A 2 3 E
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
namespace BizHawk.Emulation.Common
|
||||
using System.Collections.Generic;
|
||||
namespace BizHawk.Emulation.Common
|
||||
{
|
||||
public interface IMemoryDomains : IEmulatorService
|
||||
{
|
||||
|
@ -10,6 +11,17 @@
|
|||
/// Other chips, and ram spaces can be added as well.
|
||||
/// Subdomains of another domain are also welcome.
|
||||
/// The MainMemory identifier will be 0 if not set
|
||||
MemoryDomainList MemoryDomains { get; }
|
||||
IMemoryDomainList MemoryDomains { get; }
|
||||
}
|
||||
|
||||
public interface IMemoryDomainList : IList<MemoryDomain>
|
||||
{
|
||||
MemoryDomain this[string name] { get; }
|
||||
|
||||
MemoryDomain MainMemory { get; }
|
||||
|
||||
bool HasCheatDomain { get; }
|
||||
|
||||
MemoryDomain CheatDomain { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ namespace BizHawk.Emulation.Common
|
|||
}
|
||||
}
|
||||
|
||||
public class MemoryDomainList : ReadOnlyCollection<MemoryDomain>
|
||||
public class MemoryDomainList : ReadOnlyCollection<MemoryDomain>, IMemoryDomainList
|
||||
{
|
||||
private readonly int _mainMemoryIndex;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
|||
w.Flush();
|
||||
}
|
||||
|
||||
public void Disassemble(Stream s, MemoryDomainList mem)
|
||||
public void Disassemble(Stream s, IMemoryDomainList mem)
|
||||
{
|
||||
var w = new StreamWriter(s);
|
||||
w.WriteLine("; Bizhawk CDL Disassembly");
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Calculators
|
|||
{
|
||||
public partial class TI83 : IMemoryDomains
|
||||
{
|
||||
public MemoryDomainList MemoryDomains
|
||||
public IMemoryDomainList MemoryDomains
|
||||
{
|
||||
get { return _memoryDomains; }
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
{
|
||||
public partial class C64 : IMemoryDomains
|
||||
{
|
||||
public MemoryDomainList MemoryDomains
|
||||
public IMemoryDomainList MemoryDomains
|
||||
{
|
||||
get { return memoryDomains; }
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
{
|
||||
public partial class Atari2600 : IMemoryDomains
|
||||
{
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
private void SetupMemoryDomains()
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800
|
|||
{
|
||||
private List<MemoryDomain> _MemoryDomains;
|
||||
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
public void SetupMemoryDomains(HSC7800 hsc7800)
|
||||
{
|
||||
|
|
|
@ -390,7 +390,7 @@ namespace BizHawk.Emulation.Cores.Atari.Lynx
|
|||
}
|
||||
|
||||
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
|
|||
{
|
||||
public partial class ColecoVision : IMemoryDomains
|
||||
{
|
||||
public MemoryDomainList MemoryDomains
|
||||
public IMemoryDomainList MemoryDomains
|
||||
{
|
||||
get { return memoryDomains; }
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
#region memorydomains
|
||||
|
||||
List<MemoryDomain> _MemoryDomains = new List<MemoryDomain>();
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
void AddMemoryDomain(LibMeteor.MemoryArea which, int size, string name)
|
||||
{
|
||||
|
|
|
@ -403,7 +403,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
MemoryDomains = new MemoryDomainList(mm, 0);
|
||||
}
|
||||
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
VBARegisterHelper regs;
|
||||
|
||||
|
|
|
@ -782,7 +782,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
}
|
||||
|
||||
private List<MemoryDomain> _MemoryDomains = new List<MemoryDomain>();
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -405,7 +405,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
|
||||
#region debugging
|
||||
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
public IDictionary<string, RegisterValue> GetCpuFlagsAndRegisters()
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
|
|||
{
|
||||
private List<MemoryDomain> _memoryDomains = new List<MemoryDomain>();
|
||||
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
private void MakeMemoryDomain(string name, mupen64plusApi.N64_MEMORY id, MemoryDomain.Endian endian, bool swizzled = false)
|
||||
{
|
||||
|
|
|
@ -446,7 +446,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
}
|
||||
|
||||
public string SystemId { get { return "NES"; } }
|
||||
public MemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
public IMemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
|
||||
public string GameName { get { return game_name; } }
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
|||
MemoryDomains = new MemoryDomainList(mm, 0);
|
||||
}
|
||||
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
public IDictionary<string, RegisterValue> GetCpuFlagsAndRegisters()
|
||||
{
|
||||
|
|
|
@ -1145,7 +1145,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
|
||||
private MemoryDomain MainMemory;
|
||||
private List<MemoryDomain> _memoryDomains = new List<MemoryDomain>();
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
#region audio stuff
|
||||
|
||||
|
|
|
@ -566,7 +566,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
|
|||
}
|
||||
|
||||
MemoryDomainList memoryDomains;
|
||||
public MemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
public IMemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
|
||||
public IDictionary<string, RegisterValue> GetCpuFlagsAndRegisters()
|
||||
{
|
||||
|
|
|
@ -489,7 +489,7 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
|
|||
memoryDomains = new MemoryDomainList(domains);
|
||||
}
|
||||
|
||||
public MemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
public IMemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
|
|
@ -487,7 +487,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
memoryDomains = new MemoryDomainList(domains);
|
||||
}
|
||||
|
||||
public MemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
public IMemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
|
||||
public IDictionary<string, RegisterValue> GetCpuFlagsAndRegisters()
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
|
|||
{
|
||||
public partial class Yabause : IMemoryDomains
|
||||
{
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
private void InitMemoryDomains()
|
||||
{
|
||||
|
|
|
@ -583,7 +583,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
|
||||
#region debugging tools
|
||||
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
unsafe void SetMemoryDomains()
|
||||
{
|
||||
|
|
|
@ -622,7 +622,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
|
|||
MemoryDomains = new MemoryDomainList(mmd, 0);
|
||||
}
|
||||
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -322,7 +322,7 @@ namespace BizHawk.Emulation.Cores.WonderSwan
|
|||
private readonly MemoryCallbackSystem _memorycallbacks = new MemoryCallbackSystem();
|
||||
public IMemoryCallbackSystem MemoryCallbacks { get { return _memorycallbacks; } }
|
||||
|
||||
public MemoryDomainList MemoryDomains { get; private set; }
|
||||
public IMemoryDomainList MemoryDomains { get; private set; }
|
||||
|
||||
public IDictionary<string, RegisterValue> GetCpuFlagsAndRegisters()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue