mirror of https://github.com/stella-emu/stella.git
add detection of audio data in DiStella (see #596)
This commit is contained in:
parent
c09b6167a1
commit
09fb69f397
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
* Added displaying last write address in debugger. (TOOD: Doc)
|
* Added displaying last write address in debugger. (TOOD: Doc)
|
||||||
|
|
||||||
* Added detection of color data in DiStella. (TOOD: Doc)
|
* Added detection of color and audio data in DiStella. (TOOD: Doc)
|
||||||
|
|
||||||
|
|
||||||
6.0.2 to 6.1: (March 22, 2020)
|
6.0.2 to 6.1: (March 22, 2020)
|
||||||
|
|
|
@ -916,6 +916,11 @@ string CartDebug::loadConfigFile()
|
||||||
buf >> hex >> start >> hex >> end;
|
buf >> hex >> start >> hex >> end;
|
||||||
addDirective(Device::BCOL, start, end, currentbank);
|
addDirective(Device::BCOL, start, end, currentbank);
|
||||||
}
|
}
|
||||||
|
else if(BSPF::startsWithIgnoreCase(directive, "Device::AUD"))
|
||||||
|
{
|
||||||
|
buf >> hex >> start >> hex >> end;
|
||||||
|
addDirective(Device::AUD, start, end, currentbank);
|
||||||
|
}
|
||||||
else if(BSPF::startsWithIgnoreCase(directive, "Device::DATA"))
|
else if(BSPF::startsWithIgnoreCase(directive, "Device::DATA"))
|
||||||
{
|
{
|
||||||
buf >> hex >> start >> hex >> end;
|
buf >> hex >> start >> hex >> end;
|
||||||
|
@ -1070,57 +1075,54 @@ string CartDebug::saveDisassembly()
|
||||||
switch(tag.type)
|
switch(tag.type)
|
||||||
{
|
{
|
||||||
case Device::CODE:
|
case Device::CODE:
|
||||||
{
|
|
||||||
buf << ALIGN(32) << tag.disasm << tag.ccount.substr(0, 5) << tag.ctotal << tag.ccount.substr(5, 2);
|
buf << ALIGN(32) << tag.disasm << tag.ccount.substr(0, 5) << tag.ctotal << tag.ccount.substr(5, 2);
|
||||||
if (tag.disasm.find("WSYNC") != std::string::npos)
|
if (tag.disasm.find("WSYNC") != std::string::npos)
|
||||||
buf << "\n;---------------------------------------";
|
buf << "\n;---------------------------------------";
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case Device::ROW:
|
case Device::ROW:
|
||||||
{
|
|
||||||
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 8*4-1) << "; $" << Base::HEX4 << tag.address << " (*)";
|
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 8*4-1) << "; $" << Base::HEX4 << tag.address << " (*)";
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case Device::GFX:
|
case Device::GFX:
|
||||||
{
|
|
||||||
buf << ".byte " << (settings.gfxFormat == Base::Fmt::_2 ? "%" : "$")
|
buf << ".byte " << (settings.gfxFormat == Base::Fmt::_2 ? "%" : "$")
|
||||||
<< tag.bytes << " ; |";
|
<< tag.bytes << " ; |";
|
||||||
for(int c = 12; c < 20; ++c)
|
for(int c = 12; c < 20; ++c)
|
||||||
buf << ((tag.disasm[c] == '\x1e') ? "#" : " ");
|
buf << ((tag.disasm[c] == '\x1e') ? "#" : " ");
|
||||||
buf << ALIGN(13) << "|" << "$" << Base::HEX4 << tag.address << " (G)";
|
buf << ALIGN(13) << "|" << "$" << Base::HEX4 << tag.address << " (G)";
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case Device::PGFX:
|
case Device::PGFX:
|
||||||
{
|
|
||||||
buf << ".byte " << (settings.gfxFormat == Base::Fmt::_2 ? "%" : "$")
|
buf << ".byte " << (settings.gfxFormat == Base::Fmt::_2 ? "%" : "$")
|
||||||
<< tag.bytes << " ; |";
|
<< tag.bytes << " ; |";
|
||||||
for(int c = 12; c < 20; ++c)
|
for(int c = 12; c < 20; ++c)
|
||||||
buf << ((tag.disasm[c] == '\x1f') ? "*" : " ");
|
buf << ((tag.disasm[c] == '\x1f') ? "*" : " ");
|
||||||
buf << ALIGN(13) << "|" << "$" << Base::HEX4 << tag.address << " (P)";
|
buf << ALIGN(13) << "|" << "$" << Base::HEX4 << tag.address << " (P)";
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case Device::COL:
|
case Device::COL:
|
||||||
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 12) << "; $" << Base::HEX4 << tag.address << " (Px)";
|
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 12) << "; $" << 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 << " (PF)";
|
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 12) << "; $" << 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 << " (BK)";
|
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 12) << "; $" << Base::HEX4 << tag.address << " (CB)";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Device::AUD:
|
||||||
|
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 8 * 4 - 1) << "; $" << Base::HEX4 << tag.address << " (A)";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Device::DATA:
|
case Device::DATA:
|
||||||
{
|
|
||||||
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 8 * 4 - 1) << "; $" << Base::HEX4 << tag.address << " (D)";
|
buf << ".byte " << ALIGN(32) << tag.disasm.substr(6, 8 * 4 - 1) << "; $" << Base::HEX4 << tag.address << " (D)";
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case Device::NONE:
|
case Device::NONE:
|
||||||
default:
|
default:
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
} // switch
|
} // switch
|
||||||
buf << "\n";
|
buf << "\n";
|
||||||
}
|
}
|
||||||
|
@ -1138,6 +1140,10 @@ string CartDebug::saveDisassembly()
|
||||||
<< "; D = Device::DATA directive (referenced in some way)\n"
|
<< "; D = Device::DATA directive (referenced in some way)\n"
|
||||||
<< "; G = Device::GFX directive, shown as '#' (stored in player, missile, ball)\n"
|
<< "; G = Device::GFX directive, shown as '#' (stored in player, missile, ball)\n"
|
||||||
<< "; P = Device::PGFX directive, shown as '*' (stored in playfield)\n"
|
<< "; P = Device::PGFX directive, shown as '*' (stored in playfield)\n"
|
||||||
|
<< "; C = Device::COL directive, shown as '*' (stored in player color)\n"
|
||||||
|
<< "; CP = Device::PCOL directive, shown as '*' (stored in playfield color)\n"
|
||||||
|
<< "; CB = Device::BCOL directive, shown as '*' (stored in background color)\n"
|
||||||
|
<< "; A = Device::AUD directive, shown as '*' (stored in audio registers)\n"
|
||||||
<< "; i = indexed accessed only\n"
|
<< "; i = indexed accessed only\n"
|
||||||
<< "; c = used by code executed in RAM\n"
|
<< "; c = used by code executed in RAM\n"
|
||||||
<< "; s = used by stack\n"
|
<< "; s = used by stack\n"
|
||||||
|
@ -1478,6 +1484,8 @@ Device::AccessType CartDebug::accessTypeAbsolute(Device::AccessFlags flags) cons
|
||||||
return Device::PCOL;
|
return Device::PCOL;
|
||||||
else if(flags & Device::BCOL)
|
else if(flags & Device::BCOL)
|
||||||
return Device::BCOL;
|
return Device::BCOL;
|
||||||
|
else if(flags & Device::AUD)
|
||||||
|
return Device::AUD;
|
||||||
else if(flags & Device::DATA)
|
else if(flags & Device::DATA)
|
||||||
return Device::DATA;
|
return Device::DATA;
|
||||||
else if(flags & Device::ROW)
|
else if(flags & Device::ROW)
|
||||||
|
@ -1498,6 +1506,7 @@ void CartDebug::AccessTypeAsString(ostream& buf, Device::AccessType type) const
|
||||||
case Device::COL: buf << "Device::COL"; break;
|
case Device::COL: buf << "Device::COL"; break;
|
||||||
case Device::PCOL: buf << "Device::PCOL"; break;
|
case Device::PCOL: buf << "Device::PCOL"; break;
|
||||||
case Device::BCOL: buf << "Device::BCOL"; break;
|
case Device::BCOL: buf << "Device::BCOL"; break;
|
||||||
|
case Device::AUD: buf << "Device::AUD"; break;
|
||||||
case Device::DATA: buf << "Device::DATA"; break;
|
case Device::DATA: buf << "Device::DATA"; break;
|
||||||
case Device::ROW: buf << "Device::ROW"; break;
|
case Device::ROW: buf << "Device::ROW"; break;
|
||||||
case Device::REFERENCED:
|
case Device::REFERENCED:
|
||||||
|
@ -1525,6 +1534,8 @@ void CartDebug::AccessTypeAsString(ostream& buf, Device::AccessFlags flags) cons
|
||||||
buf << "Device::PCOL ";
|
buf << "Device::PCOL ";
|
||||||
if(flags & Device::BCOL)
|
if(flags & Device::BCOL)
|
||||||
buf << "Device::BCOL ";
|
buf << "Device::BCOL ";
|
||||||
|
if(flags & Device::AUD)
|
||||||
|
buf << "Device::AUD ";
|
||||||
if(flags & Device::DATA)
|
if(flags & Device::DATA)
|
||||||
buf << "Device::DATA ";
|
buf << "Device::DATA ";
|
||||||
if(flags & Device::ROW)
|
if(flags & Device::ROW)
|
||||||
|
|
|
@ -142,7 +142,7 @@ class CartDebug : public DebuggerSystem
|
||||||
things can't be automatically determined. For now, these directives
|
things can't be automatically determined. For now, these directives
|
||||||
have exactly the same syntax as in a distella configuration file.
|
have exactly the same syntax as in a distella configuration file.
|
||||||
|
|
||||||
@param type Currently, CODE/DATA/GFX are supported
|
@param type Currently, CODE/DATA/GFX/PGFX/COL/PCOL/BCOL/AUD/ROW are supported
|
||||||
@param start The start address (inclusive) to mark with the given type
|
@param start The start address (inclusive) to mark with the given type
|
||||||
@param end The end address (inclusive) to mark with the given type
|
@param end The end address (inclusive) to mark with the given type
|
||||||
@param bank Bank to which these directive apply (0 indicated current bank)
|
@param bank Bank to which these directive apply (0 indicated current bank)
|
||||||
|
|
|
@ -117,8 +117,8 @@ void DiStella::disasm(uInt32 distart, int pass)
|
||||||
|
|
||||||
/* pc=myAppData.start; */
|
/* pc=myAppData.start; */
|
||||||
myPC = distart - myOffset;
|
myPC = distart - myOffset;
|
||||||
while (myPC <= myAppData.end) {
|
while(myPC <= myAppData.end)
|
||||||
|
{
|
||||||
// since -1 is used in m6502.m4 for clearing the last peek
|
// since -1 is used in m6502.m4 for clearing the last peek
|
||||||
// and this results into an access at e.g. 0xffff,
|
// and this results into an access at e.g. 0xffff,
|
||||||
// we have to fix the consequences here (ugly!).
|
// we have to fix the consequences here (ugly!).
|
||||||
|
@ -133,7 +133,8 @@ void DiStella::disasm(uInt32 distart, int pass)
|
||||||
if(pass == 3)
|
if(pass == 3)
|
||||||
outputGraphics();
|
outputGraphics();
|
||||||
++myPC;
|
++myPC;
|
||||||
} else if (checkBits(myPC, Device::COL | Device::PCOL | Device::BCOL,
|
}
|
||||||
|
else if(checkBits(myPC, Device::COL | Device::PCOL | Device::BCOL,
|
||||||
Device::CODE | Device::GFX | Device::PGFX))
|
Device::CODE | Device::GFX | Device::PGFX))
|
||||||
{
|
{
|
||||||
if(pass == 2)
|
if(pass == 2)
|
||||||
|
@ -141,9 +142,22 @@ void DiStella::disasm(uInt32 distart, int pass)
|
||||||
if(pass == 3)
|
if(pass == 3)
|
||||||
outputColors();
|
outputColors();
|
||||||
++myPC;
|
++myPC;
|
||||||
} else if (checkBits(myPC, Device::DATA,
|
}
|
||||||
|
else if(checkBits(myPC, Device::AUD,
|
||||||
Device::CODE | Device::GFX | Device::PGFX |
|
Device::CODE | Device::GFX | Device::PGFX |
|
||||||
Device::COL | Device::PCOL | Device::BCOL))
|
Device::COL | Device::PCOL | Device::BCOL))
|
||||||
|
{
|
||||||
|
if(pass == 2)
|
||||||
|
mark(myPC + myOffset, Device::VALID_ENTRY);
|
||||||
|
if(pass == 3)
|
||||||
|
outputBytes(Device::AUD);
|
||||||
|
else
|
||||||
|
++myPC;
|
||||||
|
}
|
||||||
|
else if(checkBits(myPC, Device::DATA,
|
||||||
|
Device::CODE | Device::GFX | Device::PGFX |
|
||||||
|
Device::COL | Device::PCOL | Device::BCOL |
|
||||||
|
Device::AUD))
|
||||||
{
|
{
|
||||||
if(pass == 2)
|
if(pass == 2)
|
||||||
mark(myPC + myOffset, Device::VALID_ENTRY);
|
mark(myPC + myOffset, Device::VALID_ENTRY);
|
||||||
|
@ -151,10 +165,11 @@ void DiStella::disasm(uInt32 distart, int pass)
|
||||||
outputBytes(Device::DATA);
|
outputBytes(Device::DATA);
|
||||||
else
|
else
|
||||||
++myPC;
|
++myPC;
|
||||||
} else if (checkBits(myPC, Device::ROW,
|
}
|
||||||
Device::CODE |
|
else if(checkBits(myPC, Device::ROW,
|
||||||
Device::DATA | Device::GFX | Device::PGFX |
|
Device::CODE | Device::GFX | Device::PGFX |
|
||||||
Device::COL | Device::PCOL | Device::BCOL)) {
|
Device::COL | Device::PCOL | Device::BCOL |
|
||||||
|
Device::AUD | Device::DATA)) {
|
||||||
FIX_LAST:
|
FIX_LAST:
|
||||||
if(pass == 2)
|
if(pass == 2)
|
||||||
mark(myPC + myOffset, Device::VALID_ENTRY);
|
mark(myPC + myOffset, Device::VALID_ENTRY);
|
||||||
|
@ -163,7 +178,8 @@ FIX_LAST:
|
||||||
outputBytes(Device::ROW);
|
outputBytes(Device::ROW);
|
||||||
else
|
else
|
||||||
++myPC;
|
++myPC;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
// The following sections must be CODE
|
// The following sections must be CODE
|
||||||
|
|
||||||
// add extra spacing line when switching from non-code to code
|
// add extra spacing line when switching from non-code to code
|
||||||
|
@ -221,7 +237,8 @@ FIX_LAST:
|
||||||
}
|
}
|
||||||
// continue with the label's opcode
|
// continue with the label's opcode
|
||||||
continue;
|
continue;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if(pass == 3) {
|
if(pass == 3) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
@ -323,16 +340,19 @@ FIX_LAST:
|
||||||
if(labelFound == AddressType::ROM) {
|
if(labelFound == AddressType::ROM) {
|
||||||
LABEL_A12_HIGH(ad);
|
LABEL_A12_HIGH(ad);
|
||||||
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
||||||
} else if (labelFound == AddressType::ROM_MIRROR) {
|
}
|
||||||
|
else if(labelFound == AddressType::ROM_MIRROR) {
|
||||||
if(mySettings.rFlag) {
|
if(mySettings.rFlag) {
|
||||||
int tmp = (ad & myAppData.end) + myOffset;
|
int tmp = (ad & myAppData.end) + myOffset;
|
||||||
LABEL_A12_HIGH(tmp);
|
LABEL_A12_HIGH(tmp);
|
||||||
nextLineBytes << Base::HEX2 << int(tmp & 0xff) << " " << Base::HEX2 << int(tmp >> 8);
|
nextLineBytes << Base::HEX2 << int(tmp & 0xff) << " " << Base::HEX2 << int(tmp >> 8);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
nextLine << "$" << Base::HEX4 << ad;
|
nextLine << "$" << Base::HEX4 << ad;
|
||||||
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
LABEL_A12_LOW(ad);
|
LABEL_A12_LOW(ad);
|
||||||
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
||||||
}
|
}
|
||||||
|
@ -372,7 +392,8 @@ FIX_LAST:
|
||||||
// The processing is left here, however, in case future versions of
|
// The processing is left here, however, in case future versions of
|
||||||
// the code can somehow track access to CPU registers
|
// the code can somehow track access to CPU registers
|
||||||
mark(ad, Device::ROW);
|
mark(ad, Device::ROW);
|
||||||
} else if (pass == 3) {
|
}
|
||||||
|
else if(pass == 3) {
|
||||||
if(ad < 0x100 && mySettings.fFlag)
|
if(ad < 0x100 && mySettings.fFlag)
|
||||||
nextLine << ".wx ";
|
nextLine << ".wx ";
|
||||||
else
|
else
|
||||||
|
@ -382,17 +403,20 @@ FIX_LAST:
|
||||||
LABEL_A12_HIGH(ad);
|
LABEL_A12_HIGH(ad);
|
||||||
nextLine << ",x";
|
nextLine << ",x";
|
||||||
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
||||||
} else if (labelFound == AddressType::ROM_MIRROR) {
|
}
|
||||||
|
else if(labelFound == AddressType::ROM_MIRROR) {
|
||||||
if(mySettings.rFlag) {
|
if(mySettings.rFlag) {
|
||||||
int tmp = (ad & myAppData.end) + myOffset;
|
int tmp = (ad & myAppData.end) + myOffset;
|
||||||
LABEL_A12_HIGH(tmp);
|
LABEL_A12_HIGH(tmp);
|
||||||
nextLine << ",x";
|
nextLine << ",x";
|
||||||
nextLineBytes << Base::HEX2 << int(tmp & 0xff) << " " << Base::HEX2 << int(tmp >> 8);
|
nextLineBytes << Base::HEX2 << int(tmp & 0xff) << " " << Base::HEX2 << int(tmp >> 8);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
nextLine << "$" << Base::HEX4 << ad << ",x";
|
nextLine << "$" << Base::HEX4 << ad << ",x";
|
||||||
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
LABEL_A12_LOW(ad);
|
LABEL_A12_LOW(ad);
|
||||||
nextLine << ",x";
|
nextLine << ",x";
|
||||||
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
||||||
|
@ -411,7 +435,8 @@ FIX_LAST:
|
||||||
// The processing is left here, however, in case future versions of
|
// The processing is left here, however, in case future versions of
|
||||||
// the code can somehow track access to CPU registers
|
// the code can somehow track access to CPU registers
|
||||||
mark(ad, Device::ROW);
|
mark(ad, Device::ROW);
|
||||||
} else if (pass == 3) {
|
}
|
||||||
|
else if(pass == 3) {
|
||||||
if(ad < 0x100 && mySettings.fFlag)
|
if(ad < 0x100 && mySettings.fFlag)
|
||||||
nextLine << ".wy ";
|
nextLine << ".wy ";
|
||||||
else
|
else
|
||||||
|
@ -421,17 +446,20 @@ FIX_LAST:
|
||||||
LABEL_A12_HIGH(ad);
|
LABEL_A12_HIGH(ad);
|
||||||
nextLine << ",y";
|
nextLine << ",y";
|
||||||
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
||||||
} else if (labelFound == AddressType::ROM_MIRROR) {
|
}
|
||||||
|
else if(labelFound == AddressType::ROM_MIRROR) {
|
||||||
if(mySettings.rFlag) {
|
if(mySettings.rFlag) {
|
||||||
int tmp = (ad & myAppData.end) + myOffset;
|
int tmp = (ad & myAppData.end) + myOffset;
|
||||||
LABEL_A12_HIGH(tmp);
|
LABEL_A12_HIGH(tmp);
|
||||||
nextLine << ",y";
|
nextLine << ",y";
|
||||||
nextLineBytes << Base::HEX2 << int(tmp & 0xff) << " " << Base::HEX2 << int(tmp >> 8);
|
nextLineBytes << Base::HEX2 << int(tmp & 0xff) << " " << Base::HEX2 << int(tmp >> 8);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
nextLine << "$" << Base::HEX4 << ad << ",y";
|
nextLine << "$" << Base::HEX4 << ad << ",y";
|
||||||
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
LABEL_A12_LOW(ad);
|
LABEL_A12_LOW(ad);
|
||||||
nextLine << ",y";
|
nextLine << ",y";
|
||||||
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
nextLineBytes << Base::HEX2 << int(ad & 0xff) << " " << Base::HEX2 << int(ad >> 8);
|
||||||
|
@ -505,7 +533,8 @@ FIX_LAST:
|
||||||
if(labelFound == AddressType::ROM) {
|
if(labelFound == AddressType::ROM) {
|
||||||
nextLine << " ";
|
nextLine << " ";
|
||||||
LABEL_A12_HIGH(ad);
|
LABEL_A12_HIGH(ad);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
nextLine << " $" << Base::HEX4 << ad;
|
nextLine << " $" << Base::HEX4 << ad;
|
||||||
|
|
||||||
nextLineBytes << Base::HEX2 << int(d1);
|
nextLineBytes << Base::HEX2 << int(d1);
|
||||||
|
@ -523,7 +552,8 @@ FIX_LAST:
|
||||||
// The processing is left here, however, in case future versions of
|
// The processing is left here, however, in case future versions of
|
||||||
// the code can somehow track access to CPU registers
|
// the code can somehow track access to CPU registers
|
||||||
mark(ad, Device::ROW);
|
mark(ad, Device::ROW);
|
||||||
} else if (pass == 3) {
|
}
|
||||||
|
else if(pass == 3) {
|
||||||
if(ad < 0x100 && mySettings.fFlag)
|
if(ad < 0x100 && mySettings.fFlag)
|
||||||
nextLine << ".ind ";
|
nextLine << ".ind ";
|
||||||
else
|
else
|
||||||
|
@ -539,7 +569,8 @@ FIX_LAST:
|
||||||
if(mySettings.rFlag) {
|
if(mySettings.rFlag) {
|
||||||
int tmp = (ad & myAppData.end) + myOffset;
|
int tmp = (ad & myAppData.end) + myOffset;
|
||||||
LABEL_A12_HIGH(tmp);
|
LABEL_A12_HIGH(tmp);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
LABEL_A12_LOW(ad);
|
LABEL_A12_LOW(ad);
|
||||||
}
|
}
|
||||||
nextLine << ")";
|
nextLine << ")";
|
||||||
|
@ -571,7 +602,8 @@ FIX_LAST:
|
||||||
// output cycles for previous code block
|
// output cycles for previous code block
|
||||||
myDisasmBuf << "'= " << std::setw(3) << std::setfill(' ') << std::dec << cycles;
|
myDisasmBuf << "'= " << std::setw(3) << std::setfill(' ') << std::dec << cycles;
|
||||||
cycles = 0;
|
cycles = 0;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
myDisasmBuf << "' ";
|
myDisasmBuf << "' ";
|
||||||
}
|
}
|
||||||
myDisasmBuf << "'" << nextLineBytes.str();
|
myDisasmBuf << "'" << nextLineBytes.str();
|
||||||
|
@ -586,7 +618,7 @@ FIX_LAST:
|
||||||
nextLine.str("");
|
nextLine.str("");
|
||||||
nextLineBytes.str("");
|
nextLineBytes.str("");
|
||||||
}
|
}
|
||||||
}
|
} // CODE
|
||||||
} /* while loop */
|
} /* while loop */
|
||||||
|
|
||||||
/* Just in case we are disassembling outside of the address range, force the myPCEnd to EOF */
|
/* Just in case we are disassembling outside of the address range, force the myPCEnd to EOF */
|
||||||
|
@ -630,7 +662,7 @@ void DiStella::disasmPass1(CartDebug::AddressList& debuggerAddresses)
|
||||||
// Therefore, we stop at the first such address encountered
|
// Therefore, we stop at the first such address encountered
|
||||||
for (uInt32 k = pcBeg; k <= myPCEnd; ++k) {
|
for (uInt32 k = pcBeg; k <= myPCEnd; ++k) {
|
||||||
if (checkBits(k, Device::Device::DATA | Device::GFX | Device::PGFX |
|
if (checkBits(k, Device::Device::DATA | Device::GFX | Device::PGFX |
|
||||||
Device::COL | Device::PCOL | Device::BCOL,
|
Device::COL | Device::PCOL | Device::BCOL | Device::AUD,
|
||||||
Device::CODE)) {
|
Device::CODE)) {
|
||||||
//if (Debugger::debugger().getAccessFlags(k) &
|
//if (Debugger::debugger().getAccessFlags(k) &
|
||||||
// (Device::DATA | Device::GFX | Device::PGFX)) {
|
// (Device::DATA | Device::GFX | Device::PGFX)) {
|
||||||
|
@ -692,7 +724,7 @@ void DiStella::disasmPass1(CartDebug::AddressList& debuggerAddresses)
|
||||||
|
|
||||||
// Must be ROW / unused bytes
|
// Must be ROW / unused bytes
|
||||||
if (!checkBit(k, Device::CODE | Device::GFX | Device::PGFX |
|
if (!checkBit(k, Device::CODE | Device::GFX | Device::PGFX |
|
||||||
Device::COL | Device::PCOL | Device::BCOL |
|
Device::COL | Device::PCOL | Device::BCOL | Device::AUD |
|
||||||
Device::DATA))
|
Device::DATA))
|
||||||
mark(k + myOffset, Device::ROW);
|
mark(k + myOffset, Device::ROW);
|
||||||
}
|
}
|
||||||
|
@ -711,7 +743,7 @@ void DiStella::disasmFromAddress(uInt32 distart)
|
||||||
|
|
||||||
// abort when we reach non-code areas
|
// abort when we reach non-code areas
|
||||||
if (checkBits(myPC, Device::Device::DATA | Device::GFX | Device::PGFX |
|
if (checkBits(myPC, Device::Device::DATA | Device::GFX | Device::PGFX |
|
||||||
Device::COL | Device::PCOL | Device::BCOL,
|
Device::COL | Device::PCOL | Device::BCOL | Device::AUD,
|
||||||
Device::CODE)) {
|
Device::CODE)) {
|
||||||
myPCEnd = (myPC - 1) + myOffset;
|
myPCEnd = (myPC - 1) + myOffset;
|
||||||
return;
|
return;
|
||||||
|
@ -1037,18 +1069,11 @@ void DiStella::addEntry(Device::AccessType type)
|
||||||
|
|
||||||
case Device::GFX:
|
case Device::GFX:
|
||||||
case Device::PGFX:
|
case Device::PGFX:
|
||||||
getline(myDisasmBuf, tag.disasm, '\'');
|
|
||||||
getline(myDisasmBuf, tag.bytes);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Device::COL:
|
case Device::COL:
|
||||||
case Device::PCOL:
|
case Device::PCOL:
|
||||||
case Device::BCOL:
|
case Device::BCOL:
|
||||||
getline(myDisasmBuf, tag.disasm, '\'');
|
|
||||||
getline(myDisasmBuf, tag.bytes);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Device::DATA:
|
case Device::DATA:
|
||||||
|
case Device::AUD:
|
||||||
getline(myDisasmBuf, tag.disasm, '\'');
|
getline(myDisasmBuf, tag.disasm, '\'');
|
||||||
getline(myDisasmBuf, tag.bytes);
|
getline(myDisasmBuf, tag.bytes);
|
||||||
break;
|
break;
|
||||||
|
@ -1213,7 +1238,7 @@ void DiStella::outputBytes(Device::AccessType type)
|
||||||
isType = checkBits(myPC, type,
|
isType = checkBits(myPC, type,
|
||||||
Device::CODE | (type != Device::DATA ? Device::DATA : 0) |
|
Device::CODE | (type != Device::DATA ? Device::DATA : 0) |
|
||||||
Device::GFX | Device::PGFX |
|
Device::GFX | Device::PGFX |
|
||||||
Device::COL | Device::PCOL | Device::BCOL);
|
Device::COL | Device::PCOL | Device::BCOL | Device::AUD);
|
||||||
referenced = checkBit(myPC, Device::REFERENCED);
|
referenced = checkBit(myPC, Device::REFERENCED);
|
||||||
}
|
}
|
||||||
if (!lineEmpty)
|
if (!lineEmpty)
|
||||||
|
|
|
@ -46,13 +46,14 @@ class Device : public Serializable
|
||||||
// debugger, or specified in a Distella cfg file, and are listed in order
|
// debugger, or specified in a Distella cfg file, and are listed in order
|
||||||
// of decreasing hierarchy
|
// of decreasing hierarchy
|
||||||
//
|
//
|
||||||
CODE = 1 << 10, // 0x400, disassemble-able code segments
|
CODE = 1 << 11, // 0x800, disassemble-able code segments
|
||||||
TCODE = 1 << 9, // 0x200, (tentative) disassemble-able code segments
|
TCODE = 1 << 10, // 0x400, (tentative) disassemble-able code segments
|
||||||
GFX = 1 << 8, // 0x100, addresses loaded into GRPx registers
|
GFX = 1 << 9, // 0x200, addresses loaded into GRPx registers
|
||||||
PGFX = 1 << 7, // 0x080, addresses loaded into PFx registers
|
PGFX = 1 << 8, // 0x100, addresses loaded into PFx registers
|
||||||
COL = 1 << 6, // 0x040, addresses loaded into COLUPx registers
|
COL = 1 << 7, // 0x080, addresses loaded into COLUPx registers
|
||||||
PCOL = 1 << 5, // 0x010, addresses loaded into COLUPF register
|
PCOL = 1 << 6, // 0x040, addresses loaded into COLUPF register
|
||||||
BCOL = 1 << 4, // 0x010, addresses loaded into COLUBK register
|
BCOL = 1 << 5, // 0x020, addresses loaded into COLUBK register
|
||||||
|
AUD = 1 << 4, // 0x010, addresses loaded into audio registers
|
||||||
DATA = 1 << 3, // 0x008, addresses loaded into registers other than GRPx / PFx
|
DATA = 1 << 3, // 0x008, addresses loaded into registers other than GRPx / PFx
|
||||||
ROW = 1 << 2, // 0x004, all other addresses
|
ROW = 1 << 2, // 0x004, all other addresses
|
||||||
// special type for poke()
|
// special type for poke()
|
||||||
|
|
|
@ -23,21 +23,15 @@
|
||||||
|
|
||||||
// Flags for access types
|
// Flags for access types
|
||||||
#define DISASM_CODE Device::CODE
|
#define DISASM_CODE Device::CODE
|
||||||
// #define DISASM_GFX Device::GFX
|
|
||||||
// #define DISASM_PGFX Device::PGFX
|
|
||||||
#define DISASM_DATA Device::DATA
|
#define DISASM_DATA Device::DATA
|
||||||
// #define DISASM_ROW Device::ROW
|
|
||||||
#define DISASM_WRITE Device::WRITE
|
#define DISASM_WRITE Device::WRITE
|
||||||
#define DISASM_NONE 0
|
#define DISASM_NONE Device::NONE
|
||||||
#else
|
#else
|
||||||
// Flags for access types
|
// Flags for access types
|
||||||
#define DISASM_CODE 0
|
#define DISASM_CODE 0
|
||||||
// #define DISASM_GFX 0
|
|
||||||
// #define DISASM_PGFX 0
|
|
||||||
#define DISASM_DATA 0
|
#define DISASM_DATA 0
|
||||||
// #define DISASM_ROW 0
|
|
||||||
#define DISASM_NONE 0
|
|
||||||
#define DISASM_WRITE 0
|
#define DISASM_WRITE 0
|
||||||
|
#define DISASM_NONE 0
|
||||||
#endif
|
#endif
|
||||||
#include "Settings.hxx"
|
#include "Settings.hxx"
|
||||||
#include "Vec.hxx"
|
#include "Vec.hxx"
|
||||||
|
|
|
@ -534,8 +534,8 @@ void Settings::usage() const
|
||||||
<< " Arguments are more fully explained in the manual\n"
|
<< " Arguments are more fully explained in the manual\n"
|
||||||
<< endl
|
<< endl
|
||||||
<< " -dis.resolve <1|0> Attempt to resolve code sections in disassembler\n"
|
<< " -dis.resolve <1|0> Attempt to resolve code sections in disassembler\n"
|
||||||
<< " -dis.gfxformat <2|16> Set base to use for displaying GFX sections in\n"
|
<< " -dis.gfxformat <2|16> Set base to use for displaying (P)GFX sections\n"
|
||||||
<< " disassembler\n"
|
<< " in disassembler\n"
|
||||||
<< " -dis.showaddr <1|0> Show opcode addresses in disassembler\n"
|
<< " -dis.showaddr <1|0> Show opcode addresses in disassembler\n"
|
||||||
<< " -dis.relocate <1|0> Relocate calls out of address range in\n"
|
<< " -dis.relocate <1|0> Relocate calls out of address range in\n"
|
||||||
<< " disassembler\n"
|
<< " disassembler\n"
|
||||||
|
|
|
@ -234,7 +234,7 @@ class System : public Serializable
|
||||||
/**
|
/**
|
||||||
Access and modify the access type flags for the given
|
Access and modify the access type flags for the given
|
||||||
address. Note that while any flag can be used, the disassembly
|
address. Note that while any flag can be used, the disassembly
|
||||||
only really acts on CODE/GFX/PGFX/COL/PCOL/BCOL/DATA/ROW.
|
only really acts on CODE/GFX/PGFX/COL/PCOL/BCOL/AUD/DATA/ROW.
|
||||||
*/
|
*/
|
||||||
Device::AccessFlags getAccessFlags(uInt16 address) const;
|
Device::AccessFlags getAccessFlags(uInt16 address) const;
|
||||||
void setAccessFlags(uInt16 address, Device::AccessFlags flags);
|
void setAccessFlags(uInt16 address, Device::AccessFlags flags);
|
||||||
|
|
|
@ -530,34 +530,76 @@ bool TIA::poke(uInt16 address, uInt8 value)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AUDV0:
|
case AUDV0:
|
||||||
|
{
|
||||||
myAudio.channel0().audv(value);
|
myAudio.channel0().audv(value);
|
||||||
myShadowRegisters[address] = value;
|
myShadowRegisters[address] = value;
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
uInt16 dataAddr = mySystem->m6502().lastDataAddressForPoke();
|
||||||
|
if(dataAddr)
|
||||||
|
mySystem->setAccessFlags(dataAddr, Device::AUD);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case AUDV1:
|
case AUDV1:
|
||||||
|
{
|
||||||
myAudio.channel1().audv(value);
|
myAudio.channel1().audv(value);
|
||||||
myShadowRegisters[address] = value;
|
myShadowRegisters[address] = value;
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
uInt16 dataAddr = mySystem->m6502().lastDataAddressForPoke();
|
||||||
|
if(dataAddr)
|
||||||
|
mySystem->setAccessFlags(dataAddr, Device::AUD);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case AUDF0:
|
case AUDF0:
|
||||||
|
{
|
||||||
myAudio.channel0().audf(value);
|
myAudio.channel0().audf(value);
|
||||||
myShadowRegisters[address] = value;
|
myShadowRegisters[address] = value;
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
uInt16 dataAddr = mySystem->m6502().lastDataAddressForPoke();
|
||||||
|
if(dataAddr)
|
||||||
|
mySystem->setAccessFlags(dataAddr, Device::AUD);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case AUDF1:
|
case AUDF1:
|
||||||
|
{
|
||||||
myAudio.channel1().audf(value);
|
myAudio.channel1().audf(value);
|
||||||
myShadowRegisters[address] = value;
|
myShadowRegisters[address] = value;
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
uInt16 dataAddr = mySystem->m6502().lastDataAddressForPoke();
|
||||||
|
if(dataAddr)
|
||||||
|
mySystem->setAccessFlags(dataAddr, Device::AUD);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case AUDC0:
|
case AUDC0:
|
||||||
|
{
|
||||||
myAudio.channel0().audc(value);
|
myAudio.channel0().audc(value);
|
||||||
myShadowRegisters[address] = value;
|
myShadowRegisters[address] = value;
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
uInt16 dataAddr = mySystem->m6502().lastDataAddressForPoke();
|
||||||
|
if(dataAddr)
|
||||||
|
mySystem->setAccessFlags(dataAddr, Device::AUD);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case AUDC1:
|
case AUDC1:
|
||||||
|
{
|
||||||
myAudio.channel1().audc(value);
|
myAudio.channel1().audc(value);
|
||||||
myShadowRegisters[address] = value;
|
myShadowRegisters[address] = value;
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
uInt16 dataAddr = mySystem->m6502().lastDataAddressForPoke();
|
||||||
|
if(dataAddr)
|
||||||
|
mySystem->setAccessFlags(dataAddr, Device::AUD);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case HMOVE:
|
case HMOVE:
|
||||||
myDelayQueue.push(HMOVE, value, Delay::hmove);
|
myDelayQueue.push(HMOVE, value, Delay::hmove);
|
||||||
|
|
Loading…
Reference in New Issue