diff --git a/pcsx2/GS.cpp b/pcsx2/GS.cpp index caab63a926..8bc57a5064 100644 --- a/pcsx2/GS.cpp +++ b/pcsx2/GS.cpp @@ -38,7 +38,7 @@ void gsSetVideoMode(GS_VideoMode mode) // Make sure framelimiter options are in sync with GS capabilities. void gsReset() { - GetMTGS().ResetGS(); + GetMTGS().ResetGS(true); UpdateVSyncRate(); memzero(g_RealGSMem); diff --git a/pcsx2/GS.h b/pcsx2/GS.h index f9d52627b0..403c289751 100644 --- a/pcsx2/GS.h +++ b/pcsx2/GS.h @@ -380,7 +380,7 @@ public: // Waits for the GS to empty out the entire ring buffer contents. void WaitGS(bool syncRegs=true, bool weakWait=false, bool isMTVU=false); - void ResetGS(); + void ResetGS(bool hardware_reset); void PrepDataPacket( MTGS_RingCommand cmd, u32 size ); void PrepDataPacket( GIF_PATH pathidx, u32 size ); diff --git a/pcsx2/GS/GS.cpp b/pcsx2/GS/GS.cpp index 2f9130d901..310cd8b3b5 100644 --- a/pcsx2/GS/GS.cpp +++ b/pcsx2/GS/GS.cpp @@ -373,11 +373,11 @@ bool GSopen(const Pcsx2Config::GSOptions& config, GSRendererType renderer, u8* b return true; } -void GSreset() +void GSreset(bool hardware_reset) { try { - g_gs_renderer->Reset(); + g_gs_renderer->Reset(hardware_reset); } catch (GSRecoverableError) { diff --git a/pcsx2/GS/GS.h b/pcsx2/GS/GS.h index 93534978db..48c2996181 100644 --- a/pcsx2/GS/GS.h +++ b/pcsx2/GS/GS.h @@ -57,7 +57,7 @@ void GSinitConfig(); void GSshutdown(); bool GSopen(const Pcsx2Config::GSOptions& config, GSRendererType renderer, u8* basemem); bool GSreopen(bool recreate_display); -void GSreset(); +void GSreset(bool hardware_reset); void GSclose(); void GSgifSoftReset(u32 mask); void GSwriteCSR(u32 csr); diff --git a/pcsx2/GS/GSState.cpp b/pcsx2/GS/GSState.cpp index 0dfe7fc856..ee21e9d35b 100644 --- a/pcsx2/GS/GSState.cpp +++ b/pcsx2/GS/GSState.cpp @@ -137,7 +137,7 @@ GSState::GSState() m_env.PRMODECONT.AC = 1; m_last_prim.U32[0] = PRIM->U32[0]; - Reset(); + Reset(false); ResetHandlers(); } @@ -178,10 +178,11 @@ void GSState::SetFrameSkip(int skip) } } -void GSState::Reset() +void GSState::Reset(bool hardware_reset) { // FIXME: bios logo not shown cut in half after reset, missing graphics in GoW after first FMV - // memset(m_mem.m_vm8, 0, m_mem.m_vmsize); + if (hardware_reset) + memset(m_mem.m_vm8, 0, m_mem.m_vmsize); memset(&m_path, 0, sizeof(m_path)); memset(&m_v, 0, sizeof(m_v)); @@ -2396,7 +2397,7 @@ int GSState::Defrost(const freezeData* fd) Flush(); - Reset(); + Reset(false); ReadState(&m_env.PRIM, data); diff --git a/pcsx2/GS/GSState.h b/pcsx2/GS/GSState.h index ffd54a8f2c..aef7b79632 100644 --- a/pcsx2/GS/GSState.h +++ b/pcsx2/GS/GSState.h @@ -302,7 +302,7 @@ public: float GetTvRefreshRate(); - virtual void Reset(); + virtual void Reset(bool hardware_reset); virtual void UpdateSettings(const Pcsx2Config::GSOptions& old_config); void Flush(); diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index c69f3fa331..f8f506fcb4 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -202,14 +202,14 @@ int GSRendererHW::GetUpscaleMultiplier() return GSConfig.UpscaleMultiplier; } -void GSRendererHW::Reset() +void GSRendererHW::Reset(bool hardware_reset) { // TODO: GSreset can come from the main thread too => crash // m_tc->RemoveAll(); m_reset = true; - GSRenderer::Reset(); + GSRenderer::Reset(hardware_reset); } void GSRendererHW::UpdateSettings(const Pcsx2Config::GSOptions& old_config) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.h b/pcsx2/GS/Renderers/HW/GSRendererHW.h index 25044956c4..4e6bd247a0 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.h +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.h @@ -183,7 +183,7 @@ public: GSVector2 GetTextureScaleFactor() override; GSVector2i GetTargetSize(); - void Reset() override; + void Reset(bool hardware_reset) override; void UpdateSettings(const Pcsx2Config::GSOptions& old_config) override; void VSync(u32 field, bool registers_written) override; diff --git a/pcsx2/GS/Renderers/SW/GSRendererSW.cpp b/pcsx2/GS/Renderers/SW/GSRendererSW.cpp index 9b08a5d9c4..9c7d98a4bc 100644 --- a/pcsx2/GS/Renderers/SW/GSRendererSW.cpp +++ b/pcsx2/GS/Renderers/SW/GSRendererSW.cpp @@ -66,13 +66,13 @@ GSRendererSW::~GSRendererSW() GSRendererSW::Destroy(); } -void GSRendererSW::Reset() +void GSRendererSW::Reset(bool hardware_reset) { Sync(-1); m_tc->RemoveAll(); - GSRenderer::Reset(); + GSRenderer::Reset(hardware_reset); } void GSRendererSW::Destroy() diff --git a/pcsx2/GS/Renderers/SW/GSRendererSW.h b/pcsx2/GS/Renderers/SW/GSRendererSW.h index a826d78d2d..a5ff728910 100644 --- a/pcsx2/GS/Renderers/SW/GSRendererSW.h +++ b/pcsx2/GS/Renderers/SW/GSRendererSW.h @@ -78,7 +78,7 @@ protected: std::atomic m_fzb_pages[512]; // u16 frame/zbuf pages interleaved std::atomic m_tex_pages[512]; - void Reset() override; + void Reset(bool hardware_reset) override; void VSync(u32 field, bool registers_written) override; GSTexture* GetOutput(int i, int& y_offset) override; GSTexture* GetFeedbackOutput() override; diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 2ec51dc1fb..243546ff0a 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -166,7 +166,7 @@ void SysMtgsThread::ThreadEntryPoint() GSshutdown(); } -void SysMtgsThread::ResetGS() +void SysMtgsThread::ResetGS(bool hardware_reset) { pxAssertDev(!IsOpen() || (m_ReadPos == m_WritePos), "Must close or terminate the GS thread prior to gsReset."); @@ -180,7 +180,7 @@ void SysMtgsThread::ResetGS() m_VsyncSignalListener = 0; MTGS_LOG("MTGS: Sending Reset..."); - SendSimplePacket(GS_RINGTYPE_RESET, 0, 0, 0); + SendSimplePacket(GS_RINGTYPE_RESET, static_cast(hardware_reset), 0, 0); SendSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0); SetEvent(); } @@ -495,7 +495,7 @@ void SysMtgsThread::MainLoop() case GS_RINGTYPE_RESET: MTGS_LOG("(MTGS Packet Read) ringtype=Reset"); - GSreset(); + GSreset(tag.data != 0); break; case GS_RINGTYPE_SOFTRESET: diff --git a/pcsx2/gui/Dialogs/GSDumpDialog.cpp b/pcsx2/gui/Dialogs/GSDumpDialog.cpp index 1c23f62558..06e5fd8f40 100644 --- a/pcsx2/gui/Dialogs/GSDumpDialog.cpp +++ b/pcsx2/gui/Dialogs/GSDumpDialog.cpp @@ -882,7 +882,7 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread() } GSvsync(1, false); - GSreset(); + GSreset(false); GSfreeze(FreezeAction::Load, &fd); size_t i = 0;