Remove MemoryDomains from IEmulator into a new Interface, IMemoryDomains, Add this interface to existing cores, except null emulator (and removed memory domain related code from it). Refactored EmuHawk for ram tools to use an instance of IMemoryDomains rather than IEmulator, don't expose ram tools unless the core implements IMemoryDomains. Still a few misc todos, and probably some cleanup
This commit is contained in:
parent
5b8898e1d8
commit
5ba74c631c
|
@ -3,6 +3,7 @@ using System.ComponentModel;
|
|||
|
||||
using LuaInterface;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
|
@ -19,7 +20,19 @@ namespace BizHawk.Client.Common
|
|||
|
||||
protected override MemoryDomain Domain
|
||||
{
|
||||
get { return Global.Emulator.MemoryDomains.MainMemory; }
|
||||
get
|
||||
{
|
||||
if (Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
return (Global.Emulator as IMemoryDomains).MemoryDomains.MainMemory;
|
||||
}
|
||||
else
|
||||
{
|
||||
var error = string.Format("Error: {0} does not implement memory domains", Global.Emulator.Attributes().CoreName);
|
||||
Log(error);
|
||||
throw new NotImplementedException(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Unique Library Methods
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.ComponentModel;
|
|||
|
||||
using LuaInterface;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
|
@ -14,20 +15,40 @@ namespace BizHawk.Client.Common
|
|||
public MemoryLuaLibrary(Lua lua)
|
||||
: base(lua)
|
||||
{
|
||||
_currentMemoryDomain = Global.Emulator.MemoryDomains.IndexOf(Global.Emulator.MemoryDomains.MainMemory);
|
||||
if (Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
var domains = (Global.Emulator as IMemoryDomains).MemoryDomains;
|
||||
_currentMemoryDomain = domains.IndexOf(domains.MainMemory);
|
||||
}
|
||||
}
|
||||
|
||||
public MemoryLuaLibrary(Lua lua, Action<string> logOutputCallback)
|
||||
: base(lua, logOutputCallback)
|
||||
{
|
||||
_currentMemoryDomain = Global.Emulator.MemoryDomains.IndexOf(Global.Emulator.MemoryDomains.MainMemory);
|
||||
if (Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
var domains = (Global.Emulator as IMemoryDomains).MemoryDomains;
|
||||
_currentMemoryDomain = domains.IndexOf(domains.MainMemory);
|
||||
}
|
||||
}
|
||||
|
||||
public override string Name { get { return "memory"; } }
|
||||
|
||||
protected override MemoryDomain Domain
|
||||
{
|
||||
get { return Global.Emulator.MemoryDomains[_currentMemoryDomain]; }
|
||||
get
|
||||
{
|
||||
if (Global.Emulator.HasMemoryDomains()) // IMemoryDomains TODO: don't register memory libraries if core is not IMemoryDomains
|
||||
{
|
||||
return (Global.Emulator as IMemoryDomains).MemoryDomains[_currentMemoryDomain];
|
||||
}
|
||||
else
|
||||
{
|
||||
var error = string.Format("Error: {0} does not implement memory domains", Global.Emulator.Attributes().CoreName);
|
||||
Log(error);
|
||||
throw new NotImplementedException(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Unique Library Methods
|
||||
|
@ -39,9 +60,9 @@ namespace BizHawk.Client.Common
|
|||
public LuaTable GetMemoryDomainList()
|
||||
{
|
||||
var table = Lua.NewTable();
|
||||
for (int i = 0; i < Global.Emulator.MemoryDomains.Count; i++)
|
||||
for (int i = 0; i < DomainList.Count; i++)
|
||||
{
|
||||
table[i] = Global.Emulator.MemoryDomains[i].Name;
|
||||
table[i] = DomainList[i].Name;
|
||||
}
|
||||
|
||||
return table;
|
||||
|
@ -71,9 +92,9 @@ namespace BizHawk.Client.Common
|
|||
)]
|
||||
public bool UseMemoryDomain(string domain)
|
||||
{
|
||||
for (var i = 0; i < Global.Emulator.MemoryDomains.Count; i++)
|
||||
for (var i = 0; i < DomainList.Count; i++)
|
||||
{
|
||||
if (Global.Emulator.MemoryDomains[i].Name == domain)
|
||||
if (DomainList[i].Name == domain)
|
||||
{
|
||||
_currentMemoryDomain = i;
|
||||
return true;
|
||||
|
|
|
@ -3,10 +3,10 @@ using System.ComponentModel;
|
|||
using System.Linq;
|
||||
|
||||
using LuaInterface;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Nintendo.NES;
|
||||
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
|
||||
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
[Description("Functions related specifically to Nes Cores")]
|
||||
|
@ -34,7 +34,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
var decoder = new NESGameGenieDecoder(code);
|
||||
var watch = Watch.GenerateWatch(
|
||||
Global.Emulator.MemoryDomains["System Bus"],
|
||||
(Global.Emulator as IMemoryDomains).MemoryDomains["System Bus"],
|
||||
decoder.Address,
|
||||
Watch.WatchSize.Byte,
|
||||
Watch.DisplayType.Hex,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using LuaInterface;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
|
@ -17,6 +18,23 @@ namespace BizHawk.Client.Common
|
|||
|
||||
protected abstract MemoryDomain Domain { get; }
|
||||
|
||||
protected MemoryDomainList DomainList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Global.Emulator.HasMemoryDomains()) // IMemoryDomains TODO: don't register memory libraries if core is not IMemoryDomains
|
||||
{
|
||||
return (Global.Emulator as IMemoryDomains).MemoryDomains;
|
||||
}
|
||||
else
|
||||
{
|
||||
var error = string.Format("Error: {0} does not implement memory domains", Global.Emulator.Attributes().CoreName);
|
||||
Log(error);
|
||||
throw new NotImplementedException(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected uint ReadUnsignedByte(int addr)
|
||||
{
|
||||
if (addr < Domain.Size)
|
||||
|
|
|
@ -456,7 +456,7 @@ namespace BizHawk.Client.Common
|
|||
compare = int.Parse(vals[2], NumberStyles.HexNumber);
|
||||
}
|
||||
|
||||
var domain = Global.Emulator.MemoryDomains[vals[3]];
|
||||
var domain = (Global.Emulator as IMemoryDomains).MemoryDomains[vals[3]]; // IMemoryDomains TODO
|
||||
var enabled = vals[4] == "1";
|
||||
var name = vals[5];
|
||||
|
||||
|
|
|
@ -19,13 +19,14 @@ namespace BizHawk.Client.Common
|
|||
private ComparisonOperator _operator = ComparisonOperator.Equal;
|
||||
|
||||
private List<IMiniWatch> _watchList = new List<IMiniWatch>();
|
||||
private readonly Settings _settings = new Settings();
|
||||
private readonly Settings _settings;
|
||||
private readonly UndoHistory<IMiniWatch> _history = new UndoHistory<IMiniWatch>(true);
|
||||
private bool _keepHistory = true;
|
||||
private bool _isSorted = true; // Tracks whether or not the list is sorted by address, if it is, binary search can be used for finding watches
|
||||
|
||||
public RamSearchEngine(Settings settings)
|
||||
{
|
||||
_settings = new Settings((IMemoryDomains)Global.Emulator);
|
||||
_settings.Mode = settings.Mode;
|
||||
_settings.Domain = settings.Domain;
|
||||
_settings.Size = settings.Size;
|
||||
|
@ -1160,6 +1161,20 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public class Settings
|
||||
{
|
||||
public Settings(IMemoryDomains core)
|
||||
{
|
||||
BigEndian = core.MemoryDomains.MainMemory.EndianType == MemoryDomain.Endian.Big;
|
||||
Size = (Watch.WatchSize)Global.SystemInfo.ByteSize;
|
||||
Type = Watch.DisplayType.Unsigned;
|
||||
Mode = core.MemoryDomains.MainMemory.Size > (1024 * 1024) ?
|
||||
SearchMode.Fast :
|
||||
SearchMode.Detailed;
|
||||
|
||||
Domain = core.MemoryDomains.MainMemory;
|
||||
CheckMisAligned = false;
|
||||
PreviousType = Watch.PreviousType.LastSearch;
|
||||
}
|
||||
|
||||
/*Require restart*/
|
||||
public enum SearchMode { Fast, Detailed }
|
||||
|
||||
|
@ -1172,20 +1187,6 @@ namespace BizHawk.Client.Common
|
|||
public Watch.DisplayType Type { get; set; }
|
||||
public bool BigEndian { get; set; }
|
||||
public Watch.PreviousType PreviousType { get; set; }
|
||||
|
||||
public Settings()
|
||||
{
|
||||
BigEndian = Global.Emulator.MemoryDomains.MainMemory.EndianType == MemoryDomain.Endian.Big;
|
||||
Size = (Watch.WatchSize)Global.SystemInfo.ByteSize;
|
||||
Type = Watch.DisplayType.Unsigned;
|
||||
Mode = Global.Emulator.MemoryDomains.MainMemory.Size > (1024 * 1024) ?
|
||||
SearchMode.Fast :
|
||||
SearchMode.Detailed;
|
||||
|
||||
Domain = Global.Emulator.MemoryDomains.MainMemory;
|
||||
CheckMisAligned = false;
|
||||
PreviousType = Watch.PreviousType.LastSearch;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
public class WatchList : IList<Watch>
|
||||
{
|
||||
private readonly IMemoryDomains Core;
|
||||
private List<Watch> _watchList = new List<Watch>();
|
||||
private MemoryDomain _domain;
|
||||
private string _currentFilename = string.Empty;
|
||||
|
@ -24,8 +25,9 @@ namespace BizHawk.Client.Common
|
|||
public const string DOMAIN = "DomainColumn";
|
||||
public const string NOTES = "NotesColumn";
|
||||
|
||||
public WatchList(MemoryDomain domain)
|
||||
public WatchList(IMemoryDomains core, MemoryDomain domain)
|
||||
{
|
||||
Core = core;
|
||||
_domain = domain;
|
||||
}
|
||||
|
||||
|
@ -471,7 +473,7 @@ namespace BizHawk.Client.Common
|
|||
|
||||
// Temporary, rename if kept
|
||||
int addr;
|
||||
var memDomain = Global.Emulator.MemoryDomains.MainMemory;
|
||||
var memDomain = Core.MemoryDomains.MainMemory;
|
||||
|
||||
var temp = line.Substring(0, line.IndexOf('\t'));
|
||||
try
|
||||
|
@ -509,7 +511,7 @@ namespace BizHawk.Client.Common
|
|||
startIndex = line.IndexOf('\t') + 1;
|
||||
line = line.Substring(startIndex, line.Length - startIndex); // Domain
|
||||
temp = line.Substring(0, line.IndexOf('\t'));
|
||||
memDomain = Global.Emulator.MemoryDomains[temp] ?? Global.Emulator.MemoryDomains.MainMemory;
|
||||
memDomain = Core.MemoryDomains[temp] ?? Core.MemoryDomains.MainMemory;
|
||||
}
|
||||
|
||||
startIndex = line.IndexOf('\t') + 1;
|
||||
|
@ -523,10 +525,10 @@ namespace BizHawk.Client.Common
|
|||
type,
|
||||
notes,
|
||||
bigEndian));
|
||||
_domain = Global.Emulator.MemoryDomains[domain];
|
||||
_domain = Core.MemoryDomains[domain];
|
||||
}
|
||||
|
||||
Domain = Global.Emulator.MemoryDomains[domain] ?? Global.Emulator.MemoryDomains.MainMemory;
|
||||
Domain = Core.MemoryDomains[domain] ?? Core.MemoryDomains.MainMemory;
|
||||
_currentFilename = path;
|
||||
}
|
||||
|
||||
|
|
|
@ -1101,13 +1101,17 @@ namespace BizHawk.Client.EmuHawk
|
|||
VirtualPadMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["Virtual Pad"].Bindings;
|
||||
TraceLoggerMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["Trace Logger"].Bindings;
|
||||
TraceLoggerMenuItem.Enabled = Global.Emulator.CoreComm.CpuTraceAvailable;
|
||||
|
||||
TAStudioMenuItem.Enabled =
|
||||
VirtualPadMenuItem.Enabled =
|
||||
!(Global.Emulator is NullEmulator);
|
||||
|
||||
CheatsMenuItem.Enabled =
|
||||
HexEditorMenuItem.Enabled =
|
||||
RamSearchMenuItem.Enabled =
|
||||
RamWatchMenuItem.Enabled =
|
||||
TAStudioMenuItem.Enabled =
|
||||
VirtualPadMenuItem.Enabled =
|
||||
!(Global.Emulator is NullEmulator);
|
||||
Global.Emulator.HasMemoryDomains();
|
||||
|
||||
batchRunnerToolStripMenuItem.Visible = VersionInfo.DeveloperBuild;
|
||||
|
||||
TAStudioMenuItem.Visible = VersionInfo.DeveloperBuild;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using BizHawk.Client.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
|
@ -287,10 +288,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.Tools.LoadRamWatch(true);
|
||||
break;
|
||||
case "Ram Search":
|
||||
GlobalWin.Tools.Load<RamSearch>();
|
||||
if (Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
GlobalWin.Tools.Load<RamSearch>();
|
||||
}
|
||||
break;
|
||||
case "Hex Editor":
|
||||
GlobalWin.Tools.Load<HexEditor>();
|
||||
if (Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
GlobalWin.Tools.Load<HexEditor>();
|
||||
}
|
||||
break;
|
||||
case "Trace Logger":
|
||||
GlobalWin.Tools.LoadTraceLogger();
|
||||
|
@ -299,7 +306,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
OpenLuaConsole();
|
||||
break;
|
||||
case "Cheats":
|
||||
GlobalWin.Tools.Load<Cheats>();
|
||||
if (Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
GlobalWin.Tools.Load<Cheats>();
|
||||
}
|
||||
break;
|
||||
case "TAStudio":
|
||||
GlobalWin.Tools.Load<TAStudio>();
|
||||
|
|
|
@ -9,6 +9,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class CheatEdit : UserControl
|
||||
{
|
||||
public IMemoryDomains Core { get; set; }
|
||||
|
||||
public CheatEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -32,10 +34,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (Global.Emulator != null) // the designer needs this check
|
||||
{
|
||||
DomainDropDown.Items.Clear();
|
||||
DomainDropDown.Items.AddRange(Global.Emulator.MemoryDomains
|
||||
DomainDropDown.Items.AddRange(Core.MemoryDomains
|
||||
.Select(d => d.ToString())
|
||||
.ToArray());
|
||||
DomainDropDown.SelectedItem = Global.Emulator.MemoryDomains.MainMemory.ToString();
|
||||
DomainDropDown.SelectedItem = Core.MemoryDomains.MainMemory.ToString();
|
||||
}
|
||||
|
||||
SetFormToDefault();
|
||||
|
@ -89,7 +91,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
if (Global.Emulator != null)
|
||||
{
|
||||
AddressBox.SetHexProperties(Global.Emulator.MemoryDomains.MainMemory.Size);
|
||||
AddressBox.SetHexProperties(Core.MemoryDomains.MainMemory.Size);
|
||||
}
|
||||
|
||||
ValueBox.ByteSize =
|
||||
|
@ -112,7 +114,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
SetTypeSelected(Watch.DisplayType.Hex);
|
||||
|
||||
CheckFormState();
|
||||
CompareBox.Text = String.Empty; // TODO: A needed hack until WatchValueBox.ToRawInt() becomes nullable
|
||||
CompareBox.Text = string.Empty; // TODO: A needed hack until WatchValueBox.ToRawInt() becomes nullable
|
||||
_loading = false;
|
||||
}
|
||||
|
||||
|
@ -200,7 +202,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (!_loading)
|
||||
{
|
||||
var domain = Global.Emulator.MemoryDomains[DomainDropDown.SelectedItem.ToString()];
|
||||
var domain = Core.MemoryDomains[DomainDropDown.SelectedItem.ToString()];
|
||||
AddressBox.SetHexProperties(domain.Size);
|
||||
}
|
||||
}
|
||||
|
@ -276,13 +278,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
get
|
||||
{
|
||||
var domain = Global.Emulator.MemoryDomains[DomainDropDown.SelectedItem.ToString()];
|
||||
var domain = Core.MemoryDomains[DomainDropDown.SelectedItem.ToString()];
|
||||
var address = AddressBox.ToRawInt().Value;
|
||||
//var address = AddressBox.ToRawInt() ?? 0;
|
||||
if (address < domain.Size)
|
||||
{
|
||||
var watch = Watch.GenerateWatch(
|
||||
Global.Emulator.MemoryDomains[DomainDropDown.SelectedItem.ToString()],
|
||||
Core.MemoryDomains[DomainDropDown.SelectedItem.ToString()],
|
||||
AddressBox.ToRawInt().Value,
|
||||
GetCurrentSize(),
|
||||
Watch.StringToDisplayType(DisplayTypeDropDown.SelectedItem.ToString()),
|
||||
|
|
|
@ -6,10 +6,12 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
using BizHawk.Emulation.Cores.Nintendo.SNES;
|
||||
using BizHawk.Emulation.Cores.Sega.Genesis;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Client.EmuHawk.ToolExtensions;
|
||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||
|
||||
|
@ -45,11 +47,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
private string _sortedColumn = string.Empty;
|
||||
private bool _sortReverse;
|
||||
|
||||
private readonly IMemoryDomains Core;
|
||||
|
||||
public bool UpdateBefore { get { return false; } }
|
||||
|
||||
public Cheats()
|
||||
{
|
||||
Core = (IMemoryDomains)Global.Emulator; // Cast is intentional in order to get a cast excpetion rather than a null reference exception later
|
||||
InitializeComponent();
|
||||
CheatEditor.Core = Core;
|
||||
|
||||
Closing += (o, e) =>
|
||||
{
|
||||
if (AskSaveChanges())
|
||||
|
@ -83,6 +90,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void Restart()
|
||||
{
|
||||
if (!Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
StartNewList();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Globalization;
|
|||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
|
@ -295,7 +296,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
var watch = Watch.GenerateWatch(
|
||||
Global.Emulator.MemoryDomains["System Bus"],
|
||||
(Global.Emulator as IMemoryDomains).MemoryDomains["System Bus"],
|
||||
address,
|
||||
Watch.WatchSize.Byte,
|
||||
Watch.DisplayType.Hex,
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Globalization;
|
|||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
#pragma warning disable 675 //TOOD: fix the potential problem this is masking
|
||||
|
@ -356,7 +357,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
var watch = Watch.GenerateWatch(
|
||||
Global.Emulator.MemoryDomains["MD CART"],
|
||||
(Global.Emulator as IMemoryDomains).MemoryDomains["MD CART"], // IMemoryDomains TODO: don't expose this dialog unless the core implements IMemoryDomains
|
||||
address,
|
||||
Watch.WatchSize.Word,
|
||||
Watch.DisplayType.Hex,
|
||||
|
|
|
@ -13,6 +13,7 @@ using BizHawk.Common.NumberExtensions;
|
|||
using BizHawk.Common.StringExtensions;
|
||||
using BizHawk.Common.IOExtensions;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||
using BizHawk.Client.EmuHawk.ToolExtensions;
|
||||
|
@ -55,8 +56,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
private bool _bigEndian;
|
||||
private int _dataSize;
|
||||
|
||||
private readonly MemoryDomainList MemoryDomains;
|
||||
|
||||
public HexEditor()
|
||||
{
|
||||
MemoryDomains = ((IMemoryDomains)Global.Emulator).MemoryDomains; // The cast is intentional, we want a specific cast error, not an eventual null reference error
|
||||
InitializeComponent();
|
||||
AddressesLabel.BackColor = Color.Transparent;
|
||||
LoadConfigSettings();
|
||||
|
@ -119,6 +123,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void Restart()
|
||||
{
|
||||
if (!Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
if (!IsHandleCreated || IsDisposed)
|
||||
{
|
||||
return;
|
||||
|
@ -311,11 +320,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private static int? GetDomainInt(string name)
|
||||
private int? GetDomainInt(string name)
|
||||
{
|
||||
for (var i = 0; i < Global.Emulator.MemoryDomains.Count; i++)
|
||||
for (var i = 0; i < MemoryDomains.Count; i++)
|
||||
{
|
||||
if (Global.Emulator.MemoryDomains[i].Name == name)
|
||||
if (MemoryDomains[i].Name == name)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
@ -628,9 +637,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
// <zeromus> THIS IS HORRIBLE.
|
||||
SetMemoryDomain(_romDomain);
|
||||
}
|
||||
else if (pos < Global.Emulator.MemoryDomains.Count)
|
||||
else if (pos < MemoryDomains.Count)
|
||||
{
|
||||
SetMemoryDomain(Global.Emulator.MemoryDomains[pos]);
|
||||
SetMemoryDomain(MemoryDomains[pos]);
|
||||
}
|
||||
|
||||
SetHeader();
|
||||
|
@ -650,11 +659,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
MemoryDomainsMenuItem.DropDownItems.Clear();
|
||||
|
||||
for (var i = 0; i < Global.Emulator.MemoryDomains.Count; i++)
|
||||
for (var i = 0; i < MemoryDomains.Count; i++)
|
||||
{
|
||||
if (Global.Emulator.MemoryDomains[i].Size > 0)
|
||||
if (MemoryDomains[i].Size > 0)
|
||||
{
|
||||
var str = Global.Emulator.MemoryDomains[i].ToString();
|
||||
var str = MemoryDomains[i].ToString();
|
||||
var item = new ToolStripMenuItem { Text = str };
|
||||
{
|
||||
var temp = i;
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
|
@ -230,7 +231,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (!string.IsNullOrWhiteSpace(AddressBox.Text) && !string.IsNullOrWhiteSpace(ValueBox.Text))
|
||||
{
|
||||
var watch = Watch.GenerateWatch(
|
||||
Global.Emulator.MemoryDomains["System Bus"],
|
||||
(Global.Emulator as IMemoryDomains).MemoryDomains["System Bus"], // IMemoryDomains TODO: Don't expose this dialog if core does not implement IMemoryDomains
|
||||
AddressBox.ToRawInt().Value,
|
||||
Watch.WatchSize.Byte,
|
||||
Watch.DisplayType.Hex,
|
||||
|
|
|
@ -4,9 +4,11 @@ using System.Drawing;
|
|||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Components.H6280;
|
||||
using BizHawk.Emulation.Cores.PCEngine;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Client.EmuHawk.ToolExtensions;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
|
@ -302,7 +304,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
using (var fs = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
|
||||
{
|
||||
_cdl.Disassemble(fs, Global.Emulator.MemoryDomains);
|
||||
_cdl.Disassemble(fs, (Global.Emulator as IMemoryDomains).MemoryDomains); // IMemoryDomains TODO: don't expose this dialog unless core implmements IMemoryDomains
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,9 @@ using System.Globalization;
|
|||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Nintendo.SNES;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
|
@ -274,7 +275,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
var watch = Watch.GenerateWatch(
|
||||
Global.Emulator.MemoryDomains["BUS"],
|
||||
(Global.Emulator as IMemoryDomains).MemoryDomains["BUS"], // IMemoryDomains TODO: don't expose this dialog if not implementing this interface
|
||||
address,
|
||||
Watch.WatchSize.Byte,
|
||||
Watch.DisplayType.Hex,
|
||||
|
|
|
@ -67,11 +67,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
var record = _currentTasMovie[index];
|
||||
|
||||
if (!(record.Lagged ?? false))
|
||||
{
|
||||
int zzz = 0;
|
||||
}
|
||||
|
||||
if (columnName == FrameColumnName)
|
||||
{
|
||||
if (Global.Emulator.Frame == index)
|
||||
|
|
|
@ -3,7 +3,8 @@ using System.Collections.Generic;
|
|||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
using BizHawk.Emulation.Cores.Calculators;
|
||||
using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
|
||||
using BizHawk.Emulation.Cores.Nintendo.GBA;
|
||||
|
@ -12,6 +13,8 @@ using BizHawk.Emulation.Cores.Nintendo.SNES;
|
|||
using BizHawk.Emulation.Cores.PCEngine;
|
||||
using BizHawk.Emulation.Cores.Sega.MasterSystem;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public partial class ToolBox : Form, IToolForm
|
||||
|
@ -51,6 +54,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SetTools()
|
||||
{
|
||||
HexEditorToolbarItem.Visible =
|
||||
RamWatchToolbarItem.Visible =
|
||||
RamSearchToolbarItem.Visible =
|
||||
CheatsToolBarItem.Visible =
|
||||
Global.Emulator.HasMemoryDomains();
|
||||
|
||||
NesPPUToolbarItem.Visible =
|
||||
NesDebuggerToolbarItem.Visible =
|
||||
NesNameTableToolbarItem.Visible =
|
||||
|
@ -70,6 +79,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
PceCdlToolbarItem.Visible =
|
||||
PceBgViewerToolbarItem.Visible =
|
||||
PceTileToolbarItem.Visible =
|
||||
PceSoundDebuggerButton.Visible =
|
||||
Global.Emulator is PCEngine;
|
||||
|
||||
GBGameGenieToolbarItem.Visible =
|
||||
|
|
|
@ -4,8 +4,10 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
|
@ -207,16 +209,19 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public static void UpdateCheatRelatedTools(object sender, CheatCollection.CheatListEventArgs e)
|
||||
{
|
||||
GlobalWin.Tools.UpdateValues<RamWatch>();
|
||||
GlobalWin.Tools.UpdateValues<RamSearch>();
|
||||
GlobalWin.Tools.UpdateValues<HexEditor>();
|
||||
|
||||
if (GlobalWin.Tools.Has<Cheats>())
|
||||
if (Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
GlobalWin.Tools.Cheats.UpdateDialog();
|
||||
}
|
||||
GlobalWin.Tools.UpdateValues<RamWatch>();
|
||||
GlobalWin.Tools.UpdateValues<RamSearch>();
|
||||
GlobalWin.Tools.UpdateValues<HexEditor>();
|
||||
|
||||
GlobalWin.MainForm.UpdateCheatStatus();
|
||||
if (GlobalWin.Tools.Has<Cheats>())
|
||||
{
|
||||
GlobalWin.Tools.Cheats.UpdateDialog();
|
||||
}
|
||||
|
||||
GlobalWin.MainForm.UpdateCheatStatus();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ViewInHexEditor(MemoryDomain domain, IEnumerable<int> addresses, Watch.WatchSize size)
|
||||
|
|
|
@ -11,8 +11,11 @@ using System.Windows.Forms;
|
|||
|
||||
using BizHawk.Common.StringExtensions;
|
||||
using BizHawk.Common.NumberExtensions;
|
||||
using BizHawk.Client.Common;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||
using BizHawk.Client.EmuHawk.ToolExtensions;
|
||||
|
||||
|
@ -47,6 +50,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private bool _dropdownDontfire; // Used as a hack to get around lame .net dropdowns, there's no way to set their index without firing the selectedindexchanged event!
|
||||
|
||||
private readonly IMemoryDomains Core;
|
||||
|
||||
public const int MaxDetailedSize = 1024 * 1024; // 1mb, semi-arbituary decision, sets the size to check for and automatically switch to fast mode for the user
|
||||
public const int MaxSupportedSize = 1024 * 1024 * 64; // 64mb, semi-arbituary decision, sets the maximum size ram search will support (as it will crash beyond this)
|
||||
|
||||
|
@ -64,6 +69,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public RamSearch()
|
||||
{
|
||||
Core = (IMemoryDomains)Global.Emulator; // Cast is intentional, better to get a cast exception than a more amibious null reference exception later
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
|
@ -76,7 +82,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_sortedColumn = string.Empty;
|
||||
_sortReverse = false;
|
||||
|
||||
_settings = new RamSearchEngine.Settings();
|
||||
_settings = new RamSearchEngine.Settings(Core);
|
||||
_searches = new RamSearchEngine(_settings);
|
||||
|
||||
TopMost = Global.Config.RamSearchSettings.TopMost;
|
||||
|
@ -118,7 +124,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
SpecificValueBox.Type = _settings.Type;
|
||||
|
||||
MessageLabel.Text = string.Empty;
|
||||
SpecificAddressBox.MaxLength = (Global.Emulator.MemoryDomains.MainMemory.Size - 1).NumHexDigits();
|
||||
SpecificAddressBox.MaxLength = (Core.MemoryDomains.MainMemory.Size - 1).NumHexDigits();
|
||||
HardSetSizeDropDown(_settings.Size);
|
||||
PopulateTypeDropDown();
|
||||
HardSetDisplayTypeDropDown(_settings.Type);
|
||||
|
@ -283,7 +289,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
return;
|
||||
}
|
||||
|
||||
_settings.Domain = Global.Emulator.MemoryDomains.MainMemory;
|
||||
if (!Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
_settings.Domain = Core.MemoryDomains.MainMemory;
|
||||
MessageLabel.Text = "Search restarted";
|
||||
DoDomainSizeCheck();
|
||||
NewSearch();
|
||||
|
@ -576,7 +587,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SetMemoryDomain(string name)
|
||||
{
|
||||
_settings.Domain = Global.Emulator.MemoryDomains[name];
|
||||
_settings.Domain = Core.MemoryDomains[name];
|
||||
SetReboot(true);
|
||||
SpecificAddressBox.MaxLength = (_settings.Domain.Size - 1).NumHexDigits();
|
||||
DoDomainSizeCheck();
|
||||
|
@ -833,7 +844,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_currentFileName = file.FullName;
|
||||
}
|
||||
|
||||
var watches = new WatchList(_settings.Domain);
|
||||
var watches = new WatchList(Core, _settings.Domain);
|
||||
watches.Load(file.FullName, append);
|
||||
|
||||
var watchList = watches.Where(x => !x.IsSeparator);
|
||||
|
@ -989,7 +1000,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (!string.IsNullOrWhiteSpace(_currentFileName))
|
||||
{
|
||||
var watches = new WatchList(_settings.Domain) { CurrentFileName = _currentFileName };
|
||||
var watches = new WatchList(Core, _settings.Domain) { CurrentFileName = _currentFileName };
|
||||
for (var i = 0; i < _searches.Count; i++)
|
||||
{
|
||||
watches.Add(_searches[i]);
|
||||
|
@ -1017,7 +1028,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SaveAsMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var watches = new WatchList(_settings.Domain) { CurrentFileName = _currentFileName };
|
||||
var watches = new WatchList(Core, _settings.Domain) { CurrentFileName = _currentFileName };
|
||||
for (var i = 0; i < _searches.Count; i++)
|
||||
{
|
||||
watches.Add(_searches[i]);
|
||||
|
@ -1056,7 +1067,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
MemoryDomainsSubMenu.DropDownItems.Clear();
|
||||
MemoryDomainsSubMenu.DropDownItems.AddRange(
|
||||
Global.Emulator.MemoryDomains.MenuItems(SetMemoryDomain, _searches.Domain.Name, MaxSupportedSize)
|
||||
Core.MemoryDomains.MenuItems(SetMemoryDomain, _searches.Domain.Name, MaxSupportedSize)
|
||||
.ToArray());
|
||||
}
|
||||
|
||||
|
@ -1370,9 +1381,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{ "DiffColumn", -1 },
|
||||
};
|
||||
|
||||
|
||||
|
||||
_settings = new RamSearchEngine.Settings();
|
||||
_settings = new RamSearchEngine.Settings(Core);
|
||||
if (_settings.Mode == RamSearchEngine.Settings.SearchMode.Fast)
|
||||
{
|
||||
SetToFastMode();
|
||||
|
|
|
@ -7,6 +7,9 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.IEmulatorExtensions;
|
||||
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||
using BizHawk.Client.EmuHawk.ToolExtensions;
|
||||
|
@ -26,7 +29,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
{ WatchList.NOTES, 128 },
|
||||
};
|
||||
|
||||
private readonly WatchList _watches = new WatchList(Global.Emulator.MemoryDomains.MainMemory);
|
||||
private readonly WatchList _watches;
|
||||
private readonly IMemoryDomains Core;
|
||||
|
||||
|
||||
private int _defaultWidth;
|
||||
private int _defaultHeight;
|
||||
|
@ -36,6 +41,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public RamWatch()
|
||||
{
|
||||
Core = (IMemoryDomains)Global.Emulator; // Cast is intentional, better to get a cast exception than a null reference exception later
|
||||
_watches = new WatchList(Core, Core.MemoryDomains.MainMemory);
|
||||
InitializeComponent();
|
||||
WatchListView.QueryItemText += WatchListView_QueryItemText;
|
||||
WatchListView.QueryItemBkColor += WatchListView_QueryItemBkColor;
|
||||
|
@ -188,6 +195,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
return;
|
||||
}
|
||||
|
||||
if (!Global.Emulator.HasMemoryDomains())
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_watches.CurrentFileName))
|
||||
{
|
||||
_watches.Reload();
|
||||
|
@ -556,7 +568,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void SetMemoryDomain(string name)
|
||||
{
|
||||
_watches.Domain = Global.Emulator.MemoryDomains[name];
|
||||
_watches.Domain = Core.MemoryDomains[name];
|
||||
SetPlatformAndMemoryDomainLabel();
|
||||
Update();
|
||||
}
|
||||
|
@ -737,7 +749,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
MemoryDomainsSubMenu.DropDownItems.Clear();
|
||||
MemoryDomainsSubMenu.DropDownItems.AddRange(
|
||||
Global.Emulator.MemoryDomains.MenuItems(SetMemoryDomain, _watches.Domain.Name)
|
||||
Core.MemoryDomains.MenuItems(SetMemoryDomain, _watches.Domain.Name)
|
||||
.ToArray());
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
public enum Mode { New, Duplicate, Edit };
|
||||
|
||||
private readonly List<Watch> _watchList = new List<Watch>();
|
||||
private readonly IMemoryDomains Core;
|
||||
|
||||
private Mode _mode = Mode.New;
|
||||
private bool _loading = true;
|
||||
|
||||
|
@ -26,6 +28,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public WatchEditor()
|
||||
{
|
||||
Core = (IMemoryDomains)Global.Emulator;
|
||||
_changedDisplayType = false;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
@ -100,10 +103,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
_mode = mode;
|
||||
|
||||
DomainDropDown.Items.Clear();
|
||||
DomainDropDown.Items.AddRange(Global.Emulator.MemoryDomains
|
||||
DomainDropDown.Items.AddRange(Core.MemoryDomains
|
||||
.Select(d => d.ToString())
|
||||
.ToArray());
|
||||
DomainDropDown.SelectedItem = Global.Emulator.MemoryDomains.MainMemory.ToString();
|
||||
DomainDropDown.SelectedItem = Core.MemoryDomains.MainMemory.ToString();
|
||||
|
||||
SetTitle();
|
||||
}
|
||||
|
@ -129,7 +132,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (!_loading)
|
||||
{
|
||||
var domain = Global.Emulator.MemoryDomains.FirstOrDefault(d => d.Name == DomainDropDown.SelectedItem.ToString());
|
||||
var domain = Core.MemoryDomains.FirstOrDefault(d => d.Name == DomainDropDown.SelectedItem.ToString());
|
||||
if (domain != null)
|
||||
{
|
||||
AddressBox.SetHexProperties(domain.Size);
|
||||
|
@ -188,8 +191,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
var domain = Global.Emulator.MemoryDomains.FirstOrDefault(d => d.Name == DomainDropDown.SelectedItem.ToString()) ??
|
||||
Global.Emulator.MemoryDomains.MainMemory;
|
||||
var domain = Core.MemoryDomains.FirstOrDefault(d => d.Name == DomainDropDown.SelectedItem.ToString()) ??
|
||||
Core.MemoryDomains.MainMemory;
|
||||
BigEndianCheckBox.Checked = domain.EndianType == MemoryDomain.Endian.Big;
|
||||
}
|
||||
|
||||
|
@ -209,7 +212,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
default:
|
||||
case Mode.New:
|
||||
var domain = Global.Emulator.MemoryDomains.FirstOrDefault(d => d.Name == DomainDropDown.SelectedItem.ToString());
|
||||
var domain = Core.MemoryDomains.FirstOrDefault(d => d.Name == DomainDropDown.SelectedItem.ToString());
|
||||
var address = AddressBox.ToRawInt() ?? 0;
|
||||
var notes = NotesBox.Text;
|
||||
var type = Watch.StringToDisplayType(DisplayTypeDropDown.SelectedItem.ToString());
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
<Compile Include="Interfaces\IController.cs" />
|
||||
<Compile Include="Interfaces\ICoreFileProvider.cs" />
|
||||
<Compile Include="Interfaces\IEmulator.cs" />
|
||||
<Compile Include="Interfaces\IMemoryDomains.cs" />
|
||||
<Compile Include="Interfaces\ISoundProvider.cs" />
|
||||
<Compile Include="Interfaces\ISyncSoundProvider.cs" />
|
||||
<Compile Include="Interfaces\IVideoProvider.cs" />
|
||||
|
|
|
@ -8,5 +8,10 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
|
|||
{
|
||||
return (CoreAttributes)Attribute.GetCustomAttribute(core.GetType(), typeof(CoreAttributes));
|
||||
}
|
||||
|
||||
public static bool HasMemoryDomains(this IEmulator core)
|
||||
{
|
||||
return core is IMemoryDomains;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,12 +26,6 @@ namespace BizHawk.Emulation.Common
|
|||
public NullEmulator(CoreComm comm)
|
||||
{
|
||||
CoreComm = comm;
|
||||
var domains = new MemoryDomainList(
|
||||
new List<MemoryDomain>
|
||||
{
|
||||
new MemoryDomain("Main RAM", 1, MemoryDomain.Endian.Little, addr => 0, (a, v) => { })
|
||||
});
|
||||
memoryDomains = new MemoryDomainList(domains);
|
||||
|
||||
var d = DateTime.Now;
|
||||
xmas = d.Month == 12 && d.Day >= 17 && d.Day <= 27;
|
||||
|
@ -89,8 +83,7 @@ namespace BizHawk.Emulation.Common
|
|||
public int BufferWidth { get { return 256; } }
|
||||
public int BufferHeight { get { return 192; } }
|
||||
public int BackgroundColor { get { return 0; } }
|
||||
private readonly MemoryDomainList memoryDomains;
|
||||
public MemoryDomainList MemoryDomains { get { return memoryDomains; } }
|
||||
|
||||
public void Dispose() { }
|
||||
|
||||
public Dictionary<string, int> GetCpuFlagsAndRegisters()
|
||||
|
|
|
@ -127,16 +127,6 @@ namespace BizHawk.Emulation.Common
|
|||
/// </summary>
|
||||
CoreComm CoreComm { get; }
|
||||
|
||||
///The list of all avaialble memory domains
|
||||
/// A memory domain is a byte array that respresents a distinct part of the emulated system.
|
||||
/// By convention the Main Memory is the 1st domain in the list
|
||||
// All cores sould implement a System Bus domain that represents the standard "Open bus" range for that system,
|
||||
/// and a Main Memory which is typically the WRAM space (for instance, on NES - 0000-07FF),
|
||||
/// 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; }
|
||||
|
||||
//Debugging
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
namespace BizHawk.Emulation.Common
|
||||
{
|
||||
public interface IMemoryDomains
|
||||
{
|
||||
///The list of all avaialble memory domains
|
||||
/// A memory domain is a byte array that respresents a distinct part of the emulated system.
|
||||
/// By convention the Main Memory is the 1st domain in the list
|
||||
// All cores sould implement a System Bus domain that represents the standard "Open bus" range for that system,
|
||||
/// and a Main Memory which is typically the WRAM space (for instance, on NES - 0000-07FF),
|
||||
/// 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; }
|
||||
}
|
||||
}
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Calculators
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public class TI83 : IEmulator
|
||||
public class TI83 : IEmulator, IMemoryDomains
|
||||
{
|
||||
//hardware
|
||||
private readonly Z80A cpu = new Z80A();
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
isPorted: false,
|
||||
isReleased: false
|
||||
)]
|
||||
sealed public partial class C64 : IEmulator
|
||||
sealed public partial class C64 : IEmulator, IMemoryDomains
|
||||
{
|
||||
// internal variables
|
||||
private bool _islag = true;
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public partial class Atari2600 : IEmulator
|
||||
public partial class Atari2600 : IEmulator, IMemoryDomains
|
||||
{
|
||||
private readonly GameInfo _game;
|
||||
private bool _islag = true;
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800
|
|||
portedVersion: "v1.5",
|
||||
portedUrl: "http://emu7800.sourceforge.net/"
|
||||
)]
|
||||
public partial class Atari7800 : IEmulator
|
||||
public partial class Atari7800 : IEmulator, IMemoryDomains
|
||||
{
|
||||
// TODO:
|
||||
// some things don't work when you try to plug in a 2600 game
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public sealed partial class ColecoVision : IEmulator
|
||||
public sealed partial class ColecoVision : IEmulator, IMemoryDomains
|
||||
{
|
||||
// ROM
|
||||
public byte[] RomData;
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
|
|||
isPorted: false,
|
||||
isReleased: false
|
||||
)]
|
||||
public sealed partial class Intellivision : IEmulator
|
||||
public sealed partial class Intellivision : IEmulator, IMemoryDomains
|
||||
{
|
||||
byte[] Rom;
|
||||
GameInfo Game;
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
isPorted: true,
|
||||
isReleased: false
|
||||
)]
|
||||
public class GBA : IEmulator, IVideoProvider, ISyncSoundProvider, IGBAGPUViewable
|
||||
public class GBA : IEmulator, IVideoProvider, ISyncSoundProvider, IGBAGPUViewable, IMemoryDomains
|
||||
{
|
||||
public Dictionary<string, int> GetCpuFlagsAndRegisters()
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ using BizHawk.Common;
|
|||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
[CoreAttributes("VBA-Next", "many authors", true, true, "cd508312a29ed8c29dacac1b11c2dce56c338a54", "https://github.com/libretro/vba-next")]
|
||||
public class VBANext : IEmulator, IVideoProvider, ISyncSoundProvider, IGBAGPUViewable
|
||||
public class VBANext : IEmulator, IVideoProvider, ISyncSoundProvider, IGBAGPUViewable, IMemoryDomains
|
||||
{
|
||||
IntPtr Core;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
portedVersion: "SVN 344",
|
||||
portedUrl: "http://gambatte.sourceforge.net/"
|
||||
)]
|
||||
public class Gameboy : IEmulator, IVideoProvider, ISyncSoundProvider
|
||||
public class Gameboy : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains
|
||||
{
|
||||
#region ALL SAVESTATEABLE STATE GOES HERE
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
|
|||
portedVersion: "2.0",
|
||||
portedUrl: "https://code.google.com/p/mupen64plus/"
|
||||
)]
|
||||
public class N64 : IEmulator
|
||||
public class N64 : IEmulator, IMemoryDomains
|
||||
{
|
||||
private readonly N64Input _inputProvider;
|
||||
private readonly N64VideoProvider _videoProvider;
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public partial class NES : IEmulator
|
||||
public partial class NES : IEmulator, IMemoryDomains
|
||||
{
|
||||
static readonly bool USE_DATABASE = true;
|
||||
public RomStatus RomStatus;
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
|||
portedVersion: "0.7.0",
|
||||
portedUrl: "https://github.com/kode54/QuickNES"
|
||||
)]
|
||||
public class QuickNES : IEmulator, IVideoProvider, ISyncSoundProvider
|
||||
public class QuickNES : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains
|
||||
{
|
||||
#region FPU precision
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
portedVersion: "v87",
|
||||
portedUrl: "http://byuu.org/"
|
||||
)]
|
||||
public unsafe class LibsnesCore : IEmulator, IVideoProvider
|
||||
public unsafe class LibsnesCore : IEmulator, IVideoProvider, IMemoryDomains
|
||||
{
|
||||
public bool IsSGB { get; private set; }
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ using BizHawk.Emulation.Common;
|
|||
namespace BizHawk.Emulation.Cores.Nintendo.SNES9X
|
||||
{
|
||||
[CoreAttributes("Snes9x", "FIXME", true, false, "5e0319ab3ef9611250efb18255186d0dc0d7e125", "https://github.com/snes9xgit/snes9x")]
|
||||
public class Snes9x : IEmulator, IVideoProvider, ISyncSoundProvider
|
||||
public class Snes9x : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains
|
||||
{
|
||||
#region controller
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public sealed partial class PCEngine : IEmulator
|
||||
public sealed partial class PCEngine : IEmulator, IMemoryDomains
|
||||
{
|
||||
// ROM
|
||||
public byte[] RomData;
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
|
|||
isPorted: false,
|
||||
isReleased: false
|
||||
)]
|
||||
public sealed partial class Genesis : IEmulator
|
||||
public sealed partial class Genesis : IEmulator, IMemoryDomains
|
||||
{
|
||||
private int _lagcount = 0;
|
||||
private bool lagged = true;
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
isPorted: false,
|
||||
isReleased: true
|
||||
)]
|
||||
public sealed partial class SMS : IEmulator
|
||||
public sealed partial class SMS : IEmulator, IMemoryDomains
|
||||
{
|
||||
// Constants
|
||||
public const int BankSize = 16384;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Sega.Saturn
|
|||
portedVersion: "9.12",
|
||||
portedUrl: "http://yabause.org"
|
||||
)]
|
||||
public class Yabause : IEmulator, IVideoProvider, ISyncSoundProvider
|
||||
public class Yabause : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains
|
||||
{
|
||||
public static ControllerDefinition SaturnController = new ControllerDefinition
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
portedVersion: "r874",
|
||||
portedUrl: "https://code.google.com/p/genplus-gx/"
|
||||
)]
|
||||
public class GPGX : IEmulator, ISyncSoundProvider, IVideoProvider
|
||||
public class GPGX : IEmulator, ISyncSoundProvider, IVideoProvider, IMemoryDomains
|
||||
{
|
||||
static GPGX AttachedCore = null;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSP
|
|||
isPorted: true,
|
||||
isReleased: false
|
||||
)]
|
||||
public class PSP : IEmulator, IVideoProvider, ISyncSoundProvider
|
||||
public class PSP : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains
|
||||
{
|
||||
public static readonly ControllerDefinition PSPController = new ControllerDefinition
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
|
|||
isPorted: true,
|
||||
isReleased: false
|
||||
)]
|
||||
public unsafe class Octoshock : IEmulator, IVideoProvider, ISoundProvider
|
||||
public unsafe class Octoshock : IEmulator, IVideoProvider, ISoundProvider, IMemoryDomains
|
||||
{
|
||||
public string SystemId { get { return "NULL"; } }
|
||||
public static readonly ControllerDefinition NullController = new ControllerDefinition { Name = "Null Controller" };
|
||||
|
|
|
@ -12,7 +12,7 @@ using System.Runtime.InteropServices;
|
|||
namespace BizHawk.Emulation.Cores.WonderSwan
|
||||
{
|
||||
[CoreAttributes("Cygne/Mednafen", "Dox", true, true, "0.9.34.1", "http://mednafen.sourceforge.net/")]
|
||||
public class WonderSwan : IEmulator, IVideoProvider, ISyncSoundProvider
|
||||
public class WonderSwan : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains
|
||||
{
|
||||
#region Controller
|
||||
|
||||
|
|
Loading…
Reference in New Issue