fix color value disassembly

add ORG/RORG for multi-bank ROM disassembly
This commit is contained in:
thrust26 2020-03-30 09:52:56 +02:00
parent d2fbbdbf61
commit f48a96356f
1 changed files with 21 additions and 11 deletions

View File

@ -1024,11 +1024,6 @@ string CartDebug::saveDisassembly()
// We can't print the header to the disassembly until it's actually // We can't print the header to the disassembly until it's actually
// been processed; therefore buffer output to a string first // been processed; therefore buffer output to a string first
ostringstream buf; ostringstream buf;
buf << "\n\n;***********************************************************\n"
<< "; Bank " << myConsole.cartridge().getBank();
if (myConsole.cartridge().bankCount() > 1)
buf << " / 0.." << myConsole.cartridge().bankCount() - 1;
buf << "\n;***********************************************************\n\n";
// Use specific settings for disassembly output // Use specific settings for disassembly output
// This will most likely differ from what you see in the debugger // This will most likely differ from what you see in the debugger
@ -1044,13 +1039,23 @@ string CartDebug::saveDisassembly()
Disassembly disasm; Disassembly disasm;
disasm.list.reserve(2048); disasm.list.reserve(2048);
for(int bank = 0; bank < myConsole.cartridge().bankCount(); ++bank) uInt16 bankCount = myConsole.cartridge().bankCount();
for(int bank = 0; bank < bankCount; ++bank)
{ {
BankInfo& info = myBankInfo[bank]; BankInfo& info = myBankInfo[bank];
// An empty address list means that DiStella can't do a disassembly // An empty address list means that DiStella can't do a disassembly
if(info.addressList.size() == 0) if(info.addressList.size() == 0)
continue; continue;
buf << "\n\n;***********************************************************\n"
<< "; Bank " << bank;
if (bankCount > 1)
buf << " / 0.." << bankCount - 1;
buf << "\n;***********************************************************\n\n";
// Disassemble bank // Disassemble bank
disasm.list.clear(); disasm.list.clear();
DiStella distella(*this, disasm.list, info, settings, DiStella distella(*this, disasm.list, info, settings,
@ -1059,8 +1064,13 @@ string CartDebug::saveDisassembly()
if (myReserved.breakFound) if (myReserved.breakFound)
addLabel("Break", myDebugger.dpeek(0xfffe)); addLabel("Break", myDebugger.dpeek(0xfffe));
buf << " SEG CODE\n" buf << " SEG CODE\n";
<< " ORG $" << Base::HEX4 << info.offset << "\n\n";
if(bankCount == 1)
buf << " ORG $" << Base::HEX4 << info.offset << "\n\n";
else
buf << " ORG $" << Base::HEX4 << ((0x0000 + bank * 0x1000) & 0xffff) << "\n"
<< " RORG $" << Base::HEX4 << info.offset << "\n\n";
// Format in 'distella' style // Format in 'distella' style
for(uInt32 i = 0; i < disasm.list.size(); ++i) for(uInt32 i = 0; i < disasm.list.size(); ++i)
@ -1101,15 +1111,15 @@ string CartDebug::saveDisassembly()
break; break;
case Device::COL: case Device::COL:
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 12) << "; $" << Base::HEX4 << tag.address << " (C)"; buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 15) << "; $" << Base::HEX4 << tag.address << " (C)";
break; break;
case Device::PCOL: case Device::PCOL:
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 12) << "; $" << Base::HEX4 << tag.address << " (CP)"; buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 15) << "; $" << Base::HEX4 << tag.address << " (CP)";
break; break;
case Device::BCOL: case Device::BCOL:
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 12) << "; $" << Base::HEX4 << tag.address << " (CB)"; buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 15) << "; $" << Base::HEX4 << tag.address << " (CB)";
break; break;
case Device::AUD: case Device::AUD: