From f260d1c60236a60a8042de4ecd65128ce6dae370 Mon Sep 17 00:00:00 2001 From: elisha464 Date: Wed, 22 Jan 2014 20:04:11 +0200 Subject: [PATCH] fix cellGcmMapMainMemory --- rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 998df1d900..eb12d007a1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -74,7 +74,7 @@ int cellGcmInit(u32 context_addr, u32 cmdSize, u32 ioSize, u32 ioAddress) InitOffsetTable(); Memory.RSXCMDMem.Alloc(cmdSize); - Memory.MemoryBlocks.push_back(Memory.RSXIOMem.SetRange(0xE0000000, 0x10000000/*256MB*/));//TODO: implement allocateAdressSpace in memoryBase + Memory.MemoryBlocks.push_back(Memory.RSXIOMem.SetRange(0x50000000, 0x10000000/*256MB*/));//TODO: implement allocateAdressSpace in memoryBase cellGcmMapEaIoAddress(ioAddress, 0, ioSize); u32 ctx_begin = ioAddress/* + 0x1000*/; @@ -702,12 +702,17 @@ int32_t cellGcmMapMainMemory(u64 ea, u32 size, mem32_t offset) //check if the mapping was successfull if(io = Memory.RSXIOMem.Map(ea, size, 0)) { + // convert to offset + io = io - Memory.RSXIOMem.GetStartAddr(); + //fill the offset table for(u32 i=0; i<(size >> 20); i++) { Memory.Write16(offsetTable.io + ((ea >> 20) + i)*sizeof(u16), (io >> 20) + i); Memory.Write16(offsetTable.ea + ((io >> 20) + i)*sizeof(u16), (ea >> 20) + i); } + + offset = io; } else {