mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add cli support for savestates to NativeApp().
This commit is contained in:
parent
d0ecaa10a7
commit
8cecdbe1dc
1 changed files with 7 additions and 1 deletions
|
@ -45,6 +45,7 @@
|
|||
#include "../../Core/Config.h"
|
||||
#include "../../Core/HLE/sceCtrl.h"
|
||||
#include "../../Core/Host.h"
|
||||
#include "../../Core/SaveState.h"
|
||||
#include "../../Common/MemArena.h"
|
||||
|
||||
#include "ui_atlas.h"
|
||||
|
@ -201,8 +202,8 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co
|
|||
config_filename = user_data_path + "/ppsspp.ini";
|
||||
g_Config.Load(config_filename.c_str());
|
||||
|
||||
|
||||
const char *fileToLog = 0;
|
||||
const char *stateToLoad = 0;
|
||||
|
||||
bool gfxLog = false;
|
||||
// Parse command line
|
||||
|
@ -229,6 +230,8 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co
|
|||
case '-':
|
||||
if (!strncmp(argv[i], "--log=", strlen("--log=")) && strlen(argv[i]) > strlen("--log="))
|
||||
fileToLog = argv[i] + strlen("--log=");
|
||||
if (!strncmp(__argv[i], "--state=", strlen("--state=")) && strlen(__argv[i]) > strlen("--state="))
|
||||
stateToLoad = __argv[i] + strlen("--state=");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -299,6 +302,9 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co
|
|||
logman->SetLogLevel(LogTypes::G3D, LogTypes::LERROR);
|
||||
INFO_LOG(BOOT, "Logger inited.");
|
||||
#endif
|
||||
|
||||
if (!boot_filename.empty() && stateToLoad != NULL)
|
||||
SaveState::Load(stateToLoad);
|
||||
}
|
||||
|
||||
void NativeInitGraphics()
|
||||
|
|
Loading…
Add table
Reference in a new issue