Call mem callbacks with addr, value
This commit is contained in:
parent
766de68e18
commit
a8f293eec8
|
@ -13,28 +13,28 @@ namespace BizHawk.Client.ApiHawk
|
|||
public MemEventsApi () : base()
|
||||
{ }
|
||||
|
||||
public void AddReadCallback(Action cb, uint address, string domain)
|
||||
public void AddReadCallback(Action<uint, uint> cb, uint? address, string domain)
|
||||
{
|
||||
if (DebuggableCore.MemoryCallbacksAvailable())
|
||||
{
|
||||
DebuggableCore.MemoryCallbacks.Add(new MemoryCallback(domain, MemoryCallbackType.Read, "Plugin Hook", cb, address, null));
|
||||
}
|
||||
}
|
||||
public void AddWriteCallback(Action cb, uint address, string domain)
|
||||
public void AddWriteCallback(Action<uint, uint> cb, uint? address, string domain)
|
||||
{
|
||||
if (DebuggableCore.MemoryCallbacksAvailable())
|
||||
{
|
||||
DebuggableCore.MemoryCallbacks.Add(new MemoryCallback(domain, MemoryCallbackType.Write, "Plugin Hook", cb, address, null));
|
||||
}
|
||||
}
|
||||
public void AddExecCallback(Action cb, uint address, string domain)
|
||||
public void AddExecCallback(Action<uint, uint> cb, uint? address, string domain)
|
||||
{
|
||||
if (DebuggableCore.MemoryCallbacksAvailable() && DebuggableCore.MemoryCallbacks.ExecuteCallbacksAvailable)
|
||||
{
|
||||
DebuggableCore.MemoryCallbacks.Add(new MemoryCallback(domain, MemoryCallbackType.Execute, "Plugin Hook", cb, address, null));
|
||||
}
|
||||
}
|
||||
public void RemoveMemoryCallback(Action cb)
|
||||
public void RemoveMemoryCallback(Action<uint, uint> cb)
|
||||
{
|
||||
if (DebuggableCore.MemoryCallbacksAvailable())
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
using System;
|
||||
|
||||
namespace BizHawk.Client.ApiHawk
|
||||
{
|
||||
public interface IMemEvents : IExternalApi
|
||||
{
|
||||
void AddReadCallback(Action cb, uint address, string domain);
|
||||
void AddWriteCallback(Action cb, uint address, string domain);
|
||||
void AddExecCallback(Action cb, uint address, string domain);
|
||||
void RemoveMemoryCallback(Action cb);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace BizHawk.Client.ApiHawk
|
||||
{
|
||||
public interface IMemEvents : IExternalApi
|
||||
{
|
||||
void AddReadCallback(Action<uint, uint> cb, uint? address, string domain);
|
||||
void AddWriteCallback(Action<uint, uint> cb, uint? address, string domain);
|
||||
void AddExecCallback(Action<uint, uint> cb, uint? address, string domain);
|
||||
void RemoveMemoryCallback(Action<uint, uint> cb);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -243,7 +243,7 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
|
||||
DebuggableCore.MemoryCallbacks.Add(
|
||||
new MemoryCallback(domain, MemoryCallbackType.Execute, "Lua Hook", nlf.Callback, address, null));
|
||||
new MemoryCallback(domain, MemoryCallbackType.Execute, "Lua Hook", nlf.MemCallback, address, null));
|
||||
return nlf.Guid.ToString();
|
||||
}
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
|
||||
DebuggableCore.MemoryCallbacks.Add(
|
||||
new MemoryCallback(domain, MemoryCallbackType.Read, "Lua Hook", nlf.Callback, address, null));
|
||||
new MemoryCallback(domain, MemoryCallbackType.Read, "Lua Hook", nlf.MemCallback, address, null));
|
||||
return nlf.Guid.ToString();
|
||||
}
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
|
||||
DebuggableCore.MemoryCallbacks.Add(
|
||||
new MemoryCallback(domain, MemoryCallbackType.Write, "Lua Hook", nlf.Callback, address, null));
|
||||
new MemoryCallback(domain, MemoryCallbackType.Write, "Lua Hook", nlf.MemCallback, address, null));
|
||||
return nlf.Guid.ToString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Client.Common
|
|||
|
||||
if (Global.Emulator.MemoryCallbacksAvailable())
|
||||
{
|
||||
Global.Emulator.AsDebuggable().MemoryCallbacks.Remove(function.Callback);
|
||||
Global.Emulator.AsDebuggable().MemoryCallbacks.Remove(function.MemCallback);
|
||||
}
|
||||
|
||||
return base.Remove(function);
|
||||
|
@ -40,7 +40,7 @@ namespace BizHawk.Client.Common
|
|||
if (Global.Emulator.MemoryCallbacksAvailable())
|
||||
{
|
||||
var memoryCallbacks = Global.Emulator.AsDebuggable().MemoryCallbacks;
|
||||
memoryCallbacks.RemoveAll(this.Select(w => w.Callback));
|
||||
memoryCallbacks.RemoveAll(this.Select(w => w.MemCallback));
|
||||
}
|
||||
|
||||
Clear();
|
||||
|
|
|
@ -30,6 +30,11 @@ namespace BizHawk.Client.Common
|
|||
ex.Message);
|
||||
}
|
||||
};
|
||||
|
||||
MemCallback = delegate
|
||||
{
|
||||
Callback();
|
||||
};
|
||||
}
|
||||
|
||||
public Guid Guid { get; private set; }
|
||||
|
@ -42,6 +47,8 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public Action Callback { get; }
|
||||
|
||||
public Action<uint, uint> MemCallback { get; }
|
||||
|
||||
public void Call(string name = null)
|
||||
{
|
||||
LuaSandbox.Sandbox(Lua, () =>
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public class BreakpointList : List<Breakpoint>
|
||||
{
|
||||
public Action Callback { get; set; }
|
||||
public Action<uint, uint> Callback { get; set; }
|
||||
|
||||
public void Add(IDebuggable core, string scope, uint address, uint mask, MemoryCallbackType type)
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private bool _active;
|
||||
private readonly IDebuggable _core;
|
||||
|
||||
public Breakpoint(bool readOnly, IDebuggable core, string scope, Action callBack, uint address, uint mask, MemoryCallbackType type, bool enabled = true)
|
||||
public Breakpoint(bool readOnly, IDebuggable core, string scope, Action<uint, uint> callBack, uint address, uint mask, MemoryCallbackType type, bool enabled = true)
|
||||
{
|
||||
Scope = scope;
|
||||
_core = core;
|
||||
|
@ -83,7 +83,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
ReadOnly = readOnly;
|
||||
}
|
||||
|
||||
public Breakpoint(IDebuggable core, string scope, Action callBack, uint address, uint mask, MemoryCallbackType type, bool enabled = true)
|
||||
public Breakpoint(IDebuggable core, string scope, Action<uint, uint> callBack, uint address, uint mask, MemoryCallbackType type, bool enabled = true)
|
||||
{
|
||||
Scope = scope;
|
||||
_core = core;
|
||||
|
@ -96,7 +96,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Active = enabled;
|
||||
}
|
||||
|
||||
public Breakpoint(string name, bool readOnly, IDebuggable core, string scope, Action callBack, uint address, uint mask, MemoryCallbackType type, bool enabled = true)
|
||||
public Breakpoint(string name, bool readOnly, IDebuggable core, string scope, Action<uint, uint> callBack, uint address, uint mask, MemoryCallbackType type, bool enabled = true)
|
||||
{
|
||||
Scope = scope;
|
||||
_core = core;
|
||||
|
@ -111,7 +111,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
public string Scope { get; }
|
||||
public Action Callback { get; }
|
||||
public Action<uint, uint> Callback { get; }
|
||||
public uint? Address { get; set; }
|
||||
public uint? AddressMask { get; set; }
|
||||
public MemoryCallbackType Type { get; set; }
|
||||
|
|
|
@ -60,16 +60,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
: Color.White;
|
||||
}
|
||||
|
||||
private void BreakpointCallback()
|
||||
private void BreakpointCallback(uint addr, uint value)
|
||||
{
|
||||
GlobalWin.MainForm.PauseEmulator();
|
||||
UpdateValues();
|
||||
GlobalWin.OSD.AddMessage("Breakpoint hit");
|
||||
}
|
||||
|
||||
private void SeekCallback()
|
||||
private void SeekCallback(uint addr, uint value)
|
||||
{
|
||||
BreakpointCallback();
|
||||
BreakpointCallback(addr, value);
|
||||
|
||||
var seekBreakpoint = _breakpoints.FirstOrDefault(x => x.Name.StartsWith(SeekName));
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Common
|
|||
|
||||
protected readonly List<TraceInfo> Buffer = new List<TraceInfo>();
|
||||
|
||||
protected abstract void TraceFromCallback();
|
||||
protected abstract void TraceFromCallback(uint addr, uint value);
|
||||
|
||||
private ITraceSink _sink;
|
||||
|
||||
|
@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Common
|
|||
|
||||
public class TracingMemoryCallback : IMemoryCallback
|
||||
{
|
||||
public TracingMemoryCallback(Action callback)
|
||||
public TracingMemoryCallback(Action<uint, uint> callback)
|
||||
{
|
||||
Callback = callback;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ namespace BizHawk.Emulation.Common
|
|||
|
||||
public string Name => "Trace Logging";
|
||||
|
||||
public Action Callback { get; }
|
||||
public Action<uint, uint> Callback { get; }
|
||||
|
||||
public uint? Address => null;
|
||||
|
||||
|
|
|
@ -67,38 +67,38 @@ namespace BizHawk.Emulation.Common
|
|||
}
|
||||
}
|
||||
|
||||
private static void Call(ObservableCollection<IMemoryCallback> cbs, uint addr, string scope)
|
||||
private static void Call(ObservableCollection<IMemoryCallback> cbs, uint addr, uint value, string scope)
|
||||
{
|
||||
for (int i = 0; i < cbs.Count; i++)
|
||||
{
|
||||
if (!cbs[i].Address.HasValue || (cbs[i].Scope == scope && cbs[i].Address == (addr & cbs[i].AddressMask)))
|
||||
{
|
||||
cbs[i].Callback();
|
||||
cbs[i].Callback(addr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CallReads(uint addr, string scope)
|
||||
public void CallReads(uint addr, uint value, string scope)
|
||||
{
|
||||
if (_hasReads)
|
||||
{
|
||||
Call(_reads, addr, scope);
|
||||
Call(_reads, addr, value, scope);
|
||||
}
|
||||
}
|
||||
|
||||
public void CallWrites(uint addr, string scope)
|
||||
public void CallWrites(uint addr, uint value, string scope)
|
||||
{
|
||||
if (_hasWrites)
|
||||
{
|
||||
Call(_writes, addr, scope);
|
||||
Call(_writes, addr, value, scope);
|
||||
}
|
||||
}
|
||||
|
||||
public void CallExecutes(uint addr, string scope)
|
||||
public void CallExecutes(uint addr, uint value, string scope)
|
||||
{
|
||||
if (_hasExecutes)
|
||||
{
|
||||
Call(_execs, addr, scope);
|
||||
Call(_execs, addr, value, scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ namespace BizHawk.Emulation.Common
|
|||
return (_hasReads != hadReads || _hasWrites != hadWrites || _hasExecutes != hadExecutes);
|
||||
}
|
||||
|
||||
private int RemoveInternal(Action action)
|
||||
private int RemoveInternal(Action<uint, uint> action)
|
||||
{
|
||||
var readsToRemove = _reads.Where(imc => imc.Callback == action).ToList();
|
||||
var writesToRemove = _writes.Where(imc => imc.Callback == action).ToList();
|
||||
|
@ -160,7 +160,7 @@ namespace BizHawk.Emulation.Common
|
|||
return readsToRemove.Count + writesToRemove.Count + execsToRemove.Count;
|
||||
}
|
||||
|
||||
public void Remove(Action action)
|
||||
public void Remove(Action<uint, uint> action)
|
||||
{
|
||||
if (RemoveInternal(action) > 0)
|
||||
{
|
||||
|
@ -171,7 +171,7 @@ namespace BizHawk.Emulation.Common
|
|||
}
|
||||
}
|
||||
|
||||
public void RemoveAll(IEnumerable<Action> actions)
|
||||
public void RemoveAll(IEnumerable<Action<uint, uint>> actions)
|
||||
{
|
||||
bool changed = false;
|
||||
foreach (var action in actions)
|
||||
|
@ -286,7 +286,7 @@ namespace BizHawk.Emulation.Common
|
|||
|
||||
public class MemoryCallback : IMemoryCallback
|
||||
{
|
||||
public MemoryCallback(string scope, MemoryCallbackType type, string name, Action callback, uint? address, uint? mask)
|
||||
public MemoryCallback(string scope, MemoryCallbackType type, string name, Action<uint, uint> callback, uint? address, uint? mask)
|
||||
{
|
||||
if (type == MemoryCallbackType.Execute && !address.HasValue)
|
||||
{
|
||||
|
@ -303,7 +303,7 @@ namespace BizHawk.Emulation.Common
|
|||
|
||||
public MemoryCallbackType Type { get; }
|
||||
public string Name { get; }
|
||||
public Action Callback { get; }
|
||||
public Action<uint, uint> Callback { get; }
|
||||
public uint? Address { get; }
|
||||
public uint? AddressMask { get; }
|
||||
public string Scope { get; }
|
||||
|
|
|
@ -65,31 +65,31 @@ namespace BizHawk.Emulation.Common
|
|||
/// </summary>
|
||||
/// <param name="addr">The address to check for callbacks</param>
|
||||
/// <param name="scope">The scope that the address pertains to. Must be a value in <see cref="AvailableScopes"></param>
|
||||
void CallReads(uint addr, string scope);
|
||||
void CallReads(uint addr, uint value, string scope);
|
||||
|
||||
/// <summary>
|
||||
/// Executes all Write callbacks for the given address and domain
|
||||
/// </summary>
|
||||
/// <param name="addr">The address to check for callbacks</param>
|
||||
/// <param name="scope">The scope that the address pertains to. Must be a value in <see cref="AvailableScopes"></param>
|
||||
void CallWrites(uint addr, string scope);
|
||||
void CallWrites(uint addr, uint value, string scope);
|
||||
|
||||
/// <summary>
|
||||
/// Executes all Execute callbacks for the given address and domain
|
||||
/// </summary>
|
||||
/// <param name="addr">The address to check for callbacks</param>
|
||||
/// <param name="scope">The scope that the address pertains to. Must be a value in <see cref="AvailableScopes"></param>
|
||||
void CallExecutes(uint addr, string scope);
|
||||
void CallExecutes(uint addr, uint value, string scope);
|
||||
|
||||
/// <summary>
|
||||
/// Removes the given callback from the list
|
||||
/// </summary>
|
||||
void Remove(Action action);
|
||||
void Remove(Action<uint, uint> action);
|
||||
|
||||
/// <summary>
|
||||
/// Removes the given callbacks from the list
|
||||
/// </summary>
|
||||
void RemoveAll(IEnumerable<Action> actions);
|
||||
void RemoveAll(IEnumerable<Action<uint, uint>> actions);
|
||||
|
||||
/// <summary>
|
||||
/// Removes all read,write, and execute callbacks
|
||||
|
@ -111,7 +111,7 @@ namespace BizHawk.Emulation.Common
|
|||
{
|
||||
MemoryCallbackType Type { get; }
|
||||
string Name { get; }
|
||||
Action Callback { get; }
|
||||
Action<uint, uint> Callback { get; }
|
||||
uint? Address { get; }
|
||||
uint? AddressMask { get; }
|
||||
string Scope { get; }
|
||||
|
|
|
@ -192,7 +192,7 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
|
|||
|
||||
if (MemoryCallbacks != null)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(RegisterPC, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(RegisterPC, 0, "System Bus");
|
||||
}
|
||||
|
||||
switch (opcode)
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
|
|||
{
|
||||
if (MemoryCallbacks != null && !peek)
|
||||
{
|
||||
MemoryCallbacks.CallReads(addr, "System Bus");
|
||||
MemoryCallbacks.CallReads(addr, 0, "System Bus");
|
||||
}
|
||||
|
||||
return ReadMemory(addr, peek);
|
||||
|
@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
|
|||
{
|
||||
if (MemoryCallbacks != null && !poke)
|
||||
{
|
||||
MemoryCallbacks.CallWrites(addr, "System Bus");
|
||||
MemoryCallbacks.CallWrites(addr, value, "System Bus");
|
||||
}
|
||||
|
||||
WriteMemory(addr, value, poke);
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
|||
LagIFlag = FlagI;
|
||||
|
||||
if (Debug) Logger(State());
|
||||
MemoryCallbacks.CallExecutes(PC, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(PC, 0, "System Bus");
|
||||
|
||||
if (CDL != null && CDL.Active) CDLOpcode();
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
|||
{
|
||||
byte page = MPR[address >> 13];
|
||||
var result = ReadMemory21((page << 13) | (address & 0x1FFF));
|
||||
MemoryCallbacks.CallReads(address, "System Bus");
|
||||
MemoryCallbacks.CallReads(address, result, "System Bus");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
|||
{
|
||||
byte page = MPR[address >> 13];
|
||||
WriteMemory21((page << 13) | (address & 0x1FFF), value);
|
||||
MemoryCallbacks.CallWrites(address, "System Bus");
|
||||
MemoryCallbacks.CallWrites(address, value, "System Bus");
|
||||
}
|
||||
|
||||
private ushort ReadWord(ushort address)
|
||||
|
|
|
@ -183,9 +183,9 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
|
|||
|
||||
private void SetCallbacks()
|
||||
{
|
||||
_machine.Memory.ReadCallback = (addr) => MemoryCallbacks.CallReads(addr, "System Bus");
|
||||
_machine.Memory.WriteCallback = (addr) => MemoryCallbacks.CallWrites(addr, "System Bus");
|
||||
_machine.Memory.ExecuteCallback = (addr) => MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
_machine.Memory.ReadCallback = (addr) => MemoryCallbacks.CallReads(addr, 0, "System Bus");
|
||||
_machine.Memory.WriteCallback = (addr) => MemoryCallbacks.CallWrites(addr, 0, "System Bus");
|
||||
_machine.Memory.ExecuteCallback = (addr) => MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
_machine.Memory.InputCallback = InputCallbacks.Call;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
_mapper.Bit13 = addr.Bit(13);
|
||||
var temp = _mapper.ReadMemory((ushort)(addr & 0x1FFF));
|
||||
_tia.BusState = temp;
|
||||
MemoryCallbacks.CallReads(addr, "System Bus");
|
||||
MemoryCallbacks.CallReads(addr, 0, "System Bus");
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
|
||||
_mapper.WriteMemory((ushort)(addr & 0x1FFF), value);
|
||||
|
||||
MemoryCallbacks.CallWrites(addr, "System Bus");
|
||||
MemoryCallbacks.CallWrites(addr, value, "System Bus");
|
||||
}
|
||||
|
||||
internal void PokeMemory(ushort addr, byte value)
|
||||
|
@ -191,7 +191,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
|
||||
private void ExecFetch(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
}
|
||||
|
||||
private void RebootCore()
|
||||
|
|
|
@ -291,7 +291,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
|
|||
|
||||
private void ExecFetch(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
}
|
||||
|
||||
private void Reset_Mapper(string m)
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
|
|||
{
|
||||
public byte ReadMemory(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallReads(addr, "System Bus");
|
||||
MemoryCallbacks.CallReads(addr, 0, "System Bus");
|
||||
|
||||
if ((addr & 0xFCE0) == 0)
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
|
|||
|
||||
public void WriteMemory(ushort addr, byte value)
|
||||
{
|
||||
MemoryCallbacks.CallWrites(addr, "System Bus");
|
||||
MemoryCallbacks.CallWrites(addr, value, "System Bus");
|
||||
|
||||
if ((addr & 0xFCE0) == 0)
|
||||
{
|
||||
|
|
|
@ -168,9 +168,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
void InitCallbacks()
|
||||
{
|
||||
padcb = new LibVBANext.StandardCallback(() => InputCallbacks.Call());
|
||||
fetchcb = new LibVBANext.AddressCallback((addr) => MemoryCallbacks.CallExecutes(addr, "System Bus"));
|
||||
readcb = new LibVBANext.AddressCallback((addr) => MemoryCallbacks.CallReads(addr, "System Bus"));
|
||||
writecb = new LibVBANext.AddressCallback((addr) => MemoryCallbacks.CallWrites(addr, "System Bus"));
|
||||
fetchcb = new LibVBANext.AddressCallback((addr) => MemoryCallbacks.CallExecutes(addr, 0, "System Bus"));
|
||||
readcb = new LibVBANext.AddressCallback((addr) => MemoryCallbacks.CallReads(addr, 0, "System Bus"));
|
||||
writecb = new LibVBANext.AddressCallback((addr) => MemoryCallbacks.CallWrites(addr, 0, "System Bus"));
|
||||
tracecb = new LibVBANext.TraceCallback((addr, opcode) => Tracer.Put(Trace(addr, opcode)));
|
||||
_inputCallbacks.ActiveChanged += SyncPadCallback;
|
||||
_memorycallbacks.ActiveChanged += SyncMemoryCallbacks;
|
||||
|
|
|
@ -296,7 +296,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
|
||||
private void ExecFetch(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
}
|
||||
|
||||
private void Setup_Mapper()
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
{
|
||||
public byte ReadMemory(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallReads(addr, "System Bus");
|
||||
MemoryCallbacks.CallReads(addr, 0, "System Bus");
|
||||
addr_access = addr;
|
||||
|
||||
if (ppu.DMA_start)
|
||||
|
@ -157,7 +157,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
|
||||
public void WriteMemory(ushort addr, byte value)
|
||||
{
|
||||
MemoryCallbacks.CallWrites(addr, "System Bus");
|
||||
MemoryCallbacks.CallWrites(addr, value, "System Bus");
|
||||
addr_access = addr;
|
||||
|
||||
if (ppu.DMA_start)
|
||||
|
|
|
@ -96,7 +96,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
|
|||
|
||||
private void ExecFetch(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,19 +59,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
private void ReadCallback(uint address, ulong cycleOffset)
|
||||
{
|
||||
callbackCycleCount = _cycleCount + cycleOffset;
|
||||
MemoryCallbacks.CallReads(address, "System Bus");
|
||||
MemoryCallbacks.CallReads(address, 0, "System Bus");
|
||||
}
|
||||
|
||||
private void WriteCallback(uint address, ulong cycleOffset)
|
||||
{
|
||||
callbackCycleCount = _cycleCount + cycleOffset;
|
||||
MemoryCallbacks.CallWrites(address, "System Bus");
|
||||
MemoryCallbacks.CallWrites(address, 0, "System Bus");
|
||||
}
|
||||
|
||||
private void ExecCallback(uint address, ulong cycleOffset)
|
||||
{
|
||||
callbackCycleCount = _cycleCount + cycleOffset;
|
||||
MemoryCallbacks.CallExecutes(address, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(address, 0, "System Bus");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -755,13 +755,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
|||
switch (_breakparams._type)
|
||||
{
|
||||
case BreakType.Read:
|
||||
_breakparams._mcs.CallReads(_breakparams._addr, "System Bus");
|
||||
_breakparams._mcs.CallReads(_breakparams._addr, 0, "System Bus");
|
||||
break;
|
||||
case BreakType.Write:
|
||||
_breakparams._mcs.CallWrites(_breakparams._addr, "System Bus");
|
||||
_breakparams._mcs.CallWrites(_breakparams._addr, 0, "System Bus");
|
||||
break;
|
||||
case BreakType.Execute:
|
||||
_breakparams._mcs.CallExecutes(_breakparams._addr, "System Bus");
|
||||
_breakparams._mcs.CallExecutes(_breakparams._addr, 0, "System Bus");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -916,7 +916,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
public void ExecFetch(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
}
|
||||
|
||||
public byte ReadMemory(ushort addr)
|
||||
|
@ -966,7 +966,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
}
|
||||
}
|
||||
|
||||
MemoryCallbacks.CallReads(addr, "System Bus");
|
||||
MemoryCallbacks.CallReads(addr, ret, "System Bus");
|
||||
|
||||
DB = ret;
|
||||
return ret;
|
||||
|
@ -1013,7 +1013,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
Board.WritePRG(addr - 0x8000, value);
|
||||
}
|
||||
|
||||
MemoryCallbacks.CallWrites(addr, "System Bus");
|
||||
MemoryCallbacks.CallWrites(addr, value, "System Bus");
|
||||
}
|
||||
|
||||
// the palette for each VS game needs to be chosen explicitly since there are 6 different ones.
|
||||
|
|
|
@ -364,7 +364,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
|
||||
private void ReadHook(uint addr)
|
||||
{
|
||||
MemoryCallbacks.CallReads(addr, "System Bus");
|
||||
MemoryCallbacks.CallReads(addr, 0, "System Bus");
|
||||
// we RefreshMemoryCallbacks() after the trigger in case the trigger turns itself off at that point
|
||||
// EDIT: for now, theres some IPC re-entrancy problem
|
||||
// RefreshMemoryCallbacks();
|
||||
|
@ -372,7 +372,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
|
||||
private void ExecHook(uint addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
// we RefreshMemoryCallbacks() after the trigger in case the trigger turns itself off at that point
|
||||
// EDIT: for now, theres some IPC re-entrancy problem
|
||||
// RefreshMemoryCallbacks();
|
||||
|
@ -380,7 +380,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
|
||||
private void WriteHook(uint addr, byte val)
|
||||
{
|
||||
MemoryCallbacks.CallWrites(addr, "System Bus");
|
||||
MemoryCallbacks.CallWrites(addr, val, "System Bus");
|
||||
// we RefreshMemoryCallbacks() after the trigger in case the trigger turns itself off at that point
|
||||
// EDIT: for now, theres some IPC re-entrancy problem
|
||||
// RefreshMemoryCallbacks();
|
||||
|
@ -388,17 +388,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
|
|||
|
||||
private void ReadHook_SMP(uint addr)
|
||||
{
|
||||
MemoryCallbacks.CallReads(addr, "SMP");
|
||||
MemoryCallbacks.CallReads(addr, 0, "SMP");
|
||||
}
|
||||
|
||||
private void ExecHook_SMP(uint addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "SMP");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "SMP");
|
||||
}
|
||||
|
||||
private void WriteHook_SMP(uint addr, byte val)
|
||||
{
|
||||
MemoryCallbacks.CallWrites(addr, "SMP");
|
||||
MemoryCallbacks.CallWrites(addr, val, "SMP");
|
||||
}
|
||||
|
||||
private enum LoadParamType
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk
|
|||
|
||||
private void ExecFetch(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
}
|
||||
|
||||
#region ISettable
|
||||
|
|
|
@ -283,7 +283,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
|
||||
private byte ReadMemory(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallReads(addr, "System Bus");
|
||||
MemoryCallbacks.CallReads(addr, 0, "System Bus");
|
||||
|
||||
return ReadMemoryMapper(addr);
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
{
|
||||
WriteMemoryMapper(addr, value);
|
||||
|
||||
MemoryCallbacks.CallWrites(addr, "System Bus");
|
||||
MemoryCallbacks.CallWrites(addr, value, "System Bus");
|
||||
}
|
||||
|
||||
private byte FetchMemory(ushort addr)
|
||||
|
@ -302,7 +302,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
|
||||
private void OnExecMemory(ushort addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -61,9 +61,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
|
||||
private void InitMemCallbacks()
|
||||
{
|
||||
ExecCallback = new LibGPGX.mem_cb(a => MemoryCallbacks.CallExecutes(a, "M68K BUS"));
|
||||
ReadCallback = new LibGPGX.mem_cb(a => MemoryCallbacks.CallReads(a, "M68K BUS"));
|
||||
WriteCallback = new LibGPGX.mem_cb(a => MemoryCallbacks.CallWrites(a, "M68K BUS"));
|
||||
ExecCallback = new LibGPGX.mem_cb(a => MemoryCallbacks.CallExecutes(a, 0, "M68K BUS"));
|
||||
ReadCallback = new LibGPGX.mem_cb(a => MemoryCallbacks.CallReads(a, 0, "M68K BUS"));
|
||||
WriteCallback = new LibGPGX.mem_cb(a => MemoryCallbacks.CallWrites(a, 0, "M68K BUS"));
|
||||
_memoryCallbacks.ActiveChanged += RefreshMemCallbacks;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
Header = "M68K: PC, machine code, mnemonic, operands, registers (D0-D7, A0-A7, SR, USP), flags (XNZVC)";
|
||||
}
|
||||
|
||||
protected override void TraceFromCallback()
|
||||
protected override void TraceFromCallback(uint addr, uint value)
|
||||
{
|
||||
var regs = DebuggableCore.GetCpuFlagsAndRegisters();
|
||||
uint pc = (uint)regs["M68K PC"].Value;
|
||||
|
|
|
@ -883,13 +883,13 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
|
|||
switch (type)
|
||||
{
|
||||
case OctoshockDll.eShockMemCb.Read:
|
||||
MemoryCallbacks.CallReads(address, "System Bus");
|
||||
MemoryCallbacks.CallReads(address, value, "System Bus");
|
||||
break;
|
||||
case OctoshockDll.eShockMemCb.Write:
|
||||
MemoryCallbacks.CallWrites(address, "System Bus");
|
||||
MemoryCallbacks.CallWrites(address, value, "System Bus");
|
||||
break;
|
||||
case OctoshockDll.eShockMemCb.Execute:
|
||||
MemoryCallbacks.CallExecutes(address, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(address, value, "System Bus");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,15 +142,15 @@ namespace BizHawk.Emulation.Cores.WonderSwan
|
|||
|
||||
void ReadCallback(uint addr)
|
||||
{
|
||||
MemoryCallbacks.CallReads(addr, "System Bus");
|
||||
MemoryCallbacks.CallReads(addr, 0, "System Bus");
|
||||
}
|
||||
void WriteCallback(uint addr)
|
||||
{
|
||||
MemoryCallbacks.CallWrites(addr, "System Bus");
|
||||
MemoryCallbacks.CallWrites(addr, 0, "System Bus");
|
||||
}
|
||||
void ExecCallback(uint addr)
|
||||
{
|
||||
MemoryCallbacks.CallExecutes(addr, "System Bus");
|
||||
MemoryCallbacks.CallExecutes(addr, 0, "System Bus");
|
||||
}
|
||||
void ButtonCallback()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue