diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index debfc928bd..1e8a469a6d 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -18,8 +18,9 @@ #include "main.h" #include "../Core/Core.h" -#include "../Core/System.h" #include "../Core/MemMap.h" +#include "../Core/SaveState.h" +#include "../Core/System.h" #include "EmuThread.h" #include "resource.h" @@ -312,18 +313,18 @@ namespace MainWindow break; case ID_FILE_LOADSTATE: - if (W32Util::BrowseForFileName(true, hWnd, "Load state",0,"Save States (*.gcs)\0*.gcs\0All files\0*.*\0\0","gcs",fn)) + if (W32Util::BrowseForFileName(true, hWnd, "Load state",0,"Save States (*.ppssppst)\0*.ppssppst\0All files\0*.*\0\0","ppssppst",fn)) { SetCursor(LoadCursor(0,IDC_WAIT)); - SetCursor(LoadCursor(0,IDC_ARROW)); + SaveState::Load(fn, SaveStateActionFinished); } break; case ID_FILE_SAVESTATE: - if (W32Util::BrowseForFileName(false, hWnd, "Save state",0,"Save States (*.gcs)\0*.gcs\0All files\0*.*\0\0","gcs",fn)) + if (W32Util::BrowseForFileName(false, hWnd, "Save state",0,"Save States (*.ppssppst)\0*.ppssppst\0All files\0*.*\0\0","ppssppst",fn)) { SetCursor(LoadCursor(0,IDC_WAIT)); - SetCursor(LoadCursor(0,IDC_ARROW)); + SaveState::Save(fn, SaveStateActionFinished); } break; @@ -766,6 +767,14 @@ namespace MainWindow } } + void SaveStateActionFinished(bool result) + { + // TODO: Improve messaging? + if (!result) + MessageBox(0, "Savestate failure. Please try again later.", "Sorry", MB_OK); + SetCursor(LoadCursor(0, IDC_ARROW)); + } + void SetNextState(CoreState state) { nextState = state; diff --git a/Windows/WndMainWindow.h b/Windows/WndMainWindow.h index 7aaaaab423..b58823ca25 100644 --- a/Windows/WndMainWindow.h +++ b/Windows/WndMainWindow.h @@ -17,6 +17,7 @@ namespace MainWindow void SetPlaying(const char*text); void BrowseAndBoot(); void SetNextState(CoreState state); + void SaveStateActionFinished(bool result); void _ViewFullScreen(HWND hWnd); void _ViewNormal(HWND hWnd); } diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 3c69142866..e9561bdac4 100644 Binary files a/Windows/ppsspp.rc and b/Windows/ppsspp.rc differ