mirror of
https://github.com/libretro/stella2023.git
synced 2024-11-30 12:20:31 +00:00
added "swchb" command to debugger
This commit is contained in:
parent
08a2c63a0b
commit
ea05619402
@ -1017,6 +1017,7 @@ clearSaveStateIfs - Clear all saveState points
|
||||
scanLine - Advance emulation by <xx> scanlines (default=1)
|
||||
step - Single step CPU [with count xx]
|
||||
stepWhile - Single step CPU while <condition> is true
|
||||
swchb - Set SWCHB to value xx
|
||||
tia - Show TIA state
|
||||
trace - Single step CPU over subroutines [with count xx]
|
||||
trap - Trap read/write access to address(es) xx [yy]
|
||||
|
@ -148,7 +148,9 @@ string DebuggerParser::exec(const FSNode& file, StringList* history)
|
||||
if(!getline(in, command))
|
||||
break;
|
||||
|
||||
++execDepth;
|
||||
run(command);
|
||||
--execDepth;
|
||||
if (history != nullptr)
|
||||
history->push_back(command);
|
||||
count++;
|
||||
@ -1315,9 +1317,7 @@ void DebuggerParser::executeExec()
|
||||
// make sure the commands are added to prompt history
|
||||
StringList history;
|
||||
|
||||
++execDepth;
|
||||
commandResult << exec(node, &history);
|
||||
--execDepth;
|
||||
|
||||
for(const auto& item: history)
|
||||
debugger.prompt().addToHistory(item.c_str());
|
||||
@ -2159,6 +2159,14 @@ void DebuggerParser::executeStepWhile()
|
||||
commandResult << "executed " << ncycles << " cycles";
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// "swchb"
|
||||
void DebuggerParser::executeSwchb()
|
||||
{
|
||||
debugger.riotDebug().switches(args[0]);
|
||||
commandResult << "SWCHB set to " << std::hex << std::setw(2) << std::setfill('0') << args[0];
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// "tia"
|
||||
void DebuggerParser::executeTia()
|
||||
@ -3381,6 +3389,16 @@ DebuggerParser::CommandArray DebuggerParser::commands = { {
|
||||
std::mem_fn(&DebuggerParser::executeStepWhile)
|
||||
},
|
||||
|
||||
{
|
||||
"swchb",
|
||||
"Set SWCHB to xx",
|
||||
"Example: swchb fe",
|
||||
true,
|
||||
true,
|
||||
{ Parameters::ARG_WORD, Parameters::ARG_END_ARGS },
|
||||
std::mem_fn(&DebuggerParser::executeSwchb)
|
||||
},
|
||||
|
||||
{
|
||||
"tia",
|
||||
"Show TIA state",
|
||||
|
@ -101,7 +101,7 @@ class DebuggerParser
|
||||
std::array<Parameters, 10> parms;
|
||||
std::function<void (DebuggerParser*)> executor;
|
||||
};
|
||||
using CommandArray = std::array<Command, 103>;
|
||||
using CommandArray = std::array<Command, 104>;
|
||||
static CommandArray commands;
|
||||
|
||||
struct Trap
|
||||
@ -234,6 +234,7 @@ class DebuggerParser
|
||||
void executeScanLine();
|
||||
void executeStep();
|
||||
void executeStepWhile();
|
||||
void executeSwchb();
|
||||
void executeTia();
|
||||
void executeTrace();
|
||||
void executeTrap();
|
||||
|
@ -257,6 +257,16 @@ int RiotDebug::timReadCycles() const
|
||||
return mySystem.m6532().myTimReadCycles;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool RiotDebug::switches(int newVal)
|
||||
{
|
||||
uInt8& switches = myConsole.switches().mySwitches;
|
||||
if(newVal > -1)
|
||||
switches = newVal;
|
||||
|
||||
return switches;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool RiotDebug::diffP0(int newVal)
|
||||
{
|
||||
|
@ -89,6 +89,7 @@ class RiotDebug : public DebuggerSystem
|
||||
int intimAsInt() const { return static_cast<int>(intim()); } // so we can use _inTim pseudo-register
|
||||
|
||||
/* Console switches */
|
||||
bool switches(int newVal = -1);
|
||||
bool diffP0(int newVal = -1);
|
||||
bool diffP1(int newVal = -1);
|
||||
bool tvType(int newVal = -1);
|
||||
|
Loading…
Reference in New Issue
Block a user