VMManager / vuJIT: Fix save state loading and saving on ARM64

This commit is contained in:
Ty 2025-01-17 16:06:43 -05:00 committed by Ty
parent fbe0c8b9cc
commit 4a57bd7fd4
2 changed files with 24 additions and 2 deletions

View File

@ -2561,6 +2561,11 @@ void VMManager::InitializeCPUProviders()
CpuMicroVU0.Reserve();
CpuMicroVU1.Reserve();
#else
// Despite not having any VU recompilers on ARM64, therefore no MTVU,
// we still need the thread alive. Otherwise the read and write positions
// of the ring buffer wont match, and various systems in the emulator end up deadlocked.
vu1Thread.Open();
#endif
VifUnpackSSE_Init();
@ -2580,6 +2585,11 @@ void VMManager::ShutdownCPUProviders()
psxRec.Shutdown();
recCpu.Shutdown();
#else
// See the comment in the InitializeCPUProviders for an explaination why we
// still need to manage the MTVU thread.
if(vu1Thread.IsOpen())
vu1Thread.WaitVU();
#endif
}

View File

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: 2002-2024 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0
#include "common/Console.h"
#include "MTVU.h"
#include "SaveState.h"
#include "vtlb.h"
@ -13,6 +15,16 @@ void vtlb_DynBackpatchLoadStore(uptr code_address, u32 code_size, u32 guest_pc,
bool SaveStateBase::vuJITFreeze()
{
pxFailRel("Not implemented.");
return false;
if(IsSaving())
vu1Thread.WaitVU();
Console.Warning("recompiler state is stubbed in arm64!");
// HACK!!
// size of microRegInfo structure
std::array<u8,96> empty_data{};
Freeze(empty_data);
Freeze(empty_data);
return true;
}