diff --git a/BizHawk.Emulation/CPUs/CP1610/Execute.cs b/BizHawk.Emulation/CPUs/CP1610/Execute.cs index 277d1749a3..042a8d4cac 100644 --- a/BizHawk.Emulation/CPUs/CP1610/Execute.cs +++ b/BizHawk.Emulation/CPUs/CP1610/Execute.cs @@ -43,12 +43,12 @@ namespace BizHawk.Emulation.CPUs.CP1610 while (PendingCycles > 0) { int addrToAdvance; + int opcode = ReadMemory(RegisterPC++) & 0x3FF; if (logging) { - log.WriteLine(Disassemble(RegisterPC, out addrToAdvance)); + log.WriteLine("{0:X3} ({1})", opcode, Disassemble((ushort)(RegisterPC - 1), out addrToAdvance)); log.Flush(); } - int opcode = ReadMemory(RegisterPC++) & 0x3FF; switch (opcode) { case 0x000: // HLT @@ -1022,7 +1022,7 @@ namespace BizHawk.Emulation.CPUs.CP1610 WriteMemory(Register[mem], Register[src]); // Stack mode. if (mem == 0x6) - RegisterSP--; + RegisterSP++; // Immediate mode. if (mem == 0x7) RegisterPC++;