Merge pull request #730 from TheRealQuantam/indy-fix

"(z),Y" addressing incorrectly shown as "(z,Y)" in debugger
This commit is contained in:
thor2016 2024-04-18 21:29:12 -04:00 committed by GitHub
commit 151c951d63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 10 deletions

View File

@ -337,10 +337,8 @@ char *Disassemble(int addr, uint8 *opcode) {
case 0xE1: chr = "SBC"; goto _indirectx; case 0xE1: chr = "SBC"; goto _indirectx;
_indirectx: _indirectx:
indirectX(tmp); indirectX(tmp);
indReg = 'X';
_indirect: sb << chr << " (" << sb_addr(opcode[1], 2) << ",X) @ " << sb_addr(tmp) << " = " << sb_lit(GetMem(tmp));
sb << chr << " (" << sb_addr(opcode[1], 2) << ',' << indReg << ") @ " << sb_addr(tmp) << " = " << sb_lit(GetMem(tmp));
break; break;
//Zero Page //Zero Page
@ -445,9 +443,9 @@ char *Disassemble(int addr, uint8 *opcode) {
case 0xF1: chr = "SBC"; goto _indirecty; case 0xF1: chr = "SBC"; goto _indirecty;
_indirecty: _indirecty:
indirectY(tmp); 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 //Zero Page,X
case 0x15: chr = "ORA"; goto _zeropagex; case 0x15: chr = "ORA"; goto _zeropagex;

View File

@ -164,13 +164,11 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str, debugS
case 0xE1: chr = "SBC"; goto _indirectx; case 0xE1: chr = "SBC"; goto _indirectx;
_indirectx: _indirectx:
indirectX(tmp); indirectX(tmp);
indReg = 'X';
_indirect:
if ( symDebugEnable ) if ( symDebugEnable )
sym = replaceSymbols( flags, tmp, stmp ); sym = replaceSymbols( flags, tmp, stmp );
sb << chr << " (" << sb_addr(opcode[1], 2) << ',' << indReg << ')'; sb << chr << " (" << sb_addr(opcode[1], 2) << ",X)";
if (showTrace) if (showTrace)
{ {
@ -315,9 +313,23 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str, debugS
case 0xF1: chr = "SBC"; goto _indirecty; case 0xF1: chr = "SBC"; goto _indirecty;
_indirecty: _indirecty:
indirectY(tmp); 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 //Zero Page,X
case 0x15: chr = "ORA"; goto _zeropagex; case 0x15: chr = "ORA"; goto _zeropagex;