From fa6e4411dd156d0efea4d9eb59194eb417b037f4 Mon Sep 17 00:00:00 2001 From: TheRealQuantam <54358053+TheRealQuantam@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:15:22 -0700 Subject: [PATCH 1/2] "(z),Y" addressing incorrectly shown as "(z,Y)" in debugger --- src/drivers/Qt/SymbolicDebug.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/drivers/Qt/SymbolicDebug.cpp b/src/drivers/Qt/SymbolicDebug.cpp index 535c82b9..1a72da37 100644 --- a/src/drivers/Qt/SymbolicDebug.cpp +++ b/src/drivers/Qt/SymbolicDebug.cpp @@ -164,13 +164,11 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str, debugS case 0xE1: chr = "SBC"; goto _indirectx; _indirectx: indirectX(tmp); - indReg = 'X'; - _indirect: if ( symDebugEnable ) sym = replaceSymbols( flags, tmp, stmp ); - sb << chr << " (" << sb_addr(opcode[1], 2) << ',' << indReg << ')'; + sb << chr << " (" << sb_addr(opcode[1], 2) << ",X)"; if (showTrace) { @@ -315,9 +313,23 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str, debugS case 0xF1: chr = "SBC"; goto _indirecty; _indirecty: indirectY(tmp); - indReg = 'Y'; - goto _indirect; + if (symDebugEnable) + sym = replaceSymbols(flags, tmp, stmp); + + sb << chr << " (" << sb_addr(opcode[1], 2) << "),Y"; + + if (showTrace) + { + sb << " @ "; + if (symDebugEnable) + sb << stmp; + else + sb << sb_addr(tmp); + + sb << " = " << sb_lit(GetMem(tmp)); + } + break; //Zero Page,X case 0x15: chr = "ORA"; goto _zeropagex; From 1028732d84fdb5c9517b8aaa0af0af50a7a201ef Mon Sep 17 00:00:00 2001 From: TheRealQuantam <54358053+TheRealQuantam@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:40:09 -0700 Subject: [PATCH 2/2] Remember that Qt and Win versions have different disassembly code --- src/asm.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/asm.cpp b/src/asm.cpp index 533bb0b1..79c155d8 100644 --- a/src/asm.cpp +++ b/src/asm.cpp @@ -337,10 +337,8 @@ char *Disassemble(int addr, uint8 *opcode) { case 0xE1: chr = "SBC"; goto _indirectx; _indirectx: indirectX(tmp); - indReg = 'X'; - _indirect: - sb << chr << " (" << sb_addr(opcode[1], 2) << ',' << indReg << ") @ " << sb_addr(tmp) << " = " << sb_lit(GetMem(tmp)); + sb << chr << " (" << sb_addr(opcode[1], 2) << ",X) @ " << sb_addr(tmp) << " = " << sb_lit(GetMem(tmp)); break; //Zero Page @@ -445,9 +443,9 @@ char *Disassemble(int addr, uint8 *opcode) { case 0xF1: chr = "SBC"; goto _indirecty; _indirecty: indirectY(tmp); - indReg = 'Y'; - goto _indirect; + sb << chr << " (" << sb_addr(opcode[1], 2) << "),Y @ " << sb_addr(tmp) << " = " << sb_lit(GetMem(tmp)); + break; //Zero Page,X case 0x15: chr = "ORA"; goto _zeropagex;