From 5ab97eb873688e2c01261854da575f0f076c5b4d Mon Sep 17 00:00:00 2001 From: Christian Kenny Date: Wed, 13 May 2020 13:30:50 -0400 Subject: [PATCH] Savestate: Remove unimplemented exceptions. --- pcsx2/SaveState.cpp | 38 ----------------------------- pcsx2/SaveState.h | 59 --------------------------------------------- 2 files changed, 97 deletions(-) diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 286eab9ebd..0d1467e09c 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -321,41 +321,3 @@ void memLoadingState::FreezeMem( void* data, int size ) m_idx += size; memcpy( data, src, size ); } - -// -------------------------------------------------------------------------------------- -// SaveState Exception Messages -// -------------------------------------------------------------------------------------- - -wxString Exception::UnsupportedStateVersion::FormatDiagnosticMessage() const -{ - // Note: no stacktrace needed for this one... - return pxsFmt( L"Unknown or unsupported savestate version: 0x%x", Version ); -} - -wxString Exception::UnsupportedStateVersion::FormatDisplayMessage() const -{ - // m_message_user contains a recoverable savestate error which is helpful to the user. - return - m_message_user + L"\n\n" + - pxsFmt( _("Cannot load savestate. It is of an unknown or unsupported version."), Version ); -} - -wxString Exception::StateCrcMismatch::FormatDiagnosticMessage() const -{ - // Note: no stacktrace needed for this one... - return pxsFmt( - L"Game/CDVD does not match the savestate CRC.\n" - L"\tCdvd CRC: 0x%X\n\tGame CRC: 0x%X\n", - Crc_Savestate, Crc_Cdvd - ); -} - -wxString Exception::StateCrcMismatch::FormatDisplayMessage() const -{ - return - m_message_user + L"\n\n" + - pxsFmt( - L"Savestate game/crc mismatch. Cdvd CRC: 0x%X Game CRC: 0x%X\n", - Crc_Savestate, Crc_Cdvd - ); -} diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index 40abba50f3..f7b978140c 100644 --- a/pcsx2/SaveState.h +++ b/pcsx2/SaveState.h @@ -30,65 +30,6 @@ static const u32 g_SaveVersion = (0x9A0E << 16) | 0x0000; // between the GS saving function and the MTGS's needs. :) extern s32 CALLBACK gsSafeFreeze( int mode, freezeData *data ); - -namespace Exception -{ - // --------------------------------------------------------------------------------------- - // Savestate Exceptions: - // UnsupportedStateVersion / StateCrcMismatch - // --------------------------------------------------------------------------------------- - - // thrown when the savestate being loaded isn't supported. - // - class UnsupportedStateVersion : public SaveStateLoadError - { - DEFINE_EXCEPTION_COPYTORS( UnsupportedStateVersion, SaveStateLoadError ) - DEFINE_EXCEPTION_MESSAGES( UnsupportedStateVersion ) - - public: - u32 Version; // version number of the unsupported state. - - protected: - UnsupportedStateVersion() {} - - public: - explicit UnsupportedStateVersion( int version ) - { - Version = version; - } - - virtual wxString FormatDiagnosticMessage() const; - virtual wxString FormatDisplayMessage() const; - }; - - // A recoverable exception thrown when the CRC of the savestate does not match the - // CRC returned by the Cdvd driver. - // [feature not implemented yet] - // - class StateCrcMismatch : public SaveStateLoadError - { - DEFINE_EXCEPTION_COPYTORS( StateCrcMismatch, SaveStateLoadError ) - DEFINE_EXCEPTION_MESSAGES( StateCrcMismatch ) - - public: - u32 Crc_Savestate; - u32 Crc_Cdvd; - - protected: - StateCrcMismatch() {} - - public: - StateCrcMismatch( u32 crc_save, u32 crc_cdvd ) - { - Crc_Savestate = crc_save; - Crc_Cdvd = crc_cdvd; - } - - virtual wxString FormatDiagnosticMessage() const; - virtual wxString FormatDisplayMessage() const; - }; -} - // -------------------------------------------------------------------------------------- // SaveStateBase class // --------------------------------------------------------------------------------------