Added debugger prompt command 'debugcolors', which shows a legend

of colors used in 'fixed debug colors' mode.
This commit is contained in:
Stephen Anthony 2017-04-08 00:11:02 -02:30
parent a8516ee504
commit 7b8d579360
5 changed files with 52 additions and 1 deletions

View File

@ -40,6 +40,8 @@
information about the breakif command)
- Added 'palette' command, which shows a color swatch of the
currently active TIA palette
- Added 'debugcolors' command, which shows a legend for 'fixed debug
colors' mode
- The previous trap'm' commands now work when setting TIA read
addresses; previously they only worked for write addresses
- The previous trap'm' commands are now renamed 'trap', 'trapread'

View File

@ -837,6 +837,13 @@ void DebuggerParser::executeData()
debugger.rom().invalidate();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "debugcolors"
void DebuggerParser::executeDebugColors()
{
commandResult << debugger.tiaDebug().debugColors();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// "define"
void DebuggerParser::executeDefine()
@ -1823,6 +1830,16 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
std::mem_fn(&DebuggerParser::executeData)
},
{
"debugcolors",
"Show Fixed Debug Colors information",
"Example: debugcolors (no parameters)",
false,
false,
{ kARG_END_ARGS },
std::mem_fn(&DebuggerParser::executeDebugColors)
},
{
"define",
"Define label xx for address yy",

View File

@ -68,7 +68,7 @@ class DebuggerParser
bool saveScriptFile(string file);
private:
enum { kNumCommands = 71 };
enum { kNumCommands = 72 };
// Constants for argument processing
enum {
@ -132,6 +132,7 @@ class DebuggerParser
void executeColortest();
void executeD();
void executeData();
void executeDebugColors();
void executeDefine();
void executeDelbreakif();
void executeDelfunction();

View File

@ -742,6 +742,36 @@ string TIADebug::booleanWithLabel(string label, bool value)
return "-" + label;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string TIADebug::debugColors() const
{
ostringstream buf;
if(myTIA.myFrameManager.layout() == FrameLayout::ntsc)
{
buf << " Red " << colorSwatch(myTIA.P0ColorNTSC) << " Player 0\n"
<< " Orange " << colorSwatch(myTIA.M0ColorNTSC) << " Missile 0\n"
<< " Yellow " << colorSwatch(myTIA.P1ColorNTSC) << " Player 1\n"
<< " Green " << colorSwatch(myTIA.M1ColorNTSC) << " Missile 1\n"
<< " Blue " << colorSwatch(myTIA.BLColorNTSC) << " Ball\n"
<< " Purple " << colorSwatch(myTIA.PFColorNTSC) << " Playfield\n"
<< " Grey " << colorSwatch(myTIA.BKColorNTSC) << " Background\n"
<< " White " << colorSwatch(myTIA.HBLANKColor) << " HMOVE\n";
}
else
{
buf << " Red " << colorSwatch(myTIA.P0ColorPAL) << " Player 0\n"
<< " Orange " << colorSwatch(myTIA.M0ColorPAL) << " Missile 0\n"
<< " Yellow " << colorSwatch(myTIA.P1ColorPAL) << " Player 1\n"
<< " Green " << colorSwatch(myTIA.M1ColorPAL) << " Missile 1\n"
<< " Blue " << colorSwatch(myTIA.BLColorPAL) << " Ball\n"
<< " Purple " << colorSwatch(myTIA.PFColorPAL) << " Playfield\n"
<< " Grey " << colorSwatch(myTIA.BKColorPAL) << " Background\n"
<< " White " << colorSwatch(myTIA.HBLANKColor) << " HMOVE\n";
}
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string TIADebug::palette() const
{

View File

@ -59,6 +59,7 @@ class TIADebug : public DebuggerSystem
void saveOldState() override;
string toString() override;
string debugColors() const;
string palette() const;
// TIA byte (or part of a byte) registers