The 'savesnap' command in the debugger prompt now actually saves a

snapshot of the TIA image, including partial rendering (if applicable)
and scanline indicator.  Previously it only saved the TIA image, which
basically made it useless from the debugger POV.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2931 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-06-20 23:01:11 +00:00
parent 6f366846fe
commit 12e727ae4e
3 changed files with 32 additions and 14 deletions

View File

@ -156,14 +156,15 @@ class Debugger : public DialogContainer
*/ */
TIADebug& tiaDebug() const { return *myTiaDebug; } TIADebug& tiaDebug() const { return *myTiaDebug; }
const GUI::Font& lfont() const { return myDialog->lfont(); } const GUI::Font& lfont() const { return myDialog->lfont(); }
const GUI::Font& nlfont() const { return myDialog->nfont(); } const GUI::Font& nlfont() const { return myDialog->nfont(); }
DebuggerParser& parser() const { return *myParser; } DebuggerParser& parser() const { return *myParser; }
PackedBitArray& breakpoints() const { return *myBreakPoints; } PackedBitArray& breakpoints() const { return *myBreakPoints; }
PackedBitArray& readtraps() const { return *myReadTraps; } PackedBitArray& readtraps() const { return *myReadTraps; }
PackedBitArray& writetraps() const { return *myWriteTraps; } PackedBitArray& writetraps() const { return *myWriteTraps; }
PromptWidget& prompt() const { return myDialog->prompt(); } PromptWidget& prompt() const { return myDialog->prompt(); }
RomWidget& rom() const { return myDialog->rom(); } RomWidget& rom() const { return myDialog->rom(); }
TiaOutputWidget& tiaOutput() const { return myDialog->tiaOutput(); }
/** /**
Run the debugger command and return the result. Run the debugger command and return the result.

View File

@ -26,6 +26,7 @@
#include "CpuDebug.hxx" #include "CpuDebug.hxx"
#include "RiotDebug.hxx" #include "RiotDebug.hxx"
#include "TIADebug.hxx" #include "TIADebug.hxx"
#include "TiaOutputWidget.hxx"
#include "DebuggerParser.hxx" #include "DebuggerParser.hxx"
#include "YaccParser.hxx" #include "YaccParser.hxx"
#include "M6502.hxx" #include "M6502.hxx"
@ -1432,12 +1433,7 @@ void DebuggerParser::executeSaveses()
// "savesnap" // "savesnap"
void DebuggerParser::executeSavesnap() void DebuggerParser::executeSavesnap()
{ {
// FIXME - for now, temporarily enable 1x snapshot mode, and reset it debugger.tiaOutput().saveSnapshot();
// afterwards; this will change once we move to FBSurfaces
bool ss1x = settings.getBool("ss1x");
settings.setValue("ss1x", true);
debugger.myOSystem->eventHandler().takeSnapshot();
settings.setValue("ss1x", ss1x);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -66,6 +66,27 @@ void TiaOutputWidget::loadConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TiaOutputWidget::saveSnapshot() void TiaOutputWidget::saveSnapshot()
{ {
int number = instance().getTicks() / 1000;
ostringstream sspath;
sspath << instance().snapshotSaveDir()
<< instance().console().properties().get(Cartridge_Name)
<< "_dbg_" << hex << setw(8) << setfill('0') << number << ".png";
const uInt32 width = instance().console().tia().width(),
height = instance().console().tia().height();
FBSurface& s = dialog().surface();
GUI::Rect rect(_x, _y, _x + width*2, _y + height);
string message = "Snapshot saved";
try
{
instance().png().saveImage(sspath.str(), s, rect);
}
catch(const char* msg)
{
message = msg;
}
instance().frameBuffer().showMessage(message);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -