Make it possible to load a savestate in headless.

This is primarily useful to reproduce crashes or test performance.
This commit is contained in:
Unknown W. Brackets 2014-03-25 00:46:21 -07:00
parent 2240cae3bf
commit 36c3a0dd68

View file

@ -13,6 +13,7 @@
#include "Core/System.h"
#include "Core/HLE/sceUtility.h"
#include "Core/Host.h"
#include "Core/SaveState.h"
#include "Log.h"
#include "LogManager.h"
#include "base/NativeApp.h"
@ -198,6 +199,7 @@ int main(int argc, const char* argv[])
bool useJit = true;
bool autoCompare = false;
bool verbose = false;
const char *stateToLoad = 0;
GPUCore gpuCore = GPU_NULL;
std::vector<std::string> testFilenames;
@ -252,6 +254,8 @@ int main(int argc, const char* argv[])
timeout = strtod(argv[i] + strlen("--timeout="), NULL);
else if (!strcmp(argv[i], "--teamcity"))
teamCityMode = true;
else if (!strncmp(argv[i], "--state=", strlen("--state=")) && strlen(argv[i]) > strlen("--state="))
stateToLoad = argv[i] + strlen("--state=");
else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h"))
{
printUsage(argv[0], NULL);
@ -345,6 +349,8 @@ int main(int argc, const char* argv[])
g_Config.iNumWorkerThreads = 1;
g_Config.iBGMVolume = MAX_CONFIG_VOLUME;
g_Config.iSFXVolume = MAX_CONFIG_VOLUME;
g_Config.bSoftwareSkinning = true;
g_Config.bVertexDecoderJit = true;
#ifdef _WIN32
InitSysDirectories();
@ -369,6 +375,9 @@ int main(int argc, const char* argv[])
if (screenshotFilename != 0)
headlessHost->SetComparisonScreenshot(screenshotFilename);
if (stateToLoad != NULL)
SaveState::Load(stateToLoad);
std::vector<std::string> failedTests;
std::vector<std::string> passedTests;
for (size_t i = 0; i < testFilenames.size(); ++i)