Memory callbacks - check the HasReads/Writes/Executes flags during the call methods so that the responsibility does not fall on the core, remove the check in the PCE core
This commit is contained in:
parent
3c5348eb86
commit
e194c9f0c4
|
@ -51,17 +51,26 @@ namespace BizHawk.Emulation.Common
|
||||||
|
|
||||||
public void CallReads(uint addr)
|
public void CallReads(uint addr)
|
||||||
{
|
{
|
||||||
Call(Reads, addr);
|
if (_hasReads)
|
||||||
|
{
|
||||||
|
Call(Reads, addr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CallWrites(uint addr)
|
public void CallWrites(uint addr)
|
||||||
{
|
{
|
||||||
Call(Writes, addr);
|
if (_hasWrites)
|
||||||
|
{
|
||||||
|
Call(Writes, addr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CallExecutes(uint addr)
|
public void CallExecutes(uint addr)
|
||||||
{
|
{
|
||||||
Call(Execs, addr);
|
if (_hasExecutes)
|
||||||
|
{
|
||||||
|
Call(Execs, addr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HasReads
|
public bool HasReads
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
||||||
LagIFlag = FlagI;
|
LagIFlag = FlagI;
|
||||||
|
|
||||||
if (Debug) Logger(State());
|
if (Debug) Logger(State());
|
||||||
if (Core.MemoryCallbacks.HasExecutes) { Core.MemoryCallbacks.CallExecutes(PC); }
|
Core.MemoryCallbacks.CallExecutes(PC);
|
||||||
|
|
||||||
if (CDLLoggingActive) CDLOpcode();
|
if (CDLLoggingActive) CDLOpcode();
|
||||||
|
|
||||||
|
|
|
@ -494,7 +494,7 @@ namespace HuC6280
|
||||||
w.WriteLine(" LagIFlag = FlagI;");
|
w.WriteLine(" LagIFlag = FlagI;");
|
||||||
w.WriteLine();
|
w.WriteLine();
|
||||||
w.WriteLine(" if (Debug) Logger(State());");
|
w.WriteLine(" if (Debug) Logger(State());");
|
||||||
w.WriteLine(" if (Core.MemoryCallbacks.HasExecutes) { Core.MemoryCallbacks.CallExecutes(PC); }");
|
w.WriteLine(" Core.MemoryCallbacks.CallExecutes(PC);");
|
||||||
w.WriteLine(" if (CDLLoggingActive) CDLOpcode();");
|
w.WriteLine(" if (CDLLoggingActive) CDLOpcode();");
|
||||||
w.WriteLine();
|
w.WriteLine();
|
||||||
w.WriteLine(" byte opcode = ReadMemory(PC++);");
|
w.WriteLine(" byte opcode = ReadMemory(PC++);");
|
||||||
|
|
Loading…
Reference in New Issue