mirror of https://github.com/stella-emu/stella.git
fixed timer saving (fixes #1077)
This commit is contained in:
parent
0a2d94ec1d
commit
a1e7323abb
|
@ -653,6 +653,48 @@ void DebuggerParser::printTimer(uInt32 idx, bool showHeader)
|
|||
}
|
||||
}
|
||||
|
||||
string DebuggerParser::getTimerCmds()
|
||||
{
|
||||
ostringstream out;
|
||||
|
||||
for(uInt32 idx = 0; idx < debugger.m6502().numTimers(); ++idx)
|
||||
{
|
||||
const TimerMap::Timer& timer = debugger.m6502().getTimer(idx);
|
||||
const bool banked = debugger.cartDebug().romBankCount() > 1;
|
||||
ostringstream fromBuf;
|
||||
|
||||
if(!debugger.cartDebug().getLabel(fromBuf, timer.from.addr, true))
|
||||
fromBuf << Base::HEX4 << timer.from.addr;
|
||||
fromBuf << (timer.mirrors ? "+" : "");
|
||||
|
||||
out << "timer " << fromBuf.str();
|
||||
|
||||
if(banked) {
|
||||
if(timer.anyBank)
|
||||
fromBuf << "*";
|
||||
else
|
||||
fromBuf << dec << static_cast<uInt16>(timer.from.bank);
|
||||
}
|
||||
if(!timer.isPartial) {
|
||||
ostringstream toBuf;
|
||||
|
||||
if(!debugger.cartDebug().getLabel(toBuf, timer.to.addr, true))
|
||||
toBuf << Base::HEX4 << timer.to.addr;
|
||||
toBuf << (timer.mirrors ? "+" : "");
|
||||
|
||||
if(banked) {
|
||||
if(timer.anyBank)
|
||||
toBuf << "*";
|
||||
else
|
||||
toBuf << dec << static_cast<uInt16>(timer.to.bank);
|
||||
}
|
||||
out << " " << toBuf.str();
|
||||
}
|
||||
out << "\n";
|
||||
} // for
|
||||
return out.str();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DebuggerParser::listTimers()
|
||||
{
|
||||
|
@ -768,6 +810,8 @@ string DebuggerParser::saveScriptFile(string file)
|
|||
out << '\n';
|
||||
}
|
||||
|
||||
out << getTimerCmds();
|
||||
|
||||
// Append 'script' extension when necessary
|
||||
if(file.find_last_of('.') == string::npos)
|
||||
file += ".script";
|
||||
|
|
|
@ -146,6 +146,7 @@ class DebuggerParser
|
|||
|
||||
void printTimer(uInt32 idx,bool showHeader = true);
|
||||
void listTimers();
|
||||
string getTimerCmds();
|
||||
|
||||
// output the error with the example provided for the command
|
||||
void outputCommandError(string_view errorMsg, int command);
|
||||
|
|
Loading…
Reference in New Issue