From 448009f4ef829e8a92a33f096c4010c6d709d2e3 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 22 Dec 2024 14:46:26 +1000 Subject: [PATCH] CPU/CodeCache: Fastmem RAM faults are always writes --- src/core/cpu_code_cache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index 98dfd8c18..39ae03825 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -1692,9 +1692,10 @@ PageFaultHandler::HandlerResult CPU::CodeCache::HandleFastmemException(void* exc // if we're writing to ram, let it go through a few times, and use manual block protection to sort it out // TODO: path for manual protection to return back to read-only pages - if (is_write && !g_state.cop0_regs.sr.Isc && GetSegmentForAddress(guest_address) != CPU::Segment::KSEG2 && + if (!g_state.cop0_regs.sr.Isc && GetSegmentForAddress(guest_address) != CPU::Segment::KSEG2 && AddressInRAM(guest_address)) { + DebugAssert(is_write); DEV_LOG("Ignoring fault due to RAM write @ 0x{:08X}", guest_address); InvalidateBlocksWithPageIndex(Bus::GetRAMCodePageIndex(guest_address)); return PageFaultHandler::HandlerResult::ContinueExecution;