mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
DolphinQt: Properly lock CPU before accessing emulated memory
This fixes a problem I was having where using frame advance with the debugger open would frequently cause panic alerts about invalid addresses due to the CPU thread changing MSR.DR while the host thread was trying to access memory. To aid in tracking down all the places where we weren't properly locking the CPU, I've created a new type (in Core.h) that you have to pass as a reference or pointer to functions that require running as the CPU thread.
This commit is contained in:
@ -11,6 +11,11 @@
|
||||
#include "DiscIO/DirectoryBlob.h"
|
||||
#include "DiscIO/RiivolutionParser.h"
|
||||
|
||||
namespace Core
|
||||
{
|
||||
class CPUThreadGuard;
|
||||
}
|
||||
|
||||
namespace DiscIO::Riivolution
|
||||
{
|
||||
struct SavegameRedirect
|
||||
@ -74,8 +79,10 @@ enum class PatchIndex
|
||||
void ApplyPatchesToFiles(const std::vector<Patch>& patches, PatchIndex index,
|
||||
std::vector<DiscIO::FSTBuilderNode>* fst,
|
||||
DiscIO::FSTBuilderNode* dol_node);
|
||||
void ApplyGeneralMemoryPatches(const std::vector<Patch>& patches);
|
||||
void ApplyApploaderMemoryPatches(const std::vector<Patch>& patches, u32 ram_address,
|
||||
void ApplyGeneralMemoryPatches(const Core::CPUThreadGuard& guard,
|
||||
const std::vector<Patch>& patches);
|
||||
void ApplyApploaderMemoryPatches(const Core::CPUThreadGuard& guard,
|
||||
const std::vector<Patch>& patches, u32 ram_address,
|
||||
u32 ram_length);
|
||||
std::optional<SavegameRedirect>
|
||||
ExtractSavegameRedirect(const std::vector<Patch>& riivolution_patches);
|
||||
|
Reference in New Issue
Block a user