diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 91b6193592..909048b73a 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -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()