Debugger: mini-view for AYs: show AY PSG function: RD, WR, LA (or '--' if INACTIVE)

This commit is contained in:
tomcw 2023-03-11 13:56:44 +00:00
parent bf4eed6600
commit 5a7076135e
5 changed files with 27 additions and 0 deletions

View File

@ -143,6 +143,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Y8, // FG_SY6522_ODD
COLOR_CUSTOM_01, // FG_AY8913_EVEN
Y8, // FG_AY8913_ODD
R8, // FG_AY8913_FUNCTION
};

View File

@ -137,6 +137,7 @@
, FG_SY6522_ODD
, FG_AY8913_EVEN
, FG_AY8913_ODD
, FG_AY8913_FUNCTION
, NUM_DEBUG_COLORS
};

View File

@ -1998,6 +1998,12 @@ void DrawLine_MB_SUBUNIT(RECT& rect, WORD& iAddress, const int nCols, int iForeg
else
{
sText = "--"; // No MB card in this slot; or AY regs 14 & 15 which aren't supported by AY-3-8913
if (isMockingboardInSlot && !is6522 && iAddress == 15) // for AY reg-15, output the AY's state
{
sText = (char*)&MB.subUnit[subUnit].szState[0];
if (sText.compare("--") != 0)
DebuggerSetColorFG(DebuggerGetColor(FG_AY8913_FUNCTION)); // Show any active function in red
}
}
PrintTextCursorX(sText.c_str(), rect2);
@ -2030,6 +2036,12 @@ void DrawLine_AY8913_PAIR(RECT& rect, WORD& iAddress, const int nCols, int iFore
else
{
sText = "--"; // No MB card in this slot; or AY regs 14 & 15 which aren't supported by AY-3-8913
if (isMockingboardInSlot && iAddress == 15) // for AY reg-15, output the AY's state
{
sText = (char*)&MB.subUnit[subUnit].szState[ay];
if (sText.compare("--") != 0)
DebuggerSetColorFG(DebuggerGetColor(FG_AY8913_FUNCTION)); // Show any active function in red
}
}
PrintTextCursorX(sText.c_str(), rect2);

View File

@ -992,6 +992,18 @@ void MockingboardCard::GetSnapshotForDebugger(DEBUGGER_MB_CARD* const pMBForDebu
pMBForDebugger->subUnit[i].nAYCurrentRegister[j] = pMB->nAYCurrentRegister[j];
pMBForDebugger->subUnit[i].isAYLatchedAddressValid[j] = pMB->isAYLatchedAddressValid[j];
switch (pMB->state[j])
{
case AY_READ:
strcpy((char*)&pMBForDebugger->subUnit[i].szState[j], "RD"); break;
case AY_WRITE:
strcpy((char*)&pMBForDebugger->subUnit[i].szState[j], "WR"); break;
case AY_LATCH:
strcpy((char*)&pMBForDebugger->subUnit[i].szState[j], "LA"); break;
default: //AY_INACTIVE
strcpy((char*)&pMBForDebugger->subUnit[i].szState[j], "--"); break;
}
}
}
}

View File

@ -56,6 +56,7 @@ public:
bool timer2Active;
BYTE regsAY8913[NUM_AY8913_PER_SUBUNIT][16];
BYTE nAYCurrentRegister[NUM_AY8913_PER_SUBUNIT];
char szState[NUM_AY8913_PER_SUBUNIT][3]; // "--"(INACTIVE), "RD", "WR", "LA"
bool isAYLatchedAddressValid[NUM_AY8913_PER_SUBUNIT];
};
struct DEBUGGER_MB_CARD