From d17be2c2ec1cfca4146dfd6fb26061dc66247522 Mon Sep 17 00:00:00 2001 From: Eladash Date: Mon, 22 Jul 2019 08:34:26 +0400 Subject: [PATCH] Fix similar bug in sys_rsx_context_iomap TODO: Is there an rsxmem unmap event for those cases? --- rpcs3/Emu/Cell/lv2/sys_rsx.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index 3cd09a11fb..a5fb399021 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -199,8 +199,9 @@ error_code sys_rsx_context_iomap(u32 context_id, u32 io, u32 ea, u32 size, u64 f for (u32 i = 0; i < size; i++) { + const u32 prev_ea = std::exchange(RSXIOMem.ea[io + i].raw(), ea + i); + if (prev_ea < 0xC00) RSXIOMem.io[prev_ea].raw() = 0xFFFF; // Clear previous mapping if exists RSXIOMem.io[ea + i].raw() = io + i; - RSXIOMem.ea[io + i].raw() = ea + i; } return CELL_OK;