Z80: Fix CDL
Use FetchMemory for opcodes and ReadMemory for everything else Also fix Dis-assembling
This commit is contained in:
parent
c593cb4c47
commit
f94d3f58c6
|
@ -409,7 +409,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
A = read(addr++);
|
A = read(addr++);
|
||||||
switch (A)
|
switch (A)
|
||||||
{
|
{
|
||||||
case 0xCB: format = mnemonicsDDCB[A]; extra_inc = 1; break;
|
case 0xCB: format = mnemonicsDDCB[read((ushort)(addr + 1))]; extra_inc = 1; break;
|
||||||
case 0xED: format = mnemonicsED[A]; break;
|
case 0xED: format = mnemonicsED[A]; break;
|
||||||
default: format = mnemonicsDD[A]; break;
|
default: format = mnemonicsDD[A]; break;
|
||||||
}
|
}
|
||||||
|
@ -422,7 +422,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
A = read(addr++);
|
A = read(addr++);
|
||||||
switch (A)
|
switch (A)
|
||||||
{
|
{
|
||||||
case 0xCB: format = mnemonicsFDCB[A]; extra_inc = 1; break;
|
case 0xCB: format = mnemonicsFDCB[read((ushort)(addr + 1))]; extra_inc = 1; break;
|
||||||
case 0xED: format = mnemonicsED[A]; break;
|
case 0xED: format = mnemonicsED[A]; break;
|
||||||
default: format = mnemonicsFD[A]; break;
|
default: format = mnemonicsFD[A]; break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
public IMemoryCallbackSystem MemoryCallbacks { get; set; }
|
public IMemoryCallbackSystem MemoryCallbacks { get; set; }
|
||||||
|
|
||||||
// Memory Access
|
// Memory Access
|
||||||
public Func<ushort, bool, byte> FetchMemory;
|
public Func<ushort, byte> FetchMemory;
|
||||||
public Func<ushort, byte> ReadMemory;
|
public Func<ushort, byte> ReadMemory;
|
||||||
public Action<ushort, byte> WriteMemory;
|
public Action<ushort, byte> WriteMemory;
|
||||||
public Func<ushort, byte> PeekMemory;
|
public Func<ushort, byte> PeekMemory;
|
||||||
|
@ -200,7 +200,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
{
|
{
|
||||||
if (OnExecFetch != null) OnExecFetch(RegPC);
|
if (OnExecFetch != null) OnExecFetch(RegPC);
|
||||||
if (TraceCallback != null) TraceCallback(State());
|
if (TraceCallback != null) TraceCallback(State());
|
||||||
FetchInstruction(ReadMemory(RegPC++));
|
FetchInstruction(FetchMemory(RegPC++));
|
||||||
}
|
}
|
||||||
instr_pntr = 0;
|
instr_pntr = 0;
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
{
|
{
|
||||||
if (OnExecFetch != null) OnExecFetch(RegPC);
|
if (OnExecFetch != null) OnExecFetch(RegPC);
|
||||||
if (TraceCallback != null) TraceCallback(State());
|
if (TraceCallback != null) TraceCallback(State());
|
||||||
FetchInstruction(ReadMemory(RegPC++));
|
FetchInstruction(FetchMemory(RegPC++));
|
||||||
}
|
}
|
||||||
|
|
||||||
temp_R = (byte)(Regs[R] & 0x7F);
|
temp_R = (byte)(Regs[R] & 0x7F);
|
||||||
|
@ -542,7 +542,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
if (prefix_src == IXCBpre) { IXCB_prefix = true; IXCB_prefetch = true; }
|
if (prefix_src == IXCBpre) { IXCB_prefix = true; IXCB_prefetch = true; }
|
||||||
if (prefix_src == IYCBpre) { IYCB_prefix = true; IYCB_prefetch = true; }
|
if (prefix_src == IYCBpre) { IYCB_prefix = true; IYCB_prefetch = true; }
|
||||||
|
|
||||||
FetchInstruction(ReadMemory(RegPC++));
|
FetchInstruction(FetchMemory(RegPC++));
|
||||||
instr_pntr = 0;
|
instr_pntr = 0;
|
||||||
// only the first prefix in a double prefix increases R, although I don't know how / why
|
// only the first prefix in a double prefix increases R, although I don't know how / why
|
||||||
if (prefix_src < 4)
|
if (prefix_src < 4)
|
||||||
|
|
Loading…
Reference in New Issue