mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
cellgcm: use offset table to get the corresponding address to io address
This commit is contained in:
parent
c2b2dee56d
commit
ce98c962f8
@ -919,12 +919,15 @@ s32 cellGcmIoOffsetToAddress(u32 ioOffset, vm::ptr<u32> 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<s16>(upper12Bits) < 0)
|
||||
{
|
||||
cellGcmSys.error("cellGcmIoOffsetToAddress: CELL_GCM_ERROR_FAILURE");
|
||||
return CELL_GCM_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
*address = realAddr;
|
||||
*address = (upper12Bits << 20) | (ioOffset & 0xFFFFF);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user