From 586fe11e2243d74b9d40f8fab6c60e53ccc4c73b Mon Sep 17 00:00:00 2001 From: Eladash Date: Mon, 21 Oct 2019 23:07:50 +0300 Subject: [PATCH] Fix cellGcm HLE regression Also correct flags. --- rpcs3/Emu/Cell/Modules/cellGcmSys.cpp | 5 ++--- rpcs3/Emu/Cell/lv2/sys_rsx.h | 6 ++++++ rpcs3/Emu/RSX/Capture/rsx_replay.cpp | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp index cc23c7d870..a3525a1add 100644 --- a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp @@ -969,8 +969,7 @@ s32 gcmMapEaIoAddress(u32 ea, u32 io, u32 size, bool is_strict) return CELL_GCM_ERROR_FAILURE; } - // TODO: Pass correct flags and context - if (s32 error = sys_rsx_context_iomap(0, io, ea, size, 0)) + if (s32 error = sys_rsx_context_iomap(0x55555555, io, ea, size, 0xe000000000000800ull | (u64{is_strict} << 60))) { return error; } @@ -1035,7 +1034,7 @@ s32 cellGcmMapMainMemory(u32 ea, u32 size, vm::ptr offset) { if (unmap_count >= (size >> 20)) { - if (s32 error = sys_rsx_context_iomap(0, io << 20, ea, size, 0)) + if (s32 error = sys_rsx_context_iomap(0x55555555, io << 20, ea, size, 0xe000000000000800ull)) { return error; } diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.h b/rpcs3/Emu/Cell/lv2/sys_rsx.h index a9710e0c62..84c4daf7d9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.h +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.h @@ -56,6 +56,12 @@ struct RsxDriverInfo static_assert(sizeof(RsxDriverInfo) == 0x12F8, "rsxSizeTest"); static_assert(sizeof(RsxDriverInfo::Head) == 0x40, "rsxHeadSizeTest"); +enum : u64 +{ + // Unused + SYS_RSX_IO_MAP_IS_STRICT = 1ull << 60 +}; + struct RsxDmaControl { u8 resv[0x40]; diff --git a/rpcs3/Emu/RSX/Capture/rsx_replay.cpp b/rpcs3/Emu/RSX/Capture/rsx_replay.cpp index 1d751d8dbc..f002d23d76 100644 --- a/rpcs3/Emu/RSX/Capture/rsx_replay.cpp +++ b/rpcs3/Emu/RSX/Capture/rsx_replay.cpp @@ -50,7 +50,7 @@ namespace rsx get_current_renderer()->main_mem_size = buffer_size; - if (sys_rsx_context_iomap(contextInfo->context_id, 0, user_mem_addr, buffer_size, 0) != CELL_OK) + if (sys_rsx_context_iomap(contextInfo->context_id, 0, user_mem_addr, buffer_size, 0xf000000000000800ull) != CELL_OK) fmt::throw_exception("Capture Replay: rsx io mapping failed!"); return contextInfo->context_id;