event.onmemoryread(function f) : f is now passed the address in question. similarly for onmemorywrite

This commit is contained in:
goyuken 2012-10-14 15:19:31 +00:00
parent 8d8e636450
commit 5661205bda
2 changed files with 12 additions and 12 deletions

View File

@ -99,8 +99,8 @@ namespace BizHawk
public class MemoryCallbackSystem
{
public int? ReadAddr = null;
private System.Action ReadCallback = null;
public void SetReadCallback(System.Action func)
private System.Action<uint> ReadCallback = null;
public void SetReadCallback(System.Action<uint> func)
{
ReadCallback = func;
}
@ -121,19 +121,19 @@ namespace BizHawk
{
if (ReadAddr == addr)
{
ReadCallback();
ReadCallback((uint)addr);
}
}
else
{
ReadCallback();
ReadCallback((uint)addr);
}
}
}
public int? WriteAddr = null;
private System.Action WriteCallback = null;
public void SetWriteCallback(System.Action func)
private System.Action<uint> WriteCallback = null;
public void SetWriteCallback(System.Action<uint> func)
{
WriteCallback = func;
}
@ -154,12 +154,12 @@ namespace BizHawk
{
if (WriteAddr == addr)
{
WriteCallback();
WriteCallback((uint)addr);
}
}
else
{
WriteCallback();
WriteCallback((uint)addr);
}
}
}

View File

@ -2698,11 +2698,11 @@ namespace BizHawk.MultiClient
}
Global.Emulator.CoreInputComm.MemoryCallbackSystem.ReadAddr = _addr;
Global.Emulator.CoreInputComm.MemoryCallbackSystem.SetReadCallback(delegate()
Global.Emulator.CoreInputComm.MemoryCallbackSystem.SetReadCallback(delegate(uint addr)
{
try
{
luaf.Call();
luaf.Call(addr);
}
catch (SystemException e)
{
@ -2736,11 +2736,11 @@ namespace BizHawk.MultiClient
}
Global.Emulator.CoreInputComm.MemoryCallbackSystem.WriteAddr = _addr;
Global.Emulator.CoreInputComm.MemoryCallbackSystem.SetWriteCallback(delegate()
Global.Emulator.CoreInputComm.MemoryCallbackSystem.SetWriteCallback(delegate(uint addr)
{
try
{
luaf.Call();
luaf.Call(addr);
}
catch (SystemException e)
{