mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 07:20:49 +00:00
Keep track of whether a savestate has been used.
Mostly to improve info we get in reporting.
This commit is contained in:
parent
274160bc22
commit
a8b55c3e10
@ -20,6 +20,7 @@
|
|||||||
#include "Common/CPUDetect.h"
|
#include "Common/CPUDetect.h"
|
||||||
#include "Core/CoreTiming.h"
|
#include "Core/CoreTiming.h"
|
||||||
#include "Core/Config.h"
|
#include "Core/Config.h"
|
||||||
|
#include "Core/SaveState.h"
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "Core/HLE/sceDisplay.h"
|
#include "Core/HLE/sceDisplay.h"
|
||||||
#include "Core/HLE/sceKernelMemory.h"
|
#include "Core/HLE/sceKernelMemory.h"
|
||||||
@ -219,7 +220,8 @@ namespace Reporting
|
|||||||
postdata.Add("fps", fps);
|
postdata.Add("fps", fps);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Settings, savestate/savedata status, some measure of speed/fps?
|
// TODO: Settings?
|
||||||
|
postdata.Add("savestate_used", SaveState::HasLoadedState());
|
||||||
|
|
||||||
switch (payload.type)
|
switch (payload.type)
|
||||||
{
|
{
|
||||||
|
@ -203,6 +203,7 @@ namespace SaveState
|
|||||||
static bool needsProcess = false;
|
static bool needsProcess = false;
|
||||||
static std::vector<Operation> pending;
|
static std::vector<Operation> pending;
|
||||||
static std::recursive_mutex mutex;
|
static std::recursive_mutex mutex;
|
||||||
|
static bool hasLoadedState = false;
|
||||||
|
|
||||||
// TODO: Should this be configurable?
|
// TODO: Should this be configurable?
|
||||||
static const int REWIND_NUM_STATES = 20;
|
static const int REWIND_NUM_STATES = 20;
|
||||||
@ -430,6 +431,11 @@ namespace SaveState
|
|||||||
rewindStates.Save();
|
rewindStates.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasLoadedState()
|
||||||
|
{
|
||||||
|
return hasLoadedState;
|
||||||
|
}
|
||||||
|
|
||||||
void Process()
|
void Process()
|
||||||
{
|
{
|
||||||
#ifndef MOBILE_DEVICE
|
#ifndef MOBILE_DEVICE
|
||||||
@ -474,6 +480,7 @@ namespace SaveState
|
|||||||
if (result == CChunkFileReader::ERROR_NONE) {
|
if (result == CChunkFileReader::ERROR_NONE) {
|
||||||
osm.Show(s->T("Loaded State"), 2.0);
|
osm.Show(s->T("Loaded State"), 2.0);
|
||||||
callbackResult = true;
|
callbackResult = true;
|
||||||
|
hasLoadedState = true;
|
||||||
} else if (result == CChunkFileReader::ERROR_BROKEN_STATE) {
|
} else if (result == CChunkFileReader::ERROR_BROKEN_STATE) {
|
||||||
HandleFailure();
|
HandleFailure();
|
||||||
osm.Show(i18nLoadFailure, 2.0);
|
osm.Show(i18nLoadFailure, 2.0);
|
||||||
@ -513,12 +520,14 @@ namespace SaveState
|
|||||||
if (result == CChunkFileReader::ERROR_NONE) {
|
if (result == CChunkFileReader::ERROR_NONE) {
|
||||||
osm.Show(s->T("Loaded State"), 2.0);
|
osm.Show(s->T("Loaded State"), 2.0);
|
||||||
callbackResult = true;
|
callbackResult = true;
|
||||||
|
hasLoadedState = true;
|
||||||
} else if (result == CChunkFileReader::ERROR_BROKEN_STATE) {
|
} else if (result == CChunkFileReader::ERROR_BROKEN_STATE) {
|
||||||
// Cripes. Good news is, we might have more. Let's try those too, better than a reset.
|
// Cripes. Good news is, we might have more. Let's try those too, better than a reset.
|
||||||
if (HandleFailure()) {
|
if (HandleFailure()) {
|
||||||
// Well, we did rewind, even if too much...
|
// Well, we did rewind, even if too much...
|
||||||
osm.Show(s->T("Loaded State"), 2.0);
|
osm.Show(s->T("Loaded State"), 2.0);
|
||||||
callbackResult = true;
|
callbackResult = true;
|
||||||
|
hasLoadedState = true;
|
||||||
} else {
|
} else {
|
||||||
osm.Show(i18nLoadFailure, 2.0);
|
osm.Show(i18nLoadFailure, 2.0);
|
||||||
callbackResult = false;
|
callbackResult = false;
|
||||||
@ -547,5 +556,7 @@ namespace SaveState
|
|||||||
|
|
||||||
std::lock_guard<std::recursive_mutex> guard(mutex);
|
std::lock_guard<std::recursive_mutex> guard(mutex);
|
||||||
rewindStates.Clear();
|
rewindStates.Clear();
|
||||||
|
|
||||||
|
hasLoadedState = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,9 @@ namespace SaveState
|
|||||||
// Returns true if there are rewind snapshots available.
|
// Returns true if there are rewind snapshots available.
|
||||||
bool CanRewind();
|
bool CanRewind();
|
||||||
|
|
||||||
|
// Returns true if a savestate has been used during this session.
|
||||||
|
bool HasLoadedState();
|
||||||
|
|
||||||
// Check if there's any save stating needing to be done. Normally called once per frame.
|
// Check if there's any save stating needing to be done. Normally called once per frame.
|
||||||
void Process();
|
void Process();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user