mirror of https://github.com/stella-emu/stella.git
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:
parent
6f366846fe
commit
12e727ae4e
|
@ -164,6 +164,7 @@ class Debugger : public DialogContainer
|
|||
PackedBitArray& writetraps() const { return *myWriteTraps; }
|
||||
PromptWidget& prompt() const { return myDialog->prompt(); }
|
||||
RomWidget& rom() const { return myDialog->rom(); }
|
||||
TiaOutputWidget& tiaOutput() const { return myDialog->tiaOutput(); }
|
||||
|
||||
/**
|
||||
Run the debugger command and return the result.
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "CpuDebug.hxx"
|
||||
#include "RiotDebug.hxx"
|
||||
#include "TIADebug.hxx"
|
||||
#include "TiaOutputWidget.hxx"
|
||||
#include "DebuggerParser.hxx"
|
||||
#include "YaccParser.hxx"
|
||||
#include "M6502.hxx"
|
||||
|
@ -1432,12 +1433,7 @@ void DebuggerParser::executeSaveses()
|
|||
// "savesnap"
|
||||
void DebuggerParser::executeSavesnap()
|
||||
{
|
||||
// FIXME - for now, temporarily enable 1x snapshot mode, and reset it
|
||||
// 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);
|
||||
debugger.tiaOutput().saveSnapshot();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -66,6 +66,27 @@ void TiaOutputWidget::loadConfig()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
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);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
Loading…
Reference in New Issue