diff --git a/common/include/PS2Edefs.h b/common/include/PS2Edefs.h index 949b9cd77e..f5e1c0cb27 100644 --- a/common/include/PS2Edefs.h +++ b/common/include/PS2Edefs.h @@ -167,7 +167,6 @@ typedef void(CALLBACK *_GSosdMonitor)(const char *key, const char *value, u32 co typedef s32(CALLBACK *_GSopen)(void *pDsp, const char *Title, int multithread); typedef s32(CALLBACK *_GSopen2)(void *pDsp, u32 flags); typedef void(CALLBACK *_GSvsync)(int field); -typedef s32(CALLBACK* _GSfreeze)(int mode, freezeData* data); typedef void(CALLBACK *_GSgifTransfer)(const u32 *pMem, u32 size); typedef void(CALLBACK *_GSgifTransfer1)(u32 *pMem, u32 addr); typedef void(CALLBACK *_GSgifTransfer2)(u32 *pMem, u32 size); @@ -203,7 +202,6 @@ extern _GSosdLog GSosdLog; extern _GSosdMonitor GSosdMonitor; extern _GSopen GSopen; extern _GSopen2 GSopen2; -extern _GSfreeze GSfreeze; extern _GSvsync GSvsync; extern _GSgifTransfer GSgifTransfer; extern _GSgifTransfer1 GSgifTransfer1; diff --git a/pcsx2/PluginManager.cpp b/pcsx2/PluginManager.cpp index 65c39f5927..565bd8b9fc 100644 --- a/pcsx2/PluginManager.cpp +++ b/pcsx2/PluginManager.cpp @@ -157,7 +157,6 @@ _GSosdLog GSosdLog; _GSosdMonitor GSosdMonitor; _GSopen GSopen; _GSopen2 GSopen2; -_GSfreeze GSfreeze; _GSgifTransfer GSgifTransfer; _GSgifTransfer1 GSgifTransfer1; _GSgifTransfer2 GSgifTransfer2; @@ -1042,9 +1041,9 @@ bool SysCorePlugins::Shutdown() // For internal use only, unless you're the MTGS. Then it's for you too! // Returns false if the plugin returned an error. -bool SysCorePlugins::DoFreeze( PluginsEnum_t pid, int mode, freezeData* data ) +bool SysCorePlugins::DoFreeze( PluginsEnum_t pid, int mode, freezeData* data, bool bypass_tsafety ) { - if( (pid == PluginId_GS) && !GetMTGS().IsSelf() ) + if( (pid == PluginId_GS) && !GetMTGS().IsSelf() && !bypass_tsafety ) { // GS needs some thread safety love... diff --git a/pcsx2/Plugins.h b/pcsx2/Plugins.h index 87f2f9094b..b761afc2c0 100644 --- a/pcsx2/Plugins.h +++ b/pcsx2/Plugins.h @@ -379,7 +379,7 @@ public: virtual void FreezeOut( PluginsEnum_t pid, pxOutputStream& outfp ); virtual void FreezeIn( PluginsEnum_t pid, pxInputStream& infp ); virtual void Freeze( PluginsEnum_t pid, SaveStateBase& state ); - virtual bool DoFreeze( PluginsEnum_t pid, int mode, freezeData* data ); + virtual bool DoFreeze( PluginsEnum_t pid, int mode, freezeData* data, bool bypass_tsafety=false ); virtual bool KeyEvent( const keyEvent& evt ); virtual void Configure( PluginsEnum_t pid ); diff --git a/pcsx2/gui/Dialogs/GSDumpDialog.cpp b/pcsx2/gui/Dialogs/GSDumpDialog.cpp index a1b5ba0921..83f1021df6 100644 --- a/pcsx2/gui/Dialogs/GSDumpDialog.cpp +++ b/pcsx2/gui/Dialogs/GSDumpDialog.cpp @@ -666,7 +666,7 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() dump_file.Read(®s, 8192); int ssi = ss; - freezeData fd = {0, (s8*)state_data}; + freezeData fd = {ss, (s8*)state_data}; m_root_window->m_dump_packets.clear(); while (dump_file.Tell() < dump_file.Length()) @@ -727,15 +727,12 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() GSsetGameCRC((int)crc, 0); - //OnStop(); - return; - - if (GSfreeze(0, &fd) == -1) + if (!GetCorePlugins().DoFreeze(PluginId_GS, 0, &fd, true)) m_running = false; GSvsync(1); GSreset(); GSsetBaseMem((void*)regs); - GSfreeze(0, &fd); + GetCorePlugins().DoFreeze(PluginId_GS, 0, &fd, true); size_t i = 0; int RunTo = 0; @@ -788,7 +785,7 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() } else { - while (i < m_root_window->m_dump_packets.size()) + while (i < (m_root_window->m_dump_packets.size()-1)) { m_root_window->ProcessDumpEvent(m_root_window->m_dump_packets[i++], regs);