diff --git a/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs b/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs index 596e0ff66d..6ac1a76444 100644 --- a/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs +++ b/BizHawk.Emulation.Cores/CPUs/Z80A/NewDisassembler.cs @@ -409,7 +409,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A A = read(addr++); 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; default: format = mnemonicsDD[A]; break; } @@ -422,7 +422,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A A = read(addr++); 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; default: format = mnemonicsFD[A]; break; } diff --git a/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs b/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs index 2f13b0e6c7..d8743a7eab 100644 --- a/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs +++ b/BizHawk.Emulation.Cores/CPUs/Z80A/Z80A.cs @@ -95,7 +95,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A public IMemoryCallbackSystem MemoryCallbacks { get; set; } // Memory Access - public Func<ushort, bool, byte> FetchMemory; + public Func<ushort, byte> FetchMemory; public Func<ushort, byte> ReadMemory; public Action<ushort, byte> WriteMemory; public Func<ushort, byte> PeekMemory; @@ -200,7 +200,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A { if (OnExecFetch != null) OnExecFetch(RegPC); if (TraceCallback != null) TraceCallback(State()); - FetchInstruction(ReadMemory(RegPC++)); + FetchInstruction(FetchMemory(RegPC++)); } instr_pntr = 0; @@ -325,7 +325,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A { if (OnExecFetch != null) OnExecFetch(RegPC); if (TraceCallback != null) TraceCallback(State()); - FetchInstruction(ReadMemory(RegPC++)); + FetchInstruction(FetchMemory(RegPC++)); } 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 == IYCBpre) { IYCB_prefix = true; IYCB_prefetch = true; } - FetchInstruction(ReadMemory(RegPC++)); + FetchInstruction(FetchMemory(RegPC++)); instr_pntr = 0; // only the first prefix in a double prefix increases R, although I don't know how / why if (prefix_src < 4)