From ce98c962f8d752f557c943369c1d71808b155c4b Mon Sep 17 00:00:00 2001 From: eladash Date: Tue, 22 May 2018 21:16:22 +0300 Subject: [PATCH] cellgcm: use offset table to get the corresponding address to io address --- rpcs3/Emu/Cell/Modules/cellGcmSys.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp index b374f27703..dfaa9bca4e 100644 --- a/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGcmSys.cpp @@ -919,12 +919,15 @@ s32 cellGcmIoOffsetToAddress(u32 ioOffset, vm::ptr address) { cellGcmSys.trace("cellGcmIoOffsetToAddress(ioOffset=0x%x, address=*0x%x)", ioOffset, address); - u32 realAddr; + const u32 upper12Bits = offsetTable.eaAddress[ioOffset >> 20]; - if (!RSXIOMem.getRealAddr(ioOffset, realAddr)) + if (static_cast(upper12Bits) < 0) + { + cellGcmSys.error("cellGcmIoOffsetToAddress: CELL_GCM_ERROR_FAILURE"); return CELL_GCM_ERROR_FAILURE; + } - *address = realAddr; + *address = (upper12Bits << 20) | (ioOffset & 0xFFFFF); return CELL_OK; }