From 5a4c05607ddec093000d8249780a3d2e799435d7 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Wed, 16 Jun 2021 03:22:49 +0200 Subject: [PATCH] sstate: make use of mtgs to ensure thread safety when saving --- pcsx2/gui/SysState.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pcsx2/gui/SysState.cpp b/pcsx2/gui/SysState.cpp index dbcd5f1989..6a86d0932f 100644 --- a/pcsx2/gui/SysState.cpp +++ b/pcsx2/gui/SysState.cpp @@ -51,10 +51,17 @@ struct SysState_Component int (*freeze)(int, freezeData*); }; +int SysState_MTGSFreeze(int mode, freezeData* fP) +{ + MTGS_FreezeData sstate = {fP, 0}; + GetMTGS().Freeze(mode, sstate); + return sstate.retval; +} + static constexpr SysState_Component SPU2{"SPU2", SPU2freeze}; static constexpr SysState_Component PAD{"PAD", PADfreeze}; static constexpr SysState_Component USB{"USB", USBfreeze}; -static constexpr SysState_Component GS{"GS", GSfreeze}; +static constexpr SysState_Component GS{"GS", SysState_MTGSFreeze}; void SysState_ComponentFreezeOutRoot(void* dest, SysState_Component comp)