From d469a4e5686fa12ed1046b5cccf97666987c1f4e Mon Sep 17 00:00:00 2001 From: brandman211 Date: Tue, 24 Jul 2012 03:05:57 +0000 Subject: [PATCH] -Put the disassembly in parenthesis and put the opcode to the left of it in the logs. This is uglier, but it's initially easier for comparison this way. -RegisterSP now increments in MVO@ instead of decrements. I'm not sure how this allows the stack to function properly, but it seems to work. --- BizHawk.Emulation/CPUs/CP1610/Execute.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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++;