CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Core/Dialog/PSPSaveDialog.h
Views: 1401
// Copyright (c) 2012- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include <thread>20#include <mutex>2122#include "Core/Dialog/PSPDialog.h"23#include "Core/Dialog/SavedataParam.h"2425#define SCE_UTILITY_SAVEDATA_ERROR_TYPE (0x80110300)2627#define SCE_UTILITY_SAVEDATA_ERROR_LOAD_NO_MS (0x80110301)28#define SCE_UTILITY_SAVEDATA_ERROR_LOAD_EJECT_MS (0x80110302)29#define SCE_UTILITY_SAVEDATA_ERROR_LOAD_ACCESS_ERROR (0x80110305)30#define SCE_UTILITY_SAVEDATA_ERROR_LOAD_DATA_BROKEN (0x80110306)31#define SCE_UTILITY_SAVEDATA_ERROR_LOAD_NO_DATA (0x80110307)32#define SCE_UTILITY_SAVEDATA_ERROR_LOAD_PARAM (0x80110308)33#define SCE_UTILITY_SAVEDATA_ERROR_LOAD_FILE_NOT_FOUND (0x80110309)34#define SCE_UTILITY_SAVEDATA_ERROR_LOAD_INTERNAL (0x8011030b)3536#define SCE_UTILITY_SAVEDATA_ERROR_RW_NO_MEMSTICK (0x80110321)37#define SCE_UTILITY_SAVEDATA_ERROR_RW_MEMSTICK_FULL (0x80110323)38#define SCE_UTILITY_SAVEDATA_ERROR_RW_DATA_BROKEN (0x80110326)39#define SCE_UTILITY_SAVEDATA_ERROR_RW_NO_DATA (0x80110327)40#define SCE_UTILITY_SAVEDATA_ERROR_RW_BAD_PARAMS (0x80110328)41#define SCE_UTILITY_SAVEDATA_ERROR_RW_FILE_NOT_FOUND (0x80110329)42#define SCE_UTILITY_SAVEDATA_ERROR_RW_BAD_STATUS (0x8011032c)4344#define SCE_UTILITY_SAVEDATA_ERROR_SAVE_NO_MS (0x80110381)45#define SCE_UTILITY_SAVEDATA_ERROR_SAVE_EJECT_MS (0x80110382)46#define SCE_UTILITY_SAVEDATA_ERROR_SAVE_MS_NOSPACE (0x80110383)47#define SCE_UTILITY_SAVEDATA_ERROR_SAVE_MS_PROTECTED (0x80110384)48#define SCE_UTILITY_SAVEDATA_ERROR_SAVE_ACCESS_ERROR (0x80110385)49#define SCE_UTILITY_SAVEDATA_ERROR_SAVE_PARAM (0x80110388)50#define SCE_UTILITY_SAVEDATA_ERROR_SAVE_NO_UMD (0x80110389)51#define SCE_UTILITY_SAVEDATA_ERROR_SAVE_WRONG_UMD (0x8011038a)52#define SCE_UTILITY_SAVEDATA_ERROR_SAVE_INTERNAL (0x8011038b)5354#define SCE_UTILITY_SAVEDATA_ERROR_DELETE_NO_MS (0x80110341)55#define SCE_UTILITY_SAVEDATA_ERROR_DELETE_EJECT_MS (0x80110342)56#define SCE_UTILITY_SAVEDATA_ERROR_DELETE_MS_PROTECTED (0x80110344)57#define SCE_UTILITY_SAVEDATA_ERROR_DELETE_ACCESS_ERROR (0x80110345)58#define SCE_UTILITY_SAVEDATA_ERROR_DELETE_NO_DATA (0x80110347)59#define SCE_UTILITY_SAVEDATA_ERROR_DELETE_PARAM (0x80110348)60#define SCE_UTILITY_SAVEDATA_ERROR_DELETE_INTERNAL (0x8011034b)6162#define SCE_UTILITY_SAVEDATA_ERROR_SIZES_NO_MS (0x801103C1)63#define SCE_UTILITY_SAVEDATA_ERROR_SIZES_EJECT_MS (0x801103C2)64#define SCE_UTILITY_SAVEDATA_ERROR_SIZES_ACCESS_ERROR (0x801103C5)65#define SCE_UTILITY_SAVEDATA_ERROR_SIZES_NO_DATA (0x801103C7)66#define SCE_UTILITY_SAVEDATA_ERROR_SIZES_PARAM (0x801103C8)67#define SCE_UTILITY_SAVEDATA_ERROR_SIZES_NO_UMD (0x801103C9)68#define SCE_UTILITY_SAVEDATA_ERROR_SIZES_WRONG_UMD (0x801103Ca)69#define SCE_UTILITY_SAVEDATA_ERROR_SIZES_INTERNAL (0x801103Cb)7071class PSPSaveDialog: public PSPDialog {72public:73PSPSaveDialog(UtilityDialogType type);74~PSPSaveDialog();7576int Init(int paramAddr);77int Update(int animSpeed) override;78int Shutdown(bool force = false) override;79void DoState(PointerWrap &p) override;80pspUtilityDialogCommon *GetCommonParam() override;8182void ExecuteIOAction();8384protected:85bool UseAutoStatus() override {86return false;87}8889private:9091void DisplayBanner(int which);92void DisplaySaveList(bool canMove = true);93void DisplaySaveIcon(bool checkExists);94void DisplaySaveDataInfo1();95void DisplaySaveDataInfo2(bool showNewData = false);96void DisplayMessage(std::string_view text, bool hasYesNo = false);97std::string GetSelectedSaveDirName() const;9899void JoinIOThread();100void StartIOThread();101void ExecuteNotVisibleIOAction();102103enum DisplayState104{105DS_NONE,106107DS_SAVE_LIST_CHOICE,108DS_SAVE_CONFIRM,109DS_SAVE_CONFIRM_OVERWRITE,110DS_SAVE_SAVING,111DS_SAVE_DONE,112113DS_LOAD_LIST_CHOICE,114DS_LOAD_CONFIRM,115DS_LOAD_LOADING,116DS_LOAD_DONE,117DS_LOAD_NODATA,118119DS_DELETE_LIST_CHOICE,120DS_DELETE_CONFIRM,121DS_DELETE_DELETING,122DS_DELETE_DONE,123DS_DELETE_NODATA,124125DS_SAVE_FAILED,126DS_LOAD_FAILED,127DS_DELETE_FAILED,128};129130enum DialogBanner131{132DB_NONE,133DB_SAVE,134DB_LOAD,135DB_DELETE136};137138DisplayState display = DS_NONE;139140SavedataParam param;141SceUtilitySavedataParam request{};142// For detecting changes made by the game.143SceUtilitySavedataParam originalRequest{};144u32 requestAddr = 0;145int currentSelectedSave = 0;146147int yesnoChoice = 0;148149enum SaveIOStatus150{151SAVEIO_NONE,152SAVEIO_PENDING,153SAVEIO_DONE,154};155156std::thread *ioThread = nullptr;157std::mutex paramLock;158volatile SaveIOStatus ioThreadStatus;159};160161162163