Add Frame Dumping for Windows

This commit is contained in:
Chris Burgener committed 2016-09-02 12:52:52 -04:00
1 parent 2d838f7f33
commit 1fc6191c85
13 files changed
+446 -25

No files matched your search

+25
View File
@@ -32,6 +32,7 @@
#include "Common/KeyMap.h"
#include "Core/AVIDump.h"
#include "Core/Config.h"
#include "Core/CoreTiming.h"
#include "Core/CoreParameter.h"
@@ -70,8 +71,11 @@
#include "Windows/MainWindow.h"
#endif
AVIDump avi;
static bool frameStep_;
static int lastNumFlips;
static bool startDumping;
static void __EmuScreenVblank()
{
@@ -81,6 +85,21 @@ static void __EmuScreenVblank()
Core_EnableStepping(true);
lastNumFlips = gpuStats.numFlips;
}
if (g_Config.bDumpFrames && !startDumping)
{
avi.Start(PSP_CoreParameter().renderWidth, PSP_CoreParameter().renderHeight);
startDumping = true;
}
if (g_Config.bDumpFrames && startDumping)
{
avi.AddFrame();
}
else if (!g_Config.bDumpFrames && startDumping)
{
avi.Stop();
startDumping = false;
}
}
EmuScreen::EmuScreen(const std::string &filename)
@@ -90,6 +109,7 @@ EmuScreen::EmuScreen(const std::string &filename)
__DisplayListenVblank(__EmuScreenVblank);
frameStep_ = false;
lastNumFlips = gpuStats.numFlips;
startDumping = false;
}
void EmuScreen::bootGame(const std::string &filename) {
@@ -227,6 +247,11 @@ EmuScreen::~EmuScreen() {
// If we were invalid, it would already be shutdown.
PSP_Shutdown();
}
if (g_Config.bDumpFrames && startDumping)
{
avi.Stop();
startDumping = false;
}
}
void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) {