expose a possible IMonitor for memory domains, use it to speed up RAM Search for waterbox cores (25-30% speedup?)
see #3296
This commit is contained in:
parent
f1162d4912
commit
596bd03ebe
|
@ -198,10 +198,18 @@ namespace BizHawk.Client.Common.RamSearchEngine
|
|||
{
|
||||
if (_settings.IsDetailed())
|
||||
{
|
||||
foreach (IMiniWatchDetails watch in _watchList)
|
||||
{
|
||||
watch.Update(_settings.PreviousType, _settings.Domain, _settings.BigEndian);
|
||||
try
|
||||
{
|
||||
_settings.Domain.Monitor?.Enter();
|
||||
foreach (IMiniWatchDetails watch in _watchList)
|
||||
{
|
||||
watch.Update(_settings.PreviousType, _settings.Domain, _settings.BigEndian);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_settings.Domain.Monitor?.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,12 @@ namespace BizHawk.Emulation.Common
|
|||
|
||||
public bool Writable { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// only use this if you are expecting to do a lot of peeks/pokes
|
||||
/// MAY BE NULL
|
||||
/// </summary>
|
||||
public IMonitor Monitor { get; protected set; }
|
||||
|
||||
public abstract byte PeekByte(long addr);
|
||||
|
||||
public abstract void PokeByte(long addr, byte val);
|
||||
|
|
|
@ -51,6 +51,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
|
|||
_addressMangler = 0;
|
||||
}
|
||||
Definition = m;
|
||||
Monitor = _monitor;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue