mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Don't allow reporting from bad savestates.
If the savestate was created with bad settings, or was loaded from an older version, it may be damaged. Let's not report old problems.
This commit is contained in:
parent
b894bd9b27
commit
5e57a2ffa8
3 changed files with 19 additions and 0 deletions
|
@ -261,6 +261,7 @@ void __KernelDoState(PointerWrap &p)
|
|||
|
||||
__InterruptsDoStateLate(p);
|
||||
__KernelThreadingDoStateLate(p);
|
||||
Reporting::DoState(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -214,6 +214,19 @@ namespace Reporting
|
|||
Init();
|
||||
}
|
||||
|
||||
void DoState(PointerWrap &p)
|
||||
{
|
||||
const int LATEST_VERSION = 1;
|
||||
auto s = p.Section("Reporting", 0, LATEST_VERSION);
|
||||
if (!s || s < LATEST_VERSION) {
|
||||
// Don't report from old savestates, they may "entomb" bugs.
|
||||
everUnsupported = true;
|
||||
return;
|
||||
}
|
||||
|
||||
p.Do(everUnsupported);
|
||||
}
|
||||
|
||||
void UpdateConfig()
|
||||
{
|
||||
currentSupported = IsSupported();
|
||||
|
|
|
@ -35,12 +35,17 @@
|
|||
#define NOTICE_LOG_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { NOTICE_LOG(t, __VA_ARGS__); } }
|
||||
#define INFO_LOG_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { INFO_LOG(t, __VA_ARGS__); } }
|
||||
|
||||
struct PointerWrap;
|
||||
|
||||
namespace Reporting
|
||||
{
|
||||
// Should be called whenever a new game is loaded/shutdown to forget things.
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
// Check savestate compatibility, mostly needed on load.
|
||||
void DoState(PointerWrap &p);
|
||||
|
||||
// Should be called whenever the game configuration changes.
|
||||
void UpdateConfig();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue