From 998460b78bc6225561d1c39511069fc193f5fc71 Mon Sep 17 00:00:00 2001 From: Maufeat Date: Tue, 27 Jan 2026 04:27:49 +0100 Subject: [PATCH] [nce] use correct process memory in fault handlers (#3391) Lets you correctly play games in qlaunch on NCE Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3391 Reviewed-by: DraVee Reviewed-by: CamilleLaVey Co-authored-by: Maufeat Co-committed-by: Maufeat --- src/core/arm/nce/arm_nce.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/arm/nce/arm_nce.cpp b/src/core/arm/nce/arm_nce.cpp index cc1e016ba1..bbff9f2829 100644 --- a/src/core/arm/nce/arm_nce.cpp +++ b/src/core/arm/nce/arm_nce.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project @@ -144,7 +144,7 @@ bool ArmNce::HandleFailedGuestFault(GuestContext* guest_ctx, void* raw_info, voi bool ArmNce::HandleGuestAlignmentFault(GuestContext* guest_ctx, void* raw_info, void* raw_context) { auto& host_ctx = static_cast(raw_context)->uc_mcontext; auto* fpctx = GetFloatingPointState(host_ctx); - auto& memory = guest_ctx->system->ApplicationMemory(); + auto& memory = guest_ctx->parent->m_running_thread->GetOwnerProcess()->GetMemory(); // Match and execute an instruction. auto next_pc = MatchAndExecuteOneInstruction(memory, &host_ctx, fpctx); @@ -164,7 +164,8 @@ bool ArmNce::HandleGuestAccessFault(GuestContext* guest_ctx, void* raw_info, voi // TODO: handle accesses which split a page? const Common::ProcessAddress addr = (reinterpret_cast(info->si_addr) & ~Memory::YUZU_PAGEMASK); - if (guest_ctx->system->ApplicationMemory().InvalidateNCE(addr, Memory::YUZU_PAGESIZE)) { + auto& memory = guest_ctx->parent->m_running_thread->GetOwnerProcess()->GetMemory(); + if (memory.InvalidateNCE(addr, Memory::YUZU_PAGESIZE)) { // We handled the access successfully and are returning to guest code. return true; }