From 85c6a414f9f14e388cc9a5e1ee36ffc0e1d93273 Mon Sep 17 00:00:00 2001 From: vin Date: Sat, 20 Jul 2024 21:39:04 -0400 Subject: [PATCH] fix rest of logging format issues Now the format perfectly matches nestest.log. The only mismatch is now at the unimplemented APU memory addresses. --- cpu.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cpu.c b/cpu.c index a3b622e..8df2bf9 100644 --- a/cpu.c +++ b/cpu.c @@ -875,10 +875,10 @@ interpret(void) printf("$%02X", arg); break; case AM_ZP_X: - printf("$%02X,X", arg); + printf("$%02X,X @ %02X", peek(regs.pc - 1), arg); break; case AM_ZP_Y: - printf("$%02X,Y", arg); + printf("$%02X,Y @ %02X", peek(regs.pc - 1), arg); break; case AM_REL: case AM_ABS: @@ -891,7 +891,7 @@ interpret(void) printf("$%04X,Y @ %04X", (uint16_t)(arg - regs.y), arg); break; case AM_IND: - printf("($%04X) = %04X", arg, peek16(arg)); + printf("($%04X) = %04X", peek16(regs.pc - 2), arg); break; case AM_IND_X: printf("($%02X,X) @ %02X = %04X", peek(regs.pc - 1), (peek(regs.pc - 1) + regs.x) & 0xFF, arg); @@ -900,6 +900,8 @@ interpret(void) printf("($%02X),Y = %04X @ %04X", peek(regs.pc - 1), (uint16_t)(arg - regs.y), arg); break; case AM_ACC: + printf("A "); + break; case AM_NONE: printf(" "); break; @@ -927,6 +929,8 @@ interpret(void) break; case AM_ZP_X: case AM_ZP_Y: + spaces -= 3; + break; case AM_REL: case AM_ABS: spaces += 2;