Utility: Report YugiohSaveFix usage.

This commit is contained in:
Unknown W. Brackets 2022-12-19 07:56:23 -08:00
parent 9f552b9003
commit ef04c4f55c
2 changed files with 11 additions and 2 deletions

View file

@ -63,10 +63,14 @@ public:
bool operator < (const int &v) const { return ver_ < v; } bool operator < (const int &v) const { return ver_ < v; }
bool operator > (const int &v) const { return ver_ > v; } bool operator > (const int &v) const { return ver_ > v; }
operator bool() const { operator bool() const {
return ver_ > 0; return ver_ > 0;
} }
int Version() const {
return ver_;
}
private: private:
PointerWrap &p_; PointerWrap &p_;
int ver_; int ver_;

View file

@ -147,6 +147,7 @@ static int volatileUnlockEvent = -1;
static HLEHelperThread *accessThread = nullptr; static HLEHelperThread *accessThread = nullptr;
static bool accessThreadFinished = true; static bool accessThreadFinished = true;
static const char *accessThreadState = "initial"; static const char *accessThreadState = "initial";
static int lastSaveStateVersion = -1;
static void CleanupDialogThreads(bool force = false) { static void CleanupDialogThreads(bool force = false) {
if (accessThread) { if (accessThread) {
@ -280,6 +281,9 @@ void __UtilityDoState(PointerWrap &p) {
if (s >= 6) { if (s >= 6) {
npSigninDialog->DoState(p); npSigninDialog->DoState(p);
lastSaveStateVersion = -1;
} else {
lastSaveStateVersion = s.Version();
} }
if (!hasAccessThread && accessThread) { if (!hasAccessThread && accessThread) {
@ -305,6 +309,7 @@ void __UtilityShutdown() {
accessThreadState = "shutdown"; accessThreadState = "shutdown";
} }
accessThreadFinished = true; accessThreadFinished = true;
lastSaveStateVersion = -1;
delete saveDialog; delete saveDialog;
delete msgDialog; delete msgDialog;
@ -411,7 +416,7 @@ static int UtilityFinishDialog(int type) {
static int sceUtilitySavedataInitStart(u32 paramAddr) { static int sceUtilitySavedataInitStart(u32 paramAddr) {
if (currentDialogActive && currentDialogType != UtilityDialogType::SAVEDATA) { if (currentDialogActive && currentDialogType != UtilityDialogType::SAVEDATA) {
if (PSP_CoreParameter().compat.flags().YugiohSaveFix) { if (PSP_CoreParameter().compat.flags().YugiohSaveFix) {
WARN_LOG(SCEUTILITY, "Yugioh Savedata Correction"); WARN_LOG_REPORT(SCEUTILITY, "Yugioh Savedata Correction (state=%d)", lastSaveStateVersion);
if (accessThread) { if (accessThread) {
accessThread->Terminate(); accessThread->Terminate();
delete accessThread; delete accessThread;